4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
17 AC_PATH_PROGS(PERL, perl5 perl)
18 AC_PATH_PROG(SED, sed)
20 AC_PATH_PROG(ENT, ent)
22 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
23 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
24 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
30 if test -z "$AR" ; then
31 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
34 # Use LOGIN_PROGRAM from environment if possible
35 if test ! -z "$LOGIN_PROGRAM" ; then
36 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
39 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
40 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
41 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
45 if test -z "$LD" ; then
51 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
52 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
55 # Check for some target-specific stuff
58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
61 if (test -z "$blibpath"); then
62 blibpath="/usr/lib:/lib:/usr/local/lib"
64 saved_LDFLAGS="$LDFLAGS"
65 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
66 if (test -z "$blibflags"); then
67 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
68 AC_TRY_LINK([], [], [blibflags=$tryflags])
71 if (test -z "$blibflags"); then
72 AC_MSG_RESULT(not found)
73 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
75 AC_MSG_RESULT($blibflags)
77 LDFLAGS="$saved_LDFLAGS"
78 dnl Check for authenticate. Might be in libs.a on older AIXes
79 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
80 [AC_CHECK_LIB(s,authenticate,
81 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
85 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
86 AC_CHECK_DECL(loginfailed,
87 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
89 [#include <usersec.h>],
90 [(void)loginfailed("user","host","tty",0);],
92 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
96 [#include <usersec.h>]
98 AC_CHECK_FUNCS(setauthdb)
99 AC_DEFINE(BROKEN_GETADDRINFO)
100 AC_DEFINE(BROKEN_REALPATH)
101 AC_DEFINE(SETEUID_BREAKS_SETUID)
102 AC_DEFINE(BROKEN_SETREUID)
103 AC_DEFINE(BROKEN_SETREGID)
104 dnl AIX handles lastlog as part of its login message
105 AC_DEFINE(DISABLE_LASTLOG)
106 AC_DEFINE(LOGIN_NEEDS_UTMPX)
107 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
110 check_for_libcrypt_later=1
111 LIBS="$LIBS /usr/lib/textmode.o"
112 AC_DEFINE(HAVE_CYGWIN)
114 AC_DEFINE(DISABLE_SHADOW)
115 AC_DEFINE(IP_TOS_IS_BROKEN)
116 AC_DEFINE(NO_X11_UNIX_SOCKETS)
117 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
118 AC_DEFINE(DISABLE_FD_PASSING)
119 AC_DEFINE(SETGROUPS_NOOP)
122 AC_DEFINE(IP_TOS_IS_BROKEN)
125 AC_MSG_CHECKING(if we have working getaddrinfo)
126 AC_TRY_RUN([#include <mach-o/dyld.h>
127 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
131 }], [AC_MSG_RESULT(working)],
132 [AC_MSG_RESULT(buggy)
133 AC_DEFINE(BROKEN_GETADDRINFO)],
134 [AC_MSG_RESULT(assume it is working)])
137 if test -z "$GCC"; then
140 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
141 IPADDR_IN_DISPLAY=yes
142 AC_DEFINE(HAVE_SECUREWARE)
144 AC_DEFINE(LOGIN_NO_ENDOPT)
145 AC_DEFINE(LOGIN_NEEDS_UTMPX)
146 AC_DEFINE(DISABLE_SHADOW)
147 AC_DEFINE(DISABLE_UTMP)
148 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
149 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
150 LIBS="$LIBS -lsec -lsecpw"
151 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
152 disable_ptmx_check=yes
155 if test -z "$GCC"; then
158 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
159 IPADDR_IN_DISPLAY=yes
161 AC_DEFINE(LOGIN_NO_ENDOPT)
162 AC_DEFINE(LOGIN_NEEDS_UTMPX)
163 AC_DEFINE(DISABLE_SHADOW)
164 AC_DEFINE(DISABLE_UTMP)
165 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
166 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
168 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
171 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
172 IPADDR_IN_DISPLAY=yes
173 AC_DEFINE(PAM_SUN_CODEBASE)
175 AC_DEFINE(LOGIN_NO_ENDOPT)
176 AC_DEFINE(LOGIN_NEEDS_UTMPX)
177 AC_DEFINE(DISABLE_SHADOW)
178 AC_DEFINE(DISABLE_UTMP)
179 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
180 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
182 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
187 PATH="$PATH:/usr/etc"
188 AC_DEFINE(BROKEN_INET_NTOA)
189 AC_DEFINE(WITH_ABBREV_NO_TTY)
190 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
195 PATH="$PATH:/usr/etc"
196 AC_DEFINE(WITH_IRIX_ARRAY)
197 AC_DEFINE(WITH_IRIX_PROJECT)
198 AC_DEFINE(WITH_IRIX_AUDIT)
199 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
200 AC_DEFINE(BROKEN_INET_NTOA)
201 AC_DEFINE(WITH_ABBREV_NO_TTY)
202 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
206 check_for_libcrypt_later=1
207 check_for_openpty_ctty_bug=1
208 AC_DEFINE(DONT_TRY_OTHER_AF)
209 AC_DEFINE(PAM_TTY_KLUDGE)
210 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
211 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
212 inet6_default_4in6=yes
215 AC_DEFINE(BROKEN_CMSG_TYPE)
219 mips-sony-bsd|mips-sony-newsos4)
220 AC_DEFINE(HAVE_NEWS4)
224 check_for_libcrypt_before=1
228 check_for_libcrypt_later=1
231 conf_lastlog_location="/usr/adm/lastlog"
232 conf_utmp_location=/etc/utmp
233 conf_wtmp_location=/usr/adm/wtmp
236 AC_DEFINE(BROKEN_REALPATH)
238 AC_DEFINE(BROKEN_SAVED_UIDS)
239 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
243 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
244 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
246 AC_DEFINE(PAM_SUN_CODEBASE)
247 AC_DEFINE(LOGIN_NEEDS_UTMPX)
248 AC_DEFINE(LOGIN_NEEDS_TERM)
249 AC_DEFINE(PAM_TTY_KLUDGE)
250 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
251 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
252 AC_DEFINE(SSHD_ACQUIRES_CTTY)
253 external_path_file=/etc/default/login
254 # hardwire lastlog location (can't detect it on some versions)
255 conf_lastlog_location="/var/adm/lastlog"
256 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
257 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
258 if test "$sol2ver" -ge 8; then
260 AC_DEFINE(DISABLE_UTMP)
261 AC_DEFINE(DISABLE_WTMP)
267 CPPFLAGS="$CPPFLAGS -DSUNOS4"
268 AC_CHECK_FUNCS(getpwanam)
269 AC_DEFINE(PAM_SUN_CODEBASE)
270 conf_utmp_location=/etc/utmp
271 conf_wtmp_location=/var/adm/wtmp
272 conf_lastlog_location=/var/adm/lastlog
276 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
277 LDFLAGS="$LDFLAGS -L/usr/local/lib"
280 AC_DEFINE(SSHD_ACQUIRES_CTTY)
283 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
284 # /usr/ucblib MUST NOT be searched on ReliantUNIX
285 LDFLAGS="$LDFLAGS -L/usr/local/lib"
286 IPADDR_IN_DISPLAY=yes
288 AC_DEFINE(IP_TOS_IS_BROKEN)
289 AC_DEFINE(SSHD_ACQUIRES_CTTY)
290 external_path_file=/etc/default/login
291 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
292 # Attention: always take care to bind libsocket and libnsl before libc,
293 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
296 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
297 LDFLAGS="$LDFLAGS -L/usr/local/lib"
299 AC_DEFINE(SETEUID_BREAKS_SETUID)
300 AC_DEFINE(BROKEN_SETREUID)
301 AC_DEFINE(BROKEN_SETREGID)
304 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
305 LDFLAGS="$LDFLAGS -L/usr/local/lib"
307 AC_DEFINE(SETEUID_BREAKS_SETUID)
308 AC_DEFINE(BROKEN_SETREUID)
309 AC_DEFINE(BROKEN_SETREGID)
312 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
313 LDFLAGS="$LDFLAGS -L/usr/local/lib"
316 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
317 LDFLAGS="$LDFLAGS -L/usr/local/lib"
318 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
321 AC_DEFINE(BROKEN_SYS_TERMIO_H)
323 AC_DEFINE(HAVE_SECUREWARE)
324 AC_DEFINE(DISABLE_SHADOW)
325 AC_DEFINE(BROKEN_SAVED_UIDS)
326 AC_DEFINE(WITH_ABBREV_NO_TTY)
327 AC_CHECK_FUNCS(getluid setluid)
329 do_sco3_extra_lib_check=yes
332 if test -z "$GCC"; then
333 CFLAGS="$CFLAGS -belf"
335 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
336 LDFLAGS="$LDFLAGS -L/usr/local/lib"
337 LIBS="$LIBS -lprot -lx -ltinfo -lm"
340 AC_DEFINE(HAVE_SECUREWARE)
341 AC_DEFINE(DISABLE_SHADOW)
342 AC_DEFINE(DISABLE_FD_PASSING)
343 AC_DEFINE(SETEUID_BREAKS_SETUID)
344 AC_DEFINE(BROKEN_SETREUID)
345 AC_DEFINE(BROKEN_SETREGID)
346 AC_DEFINE(WITH_ABBREV_NO_TTY)
347 AC_CHECK_FUNCS(getluid setluid)
352 AC_DEFINE(DISABLE_FD_PASSING)
354 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
358 AC_DEFINE(WITH_ABBREV_NO_TTY)
360 AC_DEFINE(DISABLE_FD_PASSING)
362 LIBS="$LIBS -lgen -lacid"
367 AC_DEFINE(DISABLE_FD_PASSING)
368 AC_DEFINE(NO_SSH_LASTLOG)
369 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
370 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
374 AC_MSG_CHECKING(for Digital Unix SIA)
377 [ --with-osfsia Enable Digital Unix SIA],
379 if test "x$withval" = "xno" ; then
380 AC_MSG_RESULT(disabled)
385 if test -z "$no_osfsia" ; then
386 if test -f /etc/sia/matrix.conf; then
388 AC_DEFINE(HAVE_OSF_SIA)
389 AC_DEFINE(DISABLE_LOGIN)
390 AC_DEFINE(DISABLE_FD_PASSING)
391 LIBS="$LIBS -lsecurity -ldb -lm -laud"
396 AC_DEFINE(DISABLE_FD_PASSING)
397 AC_DEFINE(BROKEN_GETADDRINFO)
398 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
403 AC_DEFINE(NO_X11_UNIX_SOCKETS)
404 AC_DEFINE(MISSING_NFDBITS)
405 AC_DEFINE(MISSING_HOWMANY)
406 AC_DEFINE(MISSING_FD_MASK)
410 # Allow user to specify flags
412 [ --with-cflags Specify additional flags to pass to compiler],
414 if test "x$withval" != "xno" ; then
415 CFLAGS="$CFLAGS $withval"
419 AC_ARG_WITH(cppflags,
420 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
422 if test "x$withval" != "xno"; then
423 CPPFLAGS="$CPPFLAGS $withval"
428 [ --with-ldflags Specify additional flags to pass to linker],
430 if test "x$withval" != "xno" ; then
431 LDFLAGS="$LDFLAGS $withval"
436 [ --with-libs Specify additional libraries to link with],
438 if test "x$withval" != "xno" ; then
439 LIBS="$LIBS $withval"
444 AC_MSG_CHECKING(compiler and flags for sanity)
449 [ AC_MSG_RESULT(yes) ],
452 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
456 # Checks for header files.
457 AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
458 getopt.h glob.h ia.h lastlog.h limits.h login.h \
459 login_cap.h maillock.h netdb.h netgroup.h \
460 netinet/in_systm.h paths.h pty.h readpassphrase.h \
461 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
462 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
463 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
464 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
465 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
466 util.h utime.h utmp.h utmpx.h)
468 # Checks for libraries.
469 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
470 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
472 dnl SCO OS3 needs this for libwrap
473 if test "x$with_tcp_wrappers" != "xno" ; then
474 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
475 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
479 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
480 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
481 AC_CHECK_LIB(gen, dirname,[
482 AC_CACHE_CHECK([for broken dirname],
483 ac_cv_have_broken_dirname, [
491 int main(int argc, char **argv) {
494 strncpy(buf,"/etc", 32);
496 if (!s || strncmp(s, "/", 32) != 0) {
503 [ ac_cv_have_broken_dirname="no" ],
504 [ ac_cv_have_broken_dirname="yes" ]
508 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
510 AC_DEFINE(HAVE_DIRNAME)
511 AC_CHECK_HEADERS(libgen.h)
516 AC_CHECK_FUNC(getspnam, ,
517 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
518 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
521 [ --without-rpath Disable auto-added -R linker paths],
523 if test "x$withval" = "xno" ; then
526 if test "x$withval" = "xyes" ; then
534 [ --with-zlib=PATH Use zlib in PATH],
536 if test "x$withval" = "xno" ; then
537 AC_MSG_ERROR([*** zlib is required ***])
539 if test -d "$withval/lib"; then
540 if test -n "${need_dash_r}"; then
541 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
543 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
546 if test -n "${need_dash_r}"; then
547 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
549 LDFLAGS="-L${withval} ${LDFLAGS}"
552 if test -d "$withval/include"; then
553 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
555 CPPFLAGS="-I${withval} ${CPPFLAGS}"
560 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
563 AC_CHECK_FUNC(strcasecmp,
564 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
566 AC_CHECK_FUNC(utimes,
567 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
568 LIBS="$LIBS -lc89"]) ]
571 dnl Checks for libutil functions
572 AC_CHECK_HEADERS(libutil.h)
573 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
574 AC_CHECK_FUNCS(logout updwtmp logwtmp)
578 # Check for ALTDIRFUNC glob() extension
579 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
580 AC_EGREP_CPP(FOUNDIT,
583 #ifdef GLOB_ALTDIRFUNC
588 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
596 # Check for g.gl_matchc glob() extension
597 AC_MSG_CHECKING(for gl_matchc field in glob_t)
598 AC_EGREP_CPP(FOUNDIT,
601 int main(void){glob_t g; g.gl_matchc = 1;}
604 AC_DEFINE(GLOB_HAS_GL_MATCHC)
612 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
615 #include <sys/types.h>
617 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
619 [AC_MSG_RESULT(yes)],
622 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
626 # Check whether the user wants GSSAPI mechglue support
627 AC_ARG_WITH(mechglue,
628 [ --with-mechglue=PATH Build with GSSAPI mechglue library],
630 AC_MSG_CHECKING(for mechglue library)
632 if test -e ${withval}/libgssapi.a ; then
633 mechglue_lib=${withval}/libgssapi.a
634 elif test -e ${withval}/lib/libgssapi.a ; then
635 mechglue_lib=${withval}/lib/libgssapi.a
637 AC_MSG_ERROR("Can't find libgssapi in ${withval}");
639 LIBS="$LIBS ${mechglue_lib}"
640 AC_MSG_RESULT(${mechglue_lib})
642 AC_CHECK_LIB(dl, dlopen, , )
643 if test $ac_cv_lib_dl_dlopen = yes; then
644 LDFLAGS="$LDFLAGS -ldl -Wl,-Bsymbolic"
655 # Check whether the user wants GSI (Globus) support
658 [ --with-gsi=PATH Enable GSI/Globus authentication support],
665 [ --with-globus=PATH Enable GSI/Globus authentication support],
671 # Check whether the user has a Globus flavor type
672 globus_flavor_type="no"
673 AC_ARG_WITH(globus-flavor,
674 [ --with-globus-flavor=TYPE Describe Globus flavor type (ex: gcc32dbg, etc.)],
676 globus_flavor_type="$withval"
680 if test "x$gsi_path" != "xno" ; then
681 # Globus GSSAPI configuration
682 AC_MSG_CHECKING(for Globus GSI)
685 if test "$GSSAPI" -a "$GSSAPI" != "mechglue"; then
686 AC_MSG_ERROR([Previously configured GSSAPI library conflicts with Globus/GSI.])
688 if test -z "$GSSAPI"; then
693 if test "x$globus_install_dir" = "xyes" ; then
694 AC_MSG_ERROR(--with-globus=PATH must specify a path)
697 if test "x$globus_flavor_type" = "xno" ; then
698 AC_MSG_ERROR(--with-globus-flavor=TYPE must be specified)
700 if test "x$globus_flavor_type" = "xyes" ; then
701 AC_MSG_ERROR(--with-globus-flavor=TYPE must specify a flavor type)
704 GLOBUS_INCLUDE="${gsi_path}/include/${globus_flavor_type}"
705 if test ! -d "$GLOBUS_INCLUDE" ; then
706 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_INCLUDE})
708 GSI_CPPFLAGS="-I${GLOBUS_INCLUDE}"
710 if test -x ${gsi_path}/bin/globus-makefile-header ; then
711 GSI_LDFLAGS="-L${gsi_path}/lib"
712 GSI_LIBS=`${gsi_path}/bin/globus-makefile-header -flavor=${globus_flavor_type} globus_gss_assist | perl -n -e 'if (/GLOBUS_PKG_LIBS = (.*)/){print $1;}'`
713 elif test -x ${gsi_path}/sbin/globus-makefile-header ; then
714 GSI_LDFLAGS="-L${gsi_path}/lib"
715 GSI_LIBS=`${gsi_path}/sbin/globus-makefile-header -flavor=${globus_flavor_type} globus_gss_assist | perl -n -e 'if (/GLOBUS_PKG_LIBS = (.*)/){print $1;}'`
717 AC_MSG_ERROR(Cannot find globus-makefile-header: Globus installation is incomplete)
719 if test -z "$GSI_LIBS" ; then
720 AC_MSG_ERROR(globus-makefile-header failed)
723 LIBS="$LIBS $GSI_LIBS"
724 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
725 CPPFLAGS="$CPPFLAGS $GSI_CPPFLAGS"
727 # test that we got the libraries OK
735 AC_MSG_ERROR(link with Globus libraries failed)
742 AC_SUBST(INSTALL_GSISSH)
743 # End Globus/GSI section
745 # Check whether user wants S/Key support
748 [ --with-skey[[=PATH]] Enable S/Key support
749 (optionally in PATH)],
751 if test "x$withval" != "xno" ; then
753 if test "x$withval" != "xyes" ; then
754 CPPFLAGS="$CPPFLAGS -I${withval}/include"
755 LDFLAGS="$LDFLAGS -L${withval}/lib"
762 AC_MSG_CHECKING([for s/key support])
767 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
769 [AC_MSG_RESULT(yes)],
772 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
778 # Check whether user wants TCP wrappers support
780 AC_ARG_WITH(tcp-wrappers,
781 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
782 (optionally in PATH)],
784 if test "x$withval" != "xno" ; then
786 saved_LDFLAGS="$LDFLAGS"
787 saved_CPPFLAGS="$CPPFLAGS"
788 if test -n "${withval}" -a "${withval}" != "yes"; then
789 if test -d "${withval}/lib"; then
790 if test -n "${need_dash_r}"; then
791 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
793 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
796 if test -n "${need_dash_r}"; then
797 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
799 LDFLAGS="-L${withval} ${LDFLAGS}"
802 if test -d "${withval}/include"; then
803 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
805 CPPFLAGS="-I${withval} ${CPPFLAGS}"
809 LIBS="$LIBWRAP $LIBS"
810 AC_MSG_CHECKING(for libwrap)
814 int deny_severity = 0, allow_severity = 0;
824 AC_MSG_ERROR([*** libwrap missing])
832 dnl Checks for library functions. Please keep in alphabetical order
834 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
835 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
836 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
837 getpeereid _getpty getrlimit getttyent glob inet_aton \
838 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
839 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
840 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
841 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
842 setproctitle setregid setresgid setresuid setreuid setrlimit \
843 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
844 strlcat strlcpy strmode strnvis sysconf tcgetpgrp \
845 truncate utimes vhangup vsnprintf waitpid \
848 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
850 dnl Make sure prototypes are defined for these before using them.
851 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
852 AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
854 dnl tcsendbreak might be a macro
855 AC_CHECK_DECL(tcsendbreak,
856 [AC_DEFINE(HAVE_TCSENDBREAK)],
857 [AC_CHECK_FUNCS(tcsendbreak)],
858 [#include <termios.h>]
861 dnl Checks for time functions
862 AC_CHECK_FUNCS(gettimeofday time)
863 dnl Checks for utmp functions
864 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
865 AC_CHECK_FUNCS(utmpname)
866 dnl Checks for utmpx functions
867 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
868 AC_CHECK_FUNCS(setutxent utmpxname)
870 AC_CHECK_FUNC(daemon,
871 [AC_DEFINE(HAVE_DAEMON)],
872 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
875 AC_CHECK_FUNC(getpagesize,
876 [AC_DEFINE(HAVE_GETPAGESIZE)],
877 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
880 # Check for broken snprintf
881 if test "x$ac_cv_func_snprintf" = "xyes" ; then
882 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
886 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
888 [AC_MSG_RESULT(yes)],
891 AC_DEFINE(BROKEN_SNPRINTF)
892 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
897 dnl see whether mkstemp() requires XXXXXX
898 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
899 AC_MSG_CHECKING([for (overly) strict mkstemp])
903 main() { char template[]="conftest.mkstemp-test";
904 if (mkstemp(template) == -1)
906 unlink(template); exit(0);
914 AC_DEFINE(HAVE_STRICT_MKSTEMP)
918 AC_DEFINE(HAVE_STRICT_MKSTEMP)
923 dnl make sure that openpty does not reacquire controlling terminal
924 if test ! -z "$check_for_openpty_ctty_bug"; then
925 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
929 #include <sys/fcntl.h>
930 #include <sys/types.h>
931 #include <sys/wait.h>
937 int fd, ptyfd, ttyfd, status;
940 if (pid < 0) { /* failed */
942 } else if (pid > 0) { /* parent */
943 waitpid(pid, &status, 0);
944 if (WIFEXITED(status))
945 exit(WEXITSTATUS(status));
949 close(0); close(1); close(2);
951 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
952 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
954 exit(3); /* Acquired ctty: broken */
956 exit(0); /* Did not acquire ctty: OK */
965 AC_DEFINE(SSHD_ACQUIRES_CTTY)
975 [ --with-pam Enable PAM support ],
977 if test "x$withval" != "xno" ; then
978 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
979 AC_MSG_ERROR([PAM headers not found])
982 AC_CHECK_LIB(dl, dlopen, , )
983 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
984 AC_CHECK_FUNCS(pam_getenvlist)
985 AC_CHECK_FUNCS(pam_putenv)
991 if test $ac_cv_lib_dl_dlopen = yes; then
1001 # Check for older PAM
1002 if test "x$PAM_MSG" = "xyes" ; then
1003 # Check PAM strerror arguments (old PAM)
1004 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1008 #include <security/pam_appl.h>
1010 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
1011 [AC_MSG_RESULT(no)],
1013 AC_DEFINE(HAVE_OLD_PAM)
1015 PAM_MSG="yes (old library)"
1020 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1021 # because the system crypt() is more featureful.
1022 if test "x$check_for_libcrypt_before" = "x1"; then
1023 AC_CHECK_LIB(crypt, crypt)
1026 # Search for OpenSSL
1027 saved_CPPFLAGS="$CPPFLAGS"
1028 saved_LDFLAGS="$LDFLAGS"
1029 AC_ARG_WITH(ssl-dir,
1030 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1032 if test "x$withval" != "xno" ; then
1033 if test -d "$withval/lib"; then
1034 if test -n "${need_dash_r}"; then
1035 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1037 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1040 if test -n "${need_dash_r}"; then
1041 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1043 LDFLAGS="-L${withval} ${LDFLAGS}"
1046 if test -d "$withval/include"; then
1047 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1049 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1054 if test -z "$GSI_LIBS" ; then
1055 LIBS="$LIBS -lcrypto"
1057 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1059 dnl Check default openssl install dir
1060 if test -n "${need_dash_r}"; then
1061 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
1063 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
1065 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1066 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1068 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1074 # Determine OpenSSL header version
1075 AC_MSG_CHECKING([OpenSSL header version])
1080 #include <openssl/opensslv.h>
1081 #define DATA "conftest.sslincver"
1086 fd = fopen(DATA,"w");
1090 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1097 ssl_header_ver=`cat conftest.sslincver`
1098 AC_MSG_RESULT($ssl_header_ver)
1101 AC_MSG_RESULT(not found)
1102 AC_MSG_ERROR(OpenSSL version header not found.)
1106 # Determine OpenSSL library version
1107 AC_MSG_CHECKING([OpenSSL library version])
1112 #include <openssl/opensslv.h>
1113 #include <openssl/crypto.h>
1114 #define DATA "conftest.ssllibver"
1119 fd = fopen(DATA,"w");
1123 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1130 ssl_library_ver=`cat conftest.ssllibver`
1131 AC_MSG_RESULT($ssl_library_ver)
1134 AC_MSG_RESULT(not found)
1135 AC_MSG_ERROR(OpenSSL library not found.)
1139 # Sanity check OpenSSL headers
1140 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1144 #include <openssl/opensslv.h>
1145 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
1152 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1153 Check config.log for details.
1154 Also see contrib/findssl.sh for help identifying header/library mismatches.])
1158 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1159 # version in OpenSSL. Skip this for PAM
1160 if test "x$check_for_libcrypt_later" = "x1"; then
1161 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
1165 ### Configure cryptographic random number support
1167 # Check wheter OpenSSL seeds itself
1168 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1172 #include <openssl/rand.h>
1173 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
1176 OPENSSL_SEEDS_ITSELF=yes
1181 # Default to use of the rand helper if OpenSSL doesn't
1188 # Do we want to force the use of the rand helper?
1189 AC_ARG_WITH(rand-helper,
1190 [ --with-rand-helper Use subprocess to gather strong randomness ],
1192 if test "x$withval" = "xno" ; then
1193 # Force use of OpenSSL's internal RNG, even if
1194 # the previous test showed it to be unseeded.
1195 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1196 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1197 OPENSSL_SEEDS_ITSELF=yes
1206 # Which randomness source do we use?
1207 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1209 AC_DEFINE(OPENSSL_PRNG_ONLY)
1210 RAND_MSG="OpenSSL internal ONLY"
1211 INSTALL_SSH_RAND_HELPER=""
1212 elif test ! -z "$USE_RAND_HELPER" ; then
1213 # install rand helper
1214 RAND_MSG="ssh-rand-helper"
1215 INSTALL_SSH_RAND_HELPER="yes"
1217 AC_SUBST(INSTALL_SSH_RAND_HELPER)
1219 ### Configuration of ssh-rand-helper
1222 AC_ARG_WITH(prngd-port,
1223 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1232 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1235 if test ! -z "$withval" ; then
1236 PRNGD_PORT="$withval"
1237 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1242 # PRNGD Unix domain socket
1243 AC_ARG_WITH(prngd-socket,
1244 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1248 withval="/var/run/egd-pool"
1256 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1260 if test ! -z "$withval" ; then
1261 if test ! -z "$PRNGD_PORT" ; then
1262 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1264 if test ! -r "$withval" ; then
1265 AC_MSG_WARN(Entropy socket is not readable)
1267 PRNGD_SOCKET="$withval"
1268 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1272 # Check for existing socket only if we don't have a random device already
1273 if test "$USE_RAND_HELPER" = yes ; then
1274 AC_MSG_CHECKING(for PRNGD/EGD socket)
1275 # Insert other locations here
1276 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1277 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1278 PRNGD_SOCKET="$sock"
1279 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1283 if test ! -z "$PRNGD_SOCKET" ; then
1284 AC_MSG_RESULT($PRNGD_SOCKET)
1286 AC_MSG_RESULT(not found)
1292 # Change default command timeout for hashing entropy source
1294 AC_ARG_WITH(entropy-timeout,
1295 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1297 if test "x$withval" != "xno" ; then
1298 entropy_timeout=$withval
1302 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1304 SSH_PRIVSEP_USER=sshd
1305 AC_ARG_WITH(privsep-user,
1306 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1308 if test -n "$withval"; then
1309 SSH_PRIVSEP_USER=$withval
1313 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1314 AC_SUBST(SSH_PRIVSEP_USER)
1316 # We do this little dance with the search path to insure
1317 # that programs that we select for use by installed programs
1318 # (which may be run by the super-user) come from trusted
1319 # locations before they come from the user's private area.
1320 # This should help avoid accidentally configuring some
1321 # random version of a program in someone's personal bin.
1325 test -h /bin 2> /dev/null && PATH=/usr/bin
1326 test -d /sbin && PATH=$PATH:/sbin
1327 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1328 PATH=$PATH:/etc:$OPATH
1330 # These programs are used by the command hashing source to gather entropy
1331 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1332 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1333 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1334 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1335 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1336 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1337 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1338 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1339 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1340 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1341 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1342 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1343 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1344 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1345 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1346 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1350 # Where does ssh-rand-helper get its randomness from?
1351 INSTALL_SSH_PRNG_CMDS=""
1352 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1353 if test ! -z "$PRNGD_PORT" ; then
1354 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1355 elif test ! -z "$PRNGD_SOCKET" ; then
1356 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1358 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1359 RAND_HELPER_CMDHASH=yes
1360 INSTALL_SSH_PRNG_CMDS="yes"
1363 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1366 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1367 if test ! -z "$SONY" ; then
1368 LIBS="$LIBS -liberty";
1371 # Checks for data types
1372 AC_CHECK_SIZEOF(char, 1)
1373 AC_CHECK_SIZEOF(short int, 2)
1374 AC_CHECK_SIZEOF(int, 4)
1375 AC_CHECK_SIZEOF(long int, 4)
1376 AC_CHECK_SIZEOF(long long int, 8)
1378 # Sanity check long long for some platforms (AIX)
1379 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1380 ac_cv_sizeof_long_long_int=0
1383 # More checks for data types
1384 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1386 [ #include <sys/types.h> ],
1388 [ ac_cv_have_u_int="yes" ],
1389 [ ac_cv_have_u_int="no" ]
1392 if test "x$ac_cv_have_u_int" = "xyes" ; then
1393 AC_DEFINE(HAVE_U_INT)
1397 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1399 [ #include <sys/types.h> ],
1400 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1401 [ ac_cv_have_intxx_t="yes" ],
1402 [ ac_cv_have_intxx_t="no" ]
1405 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1406 AC_DEFINE(HAVE_INTXX_T)
1410 if (test -z "$have_intxx_t" && \
1411 test "x$ac_cv_header_stdint_h" = "xyes")
1413 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1415 [ #include <stdint.h> ],
1416 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1418 AC_DEFINE(HAVE_INTXX_T)
1421 [ AC_MSG_RESULT(no) ]
1425 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1428 #include <sys/types.h>
1429 #ifdef HAVE_STDINT_H
1430 # include <stdint.h>
1432 #include <sys/socket.h>
1433 #ifdef HAVE_SYS_BITYPES_H
1434 # include <sys/bitypes.h>
1437 [ int64_t a; a = 1;],
1438 [ ac_cv_have_int64_t="yes" ],
1439 [ ac_cv_have_int64_t="no" ]
1442 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1443 AC_DEFINE(HAVE_INT64_T)
1446 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1448 [ #include <sys/types.h> ],
1449 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1450 [ ac_cv_have_u_intxx_t="yes" ],
1451 [ ac_cv_have_u_intxx_t="no" ]
1454 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1455 AC_DEFINE(HAVE_U_INTXX_T)
1459 if test -z "$have_u_intxx_t" ; then
1460 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1462 [ #include <sys/socket.h> ],
1463 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1465 AC_DEFINE(HAVE_U_INTXX_T)
1468 [ AC_MSG_RESULT(no) ]
1472 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1474 [ #include <sys/types.h> ],
1475 [ u_int64_t a; a = 1;],
1476 [ ac_cv_have_u_int64_t="yes" ],
1477 [ ac_cv_have_u_int64_t="no" ]
1480 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1481 AC_DEFINE(HAVE_U_INT64_T)
1485 if test -z "$have_u_int64_t" ; then
1486 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1488 [ #include <sys/bitypes.h> ],
1489 [ u_int64_t a; a = 1],
1491 AC_DEFINE(HAVE_U_INT64_T)
1494 [ AC_MSG_RESULT(no) ]
1498 if test -z "$have_u_intxx_t" ; then
1499 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1502 #include <sys/types.h>
1504 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1505 [ ac_cv_have_uintxx_t="yes" ],
1506 [ ac_cv_have_uintxx_t="no" ]
1509 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1510 AC_DEFINE(HAVE_UINTXX_T)
1514 if test -z "$have_uintxx_t" ; then
1515 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1517 [ #include <stdint.h> ],
1518 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1520 AC_DEFINE(HAVE_UINTXX_T)
1523 [ AC_MSG_RESULT(no) ]
1527 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1528 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1530 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1533 #include <sys/bitypes.h>
1536 int8_t a; int16_t b; int32_t c;
1537 u_int8_t e; u_int16_t f; u_int32_t g;
1538 a = b = c = e = f = g = 1;
1541 AC_DEFINE(HAVE_U_INTXX_T)
1542 AC_DEFINE(HAVE_INTXX_T)
1550 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1553 #include <sys/types.h>
1555 [ u_char foo; foo = 125; ],
1556 [ ac_cv_have_u_char="yes" ],
1557 [ ac_cv_have_u_char="no" ]
1560 if test "x$ac_cv_have_u_char" = "xyes" ; then
1561 AC_DEFINE(HAVE_U_CHAR)
1566 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1568 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1571 #include <sys/types.h>
1573 [ size_t foo; foo = 1235; ],
1574 [ ac_cv_have_size_t="yes" ],
1575 [ ac_cv_have_size_t="no" ]
1578 if test "x$ac_cv_have_size_t" = "xyes" ; then
1579 AC_DEFINE(HAVE_SIZE_T)
1582 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1585 #include <sys/types.h>
1587 [ ssize_t foo; foo = 1235; ],
1588 [ ac_cv_have_ssize_t="yes" ],
1589 [ ac_cv_have_ssize_t="no" ]
1592 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1593 AC_DEFINE(HAVE_SSIZE_T)
1596 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1601 [ clock_t foo; foo = 1235; ],
1602 [ ac_cv_have_clock_t="yes" ],
1603 [ ac_cv_have_clock_t="no" ]
1606 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1607 AC_DEFINE(HAVE_CLOCK_T)
1610 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1613 #include <sys/types.h>
1614 #include <sys/socket.h>
1616 [ sa_family_t foo; foo = 1235; ],
1617 [ ac_cv_have_sa_family_t="yes" ],
1620 #include <sys/types.h>
1621 #include <sys/socket.h>
1622 #include <netinet/in.h>
1624 [ sa_family_t foo; foo = 1235; ],
1625 [ ac_cv_have_sa_family_t="yes" ],
1627 [ ac_cv_have_sa_family_t="no" ]
1631 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1632 AC_DEFINE(HAVE_SA_FAMILY_T)
1635 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1638 #include <sys/types.h>
1640 [ pid_t foo; foo = 1235; ],
1641 [ ac_cv_have_pid_t="yes" ],
1642 [ ac_cv_have_pid_t="no" ]
1645 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1646 AC_DEFINE(HAVE_PID_T)
1649 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1652 #include <sys/types.h>
1654 [ mode_t foo; foo = 1235; ],
1655 [ ac_cv_have_mode_t="yes" ],
1656 [ ac_cv_have_mode_t="no" ]
1659 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1660 AC_DEFINE(HAVE_MODE_T)
1664 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1667 #include <sys/types.h>
1668 #include <sys/socket.h>
1670 [ struct sockaddr_storage s; ],
1671 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1672 [ ac_cv_have_struct_sockaddr_storage="no" ]
1675 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1676 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1679 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1682 #include <sys/types.h>
1683 #include <netinet/in.h>
1685 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1686 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1687 [ ac_cv_have_struct_sockaddr_in6="no" ]
1690 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1691 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1694 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1697 #include <sys/types.h>
1698 #include <netinet/in.h>
1700 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1701 [ ac_cv_have_struct_in6_addr="yes" ],
1702 [ ac_cv_have_struct_in6_addr="no" ]
1705 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1706 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1709 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1712 #include <sys/types.h>
1713 #include <sys/socket.h>
1716 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1717 [ ac_cv_have_struct_addrinfo="yes" ],
1718 [ ac_cv_have_struct_addrinfo="no" ]
1721 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1722 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1725 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1727 [ #include <sys/time.h> ],
1728 [ struct timeval tv; tv.tv_sec = 1;],
1729 [ ac_cv_have_struct_timeval="yes" ],
1730 [ ac_cv_have_struct_timeval="no" ]
1733 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1734 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1735 have_struct_timeval=1
1738 AC_CHECK_TYPES(struct timespec)
1740 # We need int64_t or else certian parts of the compile will fail.
1741 if test "x$ac_cv_have_int64_t" = "xno" -a \
1742 "x$ac_cv_sizeof_long_int" != "x8" -a \
1743 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1744 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1745 echo "an alternative compiler (I.E., GCC) before continuing."
1749 dnl test snprintf (broken on SCO w/gcc)
1754 #ifdef HAVE_SNPRINTF
1758 char expected_out[50];
1760 #if (SIZEOF_LONG_INT == 8)
1761 long int num = 0x7fffffffffffffff;
1763 long long num = 0x7fffffffffffffffll;
1765 strcpy(expected_out, "9223372036854775807");
1766 snprintf(buf, mazsize, "%lld", num);
1767 if(strcmp(buf, expected_out) != 0)
1774 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1778 dnl Checks for structure members
1779 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1780 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1781 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1782 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1783 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1784 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1785 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1786 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1787 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1788 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1789 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1790 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1791 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1792 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1793 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1794 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1795 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1797 AC_CHECK_MEMBERS([struct stat.st_blksize])
1799 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1800 ac_cv_have_ss_family_in_struct_ss, [
1803 #include <sys/types.h>
1804 #include <sys/socket.h>
1806 [ struct sockaddr_storage s; s.ss_family = 1; ],
1807 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1808 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1811 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1812 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1815 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1816 ac_cv_have___ss_family_in_struct_ss, [
1819 #include <sys/types.h>
1820 #include <sys/socket.h>
1822 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1823 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1824 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1827 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1828 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1831 AC_CACHE_CHECK([for pw_class field in struct passwd],
1832 ac_cv_have_pw_class_in_struct_passwd, [
1837 [ struct passwd p; p.pw_class = 0; ],
1838 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1839 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1842 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1843 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1846 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1847 ac_cv_have_pw_expire_in_struct_passwd, [
1852 [ struct passwd p; p.pw_expire = 0; ],
1853 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1854 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1857 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1858 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1861 AC_CACHE_CHECK([for pw_change field in struct passwd],
1862 ac_cv_have_pw_change_in_struct_passwd, [
1867 [ struct passwd p; p.pw_change = 0; ],
1868 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1869 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1872 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1873 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1876 dnl make sure we're using the real structure members and not defines
1877 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1878 ac_cv_have_accrights_in_msghdr, [
1881 #include <sys/types.h>
1882 #include <sys/socket.h>
1883 #include <sys/uio.h>
1885 #ifdef msg_accrights
1889 m.msg_accrights = 0;
1893 [ ac_cv_have_accrights_in_msghdr="yes" ],
1894 [ ac_cv_have_accrights_in_msghdr="no" ]
1897 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1898 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1901 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1902 ac_cv_have_control_in_msghdr, [
1905 #include <sys/types.h>
1906 #include <sys/socket.h>
1907 #include <sys/uio.h>
1917 [ ac_cv_have_control_in_msghdr="yes" ],
1918 [ ac_cv_have_control_in_msghdr="no" ]
1921 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1922 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1925 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1927 [ extern char *__progname; printf("%s", __progname); ],
1928 [ ac_cv_libc_defines___progname="yes" ],
1929 [ ac_cv_libc_defines___progname="no" ]
1932 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1933 AC_DEFINE(HAVE___PROGNAME)
1936 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1940 [ printf("%s", __FUNCTION__); ],
1941 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1942 [ ac_cv_cc_implements___FUNCTION__="no" ]
1945 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1946 AC_DEFINE(HAVE___FUNCTION__)
1949 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1953 [ printf("%s", __func__); ],
1954 [ ac_cv_cc_implements___func__="yes" ],
1955 [ ac_cv_cc_implements___func__="no" ]
1958 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1959 AC_DEFINE(HAVE___func__)
1962 AC_CACHE_CHECK([whether getopt has optreset support],
1963 ac_cv_have_getopt_optreset, [
1968 [ extern int optreset; optreset = 0; ],
1969 [ ac_cv_have_getopt_optreset="yes" ],
1970 [ ac_cv_have_getopt_optreset="no" ]
1973 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1974 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1977 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1979 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1980 [ ac_cv_libc_defines_sys_errlist="yes" ],
1981 [ ac_cv_libc_defines_sys_errlist="no" ]
1984 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1985 AC_DEFINE(HAVE_SYS_ERRLIST)
1989 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1991 [ extern int sys_nerr; printf("%i", sys_nerr);],
1992 [ ac_cv_libc_defines_sys_nerr="yes" ],
1993 [ ac_cv_libc_defines_sys_nerr="no" ]
1996 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1997 AC_DEFINE(HAVE_SYS_NERR)
2001 # Check whether user wants sectok support
2003 [ --with-sectok Enable smartcard support using libsectok],
2005 if test "x$withval" != "xno" ; then
2006 if test "x$withval" != "xyes" ; then
2007 CPPFLAGS="$CPPFLAGS -I${withval}"
2008 LDFLAGS="$LDFLAGS -L${withval}"
2009 if test ! -z "$need_dash_r" ; then
2010 LDFLAGS="$LDFLAGS -R${withval}"
2012 if test ! -z "$blibpath" ; then
2013 blibpath="$blibpath:${withval}"
2016 AC_CHECK_HEADERS(sectok.h)
2017 if test "$ac_cv_header_sectok_h" != yes; then
2018 AC_MSG_ERROR(Can't find sectok.h)
2020 AC_CHECK_LIB(sectok, sectok_open)
2021 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2022 AC_MSG_ERROR(Can't find libsectok)
2024 AC_DEFINE(SMARTCARD)
2025 AC_DEFINE(USE_SECTOK)
2026 SCARD_MSG="yes, using sectok"
2031 # Check whether user wants OpenSC support
2033 AC_HELP_STRING([--with-opensc=PFX],
2034 [Enable smartcard support using OpenSC]),
2035 opensc_config_prefix="$withval", opensc_config_prefix="")
2036 if test x$opensc_config_prefix != x ; then
2037 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2038 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2039 if test "$OPENSC_CONFIG" != "no"; then
2040 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2041 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2042 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2043 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2044 AC_DEFINE(SMARTCARD)
2045 AC_DEFINE(USE_OPENSC)
2046 SCARD_MSG="yes, using OpenSC"
2050 # Check whether user wants DNS support
2053 [ --with-dns Support for fetching keys from DNS (experimental)],
2055 if test "x$withval" != "xno" ; then
2058 AC_SEARCH_LIBS(getrrsetbyname, resolv,
2059 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
2061 # Needed by our getrrsetbyname()
2062 AC_SEARCH_LIBS(res_query, resolv)
2063 AC_SEARCH_LIBS(dn_expand, resolv)
2064 AC_CHECK_FUNCS(_getshort _getlong)
2065 AC_CHECK_MEMBER(HEADER.ad,
2066 [AC_DEFINE(HAVE_HEADER_AD)],,
2067 [#include <arpa/nameser.h>])
2073 # Check whether user wants Kerberos 5 support
2075 AC_ARG_WITH(kerberos5,
2076 [ --with-kerberos5=PATH Enable Kerberos 5 support],
2078 if test "x$withval" != "xno" ; then
2079 if test "x$withval" = "xyes" ; then
2080 KRB5ROOT="/usr/local"
2084 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
2085 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
2088 AC_MSG_CHECKING(whether we are using Heimdal)
2089 AC_TRY_COMPILE([ #include <krb5.h> ],
2090 [ char *tmp = heimdal_version; ],
2091 [ AC_MSG_RESULT(yes)
2093 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2096 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2099 if test ! -z "$need_dash_r" ; then
2100 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2102 if test ! -z "$blibpath" ; then
2103 blibpath="$blibpath:${KRB5ROOT}/lib"
2105 AC_SEARCH_LIBS(dn_expand, resolv)
2107 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2109 K5LIBS="-lgssapi $K5LIBS" ],
2110 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2112 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
2113 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2118 AC_CHECK_HEADER(gssapi.h, ,
2119 [ unset ac_cv_header_gssapi_h
2120 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2121 AC_CHECK_HEADERS(gssapi.h, ,
2122 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
2128 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2129 AC_CHECK_HEADER(gssapi_krb5.h, ,
2130 [ CPPFLAGS="$oldCPP" ])
2132 # If we're using some other GSSAPI
2133 if test "$GSSAPI" -a "$GSSAPI" != "mechglue"; then
2134 AC_MSG_ERROR([$GSSAPI GSSAPI library conflicts with Kerberos support. Use mechglue instead.])
2136 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2138 K5LIBS="-lgssapi $K5LIBS" ],
2139 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2141 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
2142 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2147 AC_CHECK_HEADER(gssapi.h, ,
2148 [ unset ac_cv_header_gssapi_h
2149 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2150 AC_CHECK_HEADERS(gssapi.h, ,
2151 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
2156 AC_CHECK_LIB(gssapi, gss_krb5_copy_ccache, /bin/true,
2157 [ K5LIBS="-lgssapi_krb5 $K5LIBS"
2158 AC_CHECK_LIB(gssapi_krb5, gss_krb5_copy_ccache, /bin/true,
2159 AC_MSG_WARN([Cannot find gss_krb5_copy_ccache -- build may fail]),
2165 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2166 AC_CHECK_HEADER(gssapi_krb5.h, ,
2167 [ CPPFLAGS="$oldCPP" ])
2169 if test -z "$GSSAPI"; then
2178 # Check whether user wants AFS_KRB5 support
2180 AC_ARG_WITH(afs-krb5,
2181 [ --with-afs-krb5[[=AKLOG_PATH]] Enable aklog to get token (default=/usr/bin/aklog).],
2183 if test "x$withval" != "xno" ; then
2185 if test "x$withval" != "xyes" ; then
2186 AC_DEFINE_UNQUOTED(AKLOG_PATH, "$withval")
2188 AC_DEFINE_UNQUOTED(AKLOG_PATH, "/usr/bin/aklog")
2191 if test -z "$KRB5" ; then
2192 AC_MSG_WARN([AFS_KRB5 requires Kerberos 5 support, build may fail])
2195 LIBS="-lkrbafs $LIBS"
2196 if test ! -z "$AFS_LIBS" ; then
2197 LIBS="$LIBS $AFS_LIBS"
2204 LIBS="$LIBS $K5LIBS"
2206 AC_ARG_WITH(session-hooks,
2207 [ --with-session-hooks Enable hooks for executing external commands before/after a session],
2208 [ AC_DEFINE(SESSION_HOOKS) ]
2211 # Looking for programs, paths and files
2213 PRIVSEP_PATH=/var/empty
2214 AC_ARG_WITH(privsep-path,
2215 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
2217 if test "x$withval" != "$no" ; then
2218 PRIVSEP_PATH=$withval
2222 AC_SUBST(PRIVSEP_PATH)
2225 [ --with-xauth=PATH Specify path to xauth program ],
2227 if test "x$withval" != "xno" ; then
2233 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2234 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2235 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2236 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2237 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
2238 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
2239 xauth_path="/usr/openwin/bin/xauth"
2245 AC_ARG_ENABLE(strip,
2246 [ --disable-strip Disable calling strip(1) on install],
2248 if test "x$enableval" = "xno" ; then
2255 if test -z "$xauth_path" ; then
2256 XAUTH_PATH="undefined"
2257 AC_SUBST(XAUTH_PATH)
2259 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
2260 XAUTH_PATH=$xauth_path
2261 AC_SUBST(XAUTH_PATH)
2264 # Check for mail directory (last resort if we cannot get it from headers)
2265 if test ! -z "$MAIL" ; then
2266 maildir=`dirname $MAIL`
2267 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2270 if test -z "$no_dev_ptmx" ; then
2271 if test "x$disable_ptmx_check" != "xyes" ; then
2272 AC_CHECK_FILE("/dev/ptmx",
2274 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2280 AC_CHECK_FILE("/dev/ptc",
2282 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2287 # Options from here on. Some of these are preset by platform above
2288 AC_ARG_WITH(mantype,
2289 [ --with-mantype=man|cat|doc Set man page type],
2296 AC_MSG_ERROR(invalid man type: $withval)
2301 if test -z "$MANTYPE"; then
2302 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2303 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
2304 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2306 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2313 if test "$MANTYPE" = "doc"; then
2320 # Check whether to enable MD5 passwords
2322 AC_ARG_WITH(md5-passwords,
2323 [ --with-md5-passwords Enable use of MD5 passwords],
2325 if test "x$withval" != "xno" ; then
2326 AC_DEFINE(HAVE_MD5_PASSWORDS)
2332 # Whether to disable shadow password support
2334 [ --without-shadow Disable shadow password support],
2336 if test "x$withval" = "xno" ; then
2337 AC_DEFINE(DISABLE_SHADOW)
2343 if test -z "$disable_shadow" ; then
2344 AC_MSG_CHECKING([if the systems has expire shadow information])
2347 #include <sys/types.h>
2350 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2351 [ sp_expire_available=yes ], []
2354 if test "x$sp_expire_available" = "xyes" ; then
2356 AC_DEFINE(HAS_SHADOW_EXPIRE)
2362 # Use ip address instead of hostname in $DISPLAY
2363 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2364 DISPLAY_HACK_MSG="yes"
2365 AC_DEFINE(IPADDR_IN_DISPLAY)
2367 DISPLAY_HACK_MSG="no"
2368 AC_ARG_WITH(ipaddr-display,
2369 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2371 if test "x$withval" != "xno" ; then
2372 AC_DEFINE(IPADDR_IN_DISPLAY)
2373 DISPLAY_HACK_MSG="yes"
2379 # check for /etc/default/login and use it if present.
2380 AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2382 if test "x$external_path_file" = "x/etc/default/login"; then
2383 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2386 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2387 if test $ac_cv_func_login_getcapbool = "yes" -a \
2388 $ac_cv_header_login_cap_h = "yes" ; then
2389 external_path_file=/etc/login.conf
2392 # Whether to mess with the default path
2393 SERVER_PATH_MSG="(default)"
2394 AC_ARG_WITH(default-path,
2395 [ --with-default-path= Specify default \$PATH environment for server],
2397 if test "x$external_path_file" = "x/etc/login.conf" ; then
2399 --with-default-path=PATH has no effect on this system.
2400 Edit /etc/login.conf instead.])
2401 elif test "x$withval" != "xno" ; then
2402 if test ! -z "$external_path_file" ; then
2404 --with-default-path=PATH will only be used if PATH is not defined in
2405 $external_path_file .])
2407 user_path="$withval"
2408 SERVER_PATH_MSG="$withval"
2411 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2412 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2414 if test ! -z "$external_path_file" ; then
2416 If PATH is defined in $external_path_file, ensure the path to scp is included,
2417 otherwise scp will not work.])
2421 /* find out what STDPATH is */
2426 #ifndef _PATH_STDPATH
2427 # ifdef _PATH_USERPATH /* Irix */
2428 # define _PATH_STDPATH _PATH_USERPATH
2430 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2433 #include <sys/types.h>
2434 #include <sys/stat.h>
2436 #define DATA "conftest.stdpath"
2443 fd = fopen(DATA,"w");
2447 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2452 ], [ user_path=`cat conftest.stdpath` ],
2453 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2454 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2456 # make sure $bindir is in USER_PATH so scp will work
2457 t_bindir=`eval echo ${bindir}`
2459 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2462 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2464 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2465 if test $? -ne 0 ; then
2466 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2467 if test $? -ne 0 ; then
2468 user_path=$user_path:$t_bindir
2469 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2474 if test "x$external_path_file" != "x/etc/login.conf" ; then
2475 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2479 # Set superuser path separately to user path
2480 AC_ARG_WITH(superuser-path,
2481 [ --with-superuser-path= Specify different path for super-user],
2483 if test "x$withval" != "xno" ; then
2484 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2485 superuser_path=$withval
2491 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2492 IPV4_IN6_HACK_MSG="no"
2494 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2496 if test "x$withval" != "xno" ; then
2498 AC_DEFINE(IPV4_IN_IPV6)
2499 IPV4_IN6_HACK_MSG="yes"
2504 if test "x$inet6_default_4in6" = "xyes"; then
2505 AC_MSG_RESULT([yes (default)])
2506 AC_DEFINE(IPV4_IN_IPV6)
2507 IPV4_IN6_HACK_MSG="yes"
2509 AC_MSG_RESULT([no (default)])
2514 # Whether to enable BSD auth support
2516 AC_ARG_WITH(bsd-auth,
2517 [ --with-bsd-auth Enable BSD auth support],
2519 if test "x$withval" != "xno" ; then
2526 # Where to place sshd.pid
2528 # make sure the directory exists
2529 if test ! -d $piddir ; then
2530 piddir=`eval echo ${sysconfdir}`
2532 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2536 AC_ARG_WITH(pid-dir,
2537 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2539 if test "x$withval" != "xno" ; then
2541 if test ! -d $piddir ; then
2542 AC_MSG_WARN([** no $piddir directory on this system **])
2548 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2551 dnl allow user to disable some login recording features
2552 AC_ARG_ENABLE(lastlog,
2553 [ --disable-lastlog disable use of lastlog even if detected [no]],
2555 if test "x$enableval" = "xno" ; then
2556 AC_DEFINE(DISABLE_LASTLOG)
2561 [ --disable-utmp disable use of utmp even if detected [no]],
2563 if test "x$enableval" = "xno" ; then
2564 AC_DEFINE(DISABLE_UTMP)
2568 AC_ARG_ENABLE(utmpx,
2569 [ --disable-utmpx disable use of utmpx even if detected [no]],
2571 if test "x$enableval" = "xno" ; then
2572 AC_DEFINE(DISABLE_UTMPX)
2577 [ --disable-wtmp disable use of wtmp even if detected [no]],
2579 if test "x$enableval" = "xno" ; then
2580 AC_DEFINE(DISABLE_WTMP)
2584 AC_ARG_ENABLE(wtmpx,
2585 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2587 if test "x$enableval" = "xno" ; then
2588 AC_DEFINE(DISABLE_WTMPX)
2592 AC_ARG_ENABLE(libutil,
2593 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2595 if test "x$enableval" = "xno" ; then
2596 AC_DEFINE(DISABLE_LOGIN)
2600 AC_ARG_ENABLE(pututline,
2601 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2603 if test "x$enableval" = "xno" ; then
2604 AC_DEFINE(DISABLE_PUTUTLINE)
2608 AC_ARG_ENABLE(pututxline,
2609 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2611 if test "x$enableval" = "xno" ; then
2612 AC_DEFINE(DISABLE_PUTUTXLINE)
2616 AC_ARG_WITH(lastlog,
2617 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2619 if test "x$withval" = "xno" ; then
2620 AC_DEFINE(DISABLE_LASTLOG)
2622 conf_lastlog_location=$withval
2627 dnl lastlog, [uw]tmpx? detection
2628 dnl NOTE: set the paths in the platform section to avoid the
2629 dnl need for command-line parameters
2630 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2632 dnl lastlog detection
2633 dnl NOTE: the code itself will detect if lastlog is a directory
2634 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2636 #include <sys/types.h>
2638 #ifdef HAVE_LASTLOG_H
2639 # include <lastlog.h>
2648 [ char *lastlog = LASTLOG_FILE; ],
2649 [ AC_MSG_RESULT(yes) ],
2652 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2654 #include <sys/types.h>
2656 #ifdef HAVE_LASTLOG_H
2657 # include <lastlog.h>
2663 [ char *lastlog = _PATH_LASTLOG; ],
2664 [ AC_MSG_RESULT(yes) ],
2667 system_lastlog_path=no
2672 if test -z "$conf_lastlog_location"; then
2673 if test x"$system_lastlog_path" = x"no" ; then
2674 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2675 if (test -d "$f" || test -f "$f") ; then
2676 conf_lastlog_location=$f
2679 if test -z "$conf_lastlog_location"; then
2680 AC_MSG_WARN([** Cannot find lastlog **])
2681 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2686 if test -n "$conf_lastlog_location"; then
2687 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2691 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2693 #include <sys/types.h>
2699 [ char *utmp = UTMP_FILE; ],
2700 [ AC_MSG_RESULT(yes) ],
2702 system_utmp_path=no ]
2704 if test -z "$conf_utmp_location"; then
2705 if test x"$system_utmp_path" = x"no" ; then
2706 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2707 if test -f $f ; then
2708 conf_utmp_location=$f
2711 if test -z "$conf_utmp_location"; then
2712 AC_DEFINE(DISABLE_UTMP)
2716 if test -n "$conf_utmp_location"; then
2717 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2721 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2723 #include <sys/types.h>
2729 [ char *wtmp = WTMP_FILE; ],
2730 [ AC_MSG_RESULT(yes) ],
2732 system_wtmp_path=no ]
2734 if test -z "$conf_wtmp_location"; then
2735 if test x"$system_wtmp_path" = x"no" ; then
2736 for f in /usr/adm/wtmp /var/log/wtmp; do
2737 if test -f $f ; then
2738 conf_wtmp_location=$f
2741 if test -z "$conf_wtmp_location"; then
2742 AC_DEFINE(DISABLE_WTMP)
2746 if test -n "$conf_wtmp_location"; then
2747 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2751 dnl utmpx detection - I don't know any system so perverse as to require
2752 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2754 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2756 #include <sys/types.h>
2765 [ char *utmpx = UTMPX_FILE; ],
2766 [ AC_MSG_RESULT(yes) ],
2768 system_utmpx_path=no ]
2770 if test -z "$conf_utmpx_location"; then
2771 if test x"$system_utmpx_path" = x"no" ; then
2772 AC_DEFINE(DISABLE_UTMPX)
2775 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2779 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2781 #include <sys/types.h>
2790 [ char *wtmpx = WTMPX_FILE; ],
2791 [ AC_MSG_RESULT(yes) ],
2793 system_wtmpx_path=no ]
2795 if test -z "$conf_wtmpx_location"; then
2796 if test x"$system_wtmpx_path" = x"no" ; then
2797 AC_DEFINE(DISABLE_WTMPX)
2800 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2804 if test ! -z "$blibpath" ; then
2805 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2806 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
2809 dnl remove pam and dl because they are in $LIBPAM
2810 if test "$PAM_MSG" = yes ; then
2811 LIBS=`echo $LIBS | sed 's/-lpam //'`
2813 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2814 LIBS=`echo $LIBS | sed 's/-ldl //'`
2818 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2821 # Print summary of options
2823 # Someone please show me a better way :)
2824 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2825 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2826 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2827 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2828 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2829 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2830 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2831 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2832 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2833 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2836 echo "OpenSSH has been configured with the following options:"
2837 echo " User binaries: $B"
2838 echo " System binaries: $C"
2839 echo " Configuration files: $D"
2840 echo " Askpass program: $E"
2841 echo " Manual pages: $F"
2842 echo " PID file: $G"
2843 echo " Privilege separation chroot path: $H"
2844 if test "x$external_path_file" = "x/etc/login.conf" ; then
2845 echo " At runtime, sshd will use the path defined in $external_path_file"
2846 echo " Make sure the path to scp is present, otherwise scp will not work"
2848 echo " sshd default user PATH: $I"
2849 if test ! -z "$external_path_file"; then
2850 echo " (If PATH is set in $external_path_file it will be used instead. If"
2851 echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2854 if test ! -z "$superuser_path" ; then
2855 echo " sshd superuser user PATH: $J"
2857 echo " Manpage format: $MANTYPE"
2858 echo " DNS support: $DNS_MSG"
2859 echo " PAM support: $PAM_MSG"
2860 echo " KerberosV support: $KRB5_MSG"
2861 echo " Smartcard support: $SCARD_MSG"
2862 echo " S/KEY support: $SKEY_MSG"
2863 echo " TCP Wrappers support: $TCPW_MSG"
2864 echo " MD5 password support: $MD5_MSG"
2865 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2866 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2867 echo " BSD Auth support: $BSD_AUTH_MSG"
2868 echo " Random number source: $RAND_MSG"
2869 if test ! -z "$USE_RAND_HELPER" ; then
2870 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2875 echo " Host: ${host}"
2876 echo " Compiler: ${CC}"
2877 echo " Compiler flags: ${CFLAGS}"
2878 echo "Preprocessor flags: ${CPPFLAGS}"
2879 echo " Linker flags: ${LDFLAGS}"
2880 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2884 if test "x$PAM_MSG" = "xyes" ; then
2885 echo "PAM is enabled. You may need to install a PAM control file "
2886 echo "for sshd, otherwise password authentication may fail. "
2887 echo "Example PAM control files can be found in the contrib/ "
2892 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2893 echo "WARNING: you are using the builtin random number collection "
2894 echo "service. Please read WARNING.RNG and request that your OS "
2895 echo "vendor includes kernel-based random number collection in "
2896 echo "future versions of your OS."