4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
18 AC_PATH_PROG(ENT, ent)
20 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
21 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
29 if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
33 # Use LOGIN_PROGRAM from environment if possible
34 if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
44 if test -z "$LD" ; then
50 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
54 # Check for some target-specific stuff
58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60 if (test "$LD" != "gcc" && test -z "$blibpath"); then
61 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
68 blibpath="/usr/lib:/lib:/usr/local/lib"
72 LDFLAGS="$saved_LDFLAGS"
74 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
75 AC_DEFINE(BROKEN_GETADDRINFO)
76 AC_DEFINE(BROKEN_REALPATH)
77 dnl AIX handles lastlog as part of its login message
78 AC_DEFINE(DISABLE_LASTLOG)
79 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
82 LIBS="$LIBS /usr/lib/textmode.o"
83 AC_DEFINE(HAVE_CYGWIN)
85 AC_DEFINE(DISABLE_SHADOW)
86 AC_DEFINE(IPV4_DEFAULT)
87 AC_DEFINE(IP_TOS_IS_BROKEN)
88 AC_DEFINE(NO_X11_UNIX_SOCKETS)
91 AC_DEFINE(IP_TOS_IS_BROKEN)
94 AC_DEFINE(BROKEN_GETADDRINFO)
97 if test -z "$GCC"; then
100 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
101 IPADDR_IN_DISPLAY=yes
102 AC_DEFINE(HAVE_SECUREWARE)
104 AC_DEFINE(LOGIN_NO_ENDOPT)
105 AC_DEFINE(LOGIN_NEEDS_UTMPX)
106 AC_DEFINE(DISABLE_SHADOW)
107 AC_DEFINE(DISABLE_UTMP)
108 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
109 LIBS="$LIBS -lxnet -lsec -lsecpw"
110 disable_ptmx_check=yes
113 if test -z "$GCC"; then
116 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
117 IPADDR_IN_DISPLAY=yes
119 AC_DEFINE(LOGIN_NO_ENDOPT)
120 AC_DEFINE(LOGIN_NEEDS_UTMPX)
121 AC_DEFINE(DISABLE_SHADOW)
122 AC_DEFINE(DISABLE_UTMP)
123 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
124 LIBS="$LIBS -lxnet -lsec"
127 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
128 IPADDR_IN_DISPLAY=yes
129 AC_DEFINE(PAM_SUN_CODEBASE)
131 AC_DEFINE(LOGIN_NO_ENDOPT)
132 AC_DEFINE(LOGIN_NEEDS_UTMPX)
133 AC_DEFINE(DISABLE_SHADOW)
134 AC_DEFINE(DISABLE_UTMP)
135 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
136 LIBS="$LIBS -lxnet -lsec"
139 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
141 PATH="$PATH:/usr/etc"
142 AC_DEFINE(BROKEN_INET_NTOA)
143 AC_DEFINE(WITH_ABBREV_NO_TTY)
146 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
148 PATH="$PATH:/usr/etc"
149 AC_DEFINE(WITH_IRIX_ARRAY)
150 AC_DEFINE(WITH_IRIX_PROJECT)
151 AC_DEFINE(WITH_IRIX_AUDIT)
152 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
153 AC_DEFINE(BROKEN_INET_NTOA)
154 AC_DEFINE(WITH_ABBREV_NO_TTY)
158 check_for_libcrypt_later=1
159 AC_DEFINE(DONT_TRY_OTHER_AF)
160 AC_DEFINE(PAM_TTY_KLUDGE)
161 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
162 inet6_default_4in6=yes
164 mips-sony-bsd|mips-sony-newsos4)
165 AC_DEFINE(HAVE_NEWS4)
172 check_for_libcrypt_later=1
175 conf_lastlog_location="/usr/adm/lastlog"
176 conf_utmp_location=/etc/utmp
177 conf_wtmp_location=/usr/adm/wtmp
180 AC_DEFINE(BROKEN_REALPATH)
182 AC_DEFINE(BROKEN_SAVED_UIDS)
183 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
187 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
188 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
190 AC_DEFINE(PAM_SUN_CODEBASE)
191 AC_DEFINE(LOGIN_NEEDS_UTMPX)
192 AC_DEFINE(LOGIN_NEEDS_TERM)
193 AC_DEFINE(PAM_TTY_KLUDGE)
194 # hardwire lastlog location (can't detect it on some versions)
195 conf_lastlog_location="/var/adm/lastlog"
196 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
197 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
198 if test "$sol2ver" -ge 8; then
200 AC_DEFINE(DISABLE_UTMP)
201 AC_DEFINE(DISABLE_WTMP)
207 CPPFLAGS="$CPPFLAGS -DSUNOS4"
208 AC_CHECK_FUNCS(getpwanam)
209 AC_DEFINE(PAM_SUN_CODEBASE)
210 conf_utmp_location=/etc/utmp
211 conf_wtmp_location=/var/adm/wtmp
212 conf_lastlog_location=/var/adm/lastlog
216 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
217 LDFLAGS="$LDFLAGS -L/usr/local/lib"
222 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
223 # /usr/ucblib MUST NOT be searched on ReliantUNIX
224 LDFLAGS="$LDFLAGS -L/usr/local/lib"
225 IPADDR_IN_DISPLAY=yes
227 AC_DEFINE(IP_TOS_IS_BROKEN)
228 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
229 # Attention: always take care to bind libsocket and libnsl before libc,
230 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
233 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
234 LDFLAGS="$LDFLAGS -L/usr/local/lib"
239 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
240 LDFLAGS="$LDFLAGS -L/usr/local/lib"
245 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
246 LDFLAGS="$LDFLAGS -L/usr/local/lib"
249 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
250 LDFLAGS="$LDFLAGS -L/usr/local/lib"
251 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
252 rsh_path="/usr/bin/rcmd"
255 AC_DEFINE(BROKEN_SYS_TERMIO_H)
257 AC_DEFINE(HAVE_SECUREWARE)
258 AC_DEFINE(DISABLE_SHADOW)
259 AC_DEFINE(BROKEN_SAVED_UIDS)
260 AC_CHECK_FUNCS(getluid setluid)
262 do_sco3_extra_lib_check=yes
265 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
266 LDFLAGS="$LDFLAGS -L/usr/local/lib"
267 LIBS="$LIBS -lprot -lx -ltinfo -lm"
269 rsh_path="/usr/bin/rcmd"
271 AC_DEFINE(HAVE_SECUREWARE)
272 AC_DEFINE(DISABLE_SHADOW)
273 AC_CHECK_FUNCS(getluid setluid)
280 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
281 LIBS="$LIBS -lgen -lrsc"
284 AC_MSG_CHECKING(for Digital Unix SIA)
287 [ --with-osfsia Enable Digital Unix SIA],
289 if test "x$withval" = "xno" ; then
290 AC_MSG_RESULT(disabled)
295 if test -z "$no_osfsia" ; then
296 if test -f /etc/sia/matrix.conf; then
298 AC_DEFINE(HAVE_OSF_SIA)
299 AC_DEFINE(DISABLE_LOGIN)
300 LIBS="$LIBS -lsecurity -ldb -lm -laud"
309 AC_DEFINE(NO_X11_UNIX_SOCKETS)
310 AC_DEFINE(MISSING_NFDBITS)
311 AC_DEFINE(MISSING_HOWMANY)
312 AC_DEFINE(MISSING_FD_MASK)
316 # Allow user to specify flags
318 [ --with-cflags Specify additional flags to pass to compiler],
320 if test "x$withval" != "xno" ; then
321 CFLAGS="$CFLAGS $withval"
325 AC_ARG_WITH(cppflags,
326 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
328 if test "x$withval" != "xno"; then
329 CPPFLAGS="$CPPFLAGS $withval"
334 [ --with-ldflags Specify additional flags to pass to linker],
336 if test "x$withval" != "xno" ; then
337 LDFLAGS="$LDFLAGS $withval"
342 [ --with-libs Specify additional libraries to link with],
344 if test "x$withval" != "xno" ; then
345 LIBS="$LIBS $withval"
350 # Checks for header files.
351 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
352 getopt.h glob.h lastlog.h limits.h login.h \
353 login_cap.h maillock.h netdb.h netgroup.h \
354 netinet/in_systm.h paths.h pty.h readpassphrase.h \
355 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
356 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
357 sys/mman.h sys/select.h sys/stat.h \
358 sys/stropts.h sys/sysmacros.h sys/time.h \
359 sys/un.h time.h ttyent.h usersec.h \
360 util.h utime.h utmp.h utmpx.h)
362 # Checks for libraries.
363 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
364 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
366 dnl SCO OS3 needs this for libwrap
367 if test "x$with_tcp_wrappers" != "xno" ; then
368 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
369 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
373 AC_CHECK_FUNC(getspnam, ,
374 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
377 [ --without-rpath Disable auto-added -R linker paths],
379 if test "x$withval" = "xno" ; then
382 if test "x$withval" = "xyes" ; then
390 [ --with-zlib=PATH Use zlib in PATH],
392 if test "x$withval" = "xno" ; then
393 AC_MSG_ERROR([*** zlib is required ***])
395 if test -d "$withval/lib"; then
396 if test -n "${need_dash_r}"; then
397 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
399 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
402 if test -n "${need_dash_r}"; then
403 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
405 LDFLAGS="-L${withval} ${LDFLAGS}"
408 if test -d "$withval/include"; then
409 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
411 CPPFLAGS="-I${withval} ${CPPFLAGS}"
416 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
419 AC_CHECK_FUNC(strcasecmp,
420 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
422 AC_CHECK_FUNC(utimes,
423 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
426 dnl Checks for libutil functions
427 AC_CHECK_HEADERS(libutil.h)
428 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
429 AC_CHECK_FUNCS(logout updwtmp logwtmp)
433 # Check for ALTDIRFUNC glob() extension
434 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
435 AC_EGREP_CPP(FOUNDIT,
438 #ifdef GLOB_ALTDIRFUNC
443 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
451 # Check for g.gl_matchc glob() extension
452 AC_MSG_CHECKING(for gl_matchc field in glob_t)
453 AC_EGREP_CPP(FOUNDIT,
456 int main(void){glob_t g; g.gl_matchc = 1;}
459 AC_DEFINE(GLOB_HAS_GL_MATCHC)
467 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
470 #include <sys/types.h>
472 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
474 [AC_MSG_RESULT(yes)],
477 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
481 # Check whether the user wants GSI (Globus) support
484 [ --with-gsi=PATH Enable GSI/Globus authentication support],
491 [ --with-globus=PATH Enable GSI/Globus authentication support],
497 # Check whether the user has a Globus flavor type
498 globus_flavor_type="no"
499 AC_ARG_WITH(globus-flavor,
500 [ --with-globus-flavor=TYPE Describe Globus flavor type (ex: gcc32dbg, etc.)],
502 globus_flavor_type="$withval"
506 if test "x$gsi_path" != "xno" ; then
507 # Globus GSSAPI configuration
511 # Find GLOBUS/GSI installation Directory
512 AC_MSG_CHECKING(for Globus/GSI installation directory)
514 globus_install_dir=$gsi_path
516 if test "x$globus_install_dir" = "xyes" ; then
517 if test -n "$GLOBUS_INSTALL_PATH" ; then
518 globus_install_dir=$GLOBUS_INSTALL_PATH
519 elif test -n "$GSI_INSTALL_PATH" ; then
520 globus_install_dir=$GSI_INSTALL_PATH
521 elif test -d /usr/local/globus ; then
522 globus_install_dir="/usr/local/globus"
523 elif test -d /usr/local/gsi ; then
524 globus_install_dir="/usr/local/gsi"
526 AC_MSG_ERROR(Cannot find Globus/GSI installation directory)
529 AC_MSG_RESULT($globus_install_dir)
531 # Find GLOBUS/GSI development directory
532 AC_MSG_CHECKING(for Globus/GSI development directory)
534 if test -d ${globus_install_dir}/lib ; then
535 # Looks like a flat directory structure from configure/make
536 # and not globus-install or gsi-install
537 globus_dev_dir=$globus_install_dir
540 # Assume a true globus installation with architecture
541 # directories and run globus-development-path to find
542 # the development directory
544 # Set GLOBUS_INSTALL_PATH
545 GLOBUS_INSTALL_PATH=$globus_install_dir
546 export GLOBUS_INSTALL_PATH
548 dev_path_program=${globus_install_dir}/bin/globus-development-path
550 if test ! -x ${dev_path_program} ; then
551 AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
554 globus_dev_dir=`${dev_path_program}`
556 if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
557 AC_MSG_ERROR(Cannot find Globus/GSI development directory)
560 if test ! -d "$globus_dev_dir" ; then
561 AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
564 AC_MSG_RESULT($globus_dev_dir)
566 # Find GLOBUS/GSI flavor Directory
567 AC_MSG_CHECKING(for Globus flavor type)
569 if test "x$globus_flavor_type" = "xno" ; then
570 GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa"
571 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
572 GSI_CFLAGS="-I${globus_dev_dir}/include"
575 GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
577 if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
578 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR})
581 AC_MSG_RESULT($globus_flavor_type)
582 GSI_LIBS="-lglobus_gss_assist_${globus_flavor_type} -lglobus_gssapi_gsi_${globus_flavor_type}"
583 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
584 GSI_CFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
587 LIBS="$LIBS $GSI_LIBS"
588 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
589 CFLAGS="$CFLAGS $GSI_CFLAGS"
590 # End Globus/GSI section
593 # Check whether user wants S/Key support
596 [ --with-skey[[=PATH]] Enable S/Key support
597 (optionally in PATH)],
599 if test "x$withval" != "xno" ; then
601 if test "x$withval" != "xyes" ; then
602 CPPFLAGS="$CPPFLAGS -I${withval}/include"
603 LDFLAGS="$LDFLAGS -L${withval}/lib"
610 AC_MSG_CHECKING([for s/key support])
615 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
617 [AC_MSG_RESULT(yes)],
620 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
626 # Check whether user wants TCP wrappers support
628 AC_ARG_WITH(tcp-wrappers,
629 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
630 (optionally in PATH)],
632 if test "x$withval" != "xno" ; then
634 saved_LDFLAGS="$LDFLAGS"
635 saved_CPPFLAGS="$CPPFLAGS"
636 if test -n "${withval}" -a "${withval}" != "yes"; then
637 if test -d "${withval}/lib"; then
638 if test -n "${need_dash_r}"; then
639 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
641 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
644 if test -n "${need_dash_r}"; then
645 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
647 LDFLAGS="-L${withval} ${LDFLAGS}"
650 if test -d "${withval}/include"; then
651 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
653 CPPFLAGS="-I${withval} ${CPPFLAGS}"
657 LIBS="$LIBWRAP $LIBS"
658 AC_MSG_CHECKING(for libwrap)
662 int deny_severity = 0, allow_severity = 0;
672 AC_MSG_ERROR([*** libwrap missing])
680 dnl Checks for library functions.
681 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
682 clock fchmod fchown freeaddrinfo futimes gai_strerror \
683 getaddrinfo getcwd getgrouplist getnameinfo getopt \
684 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
685 inet_ntop innetgr login_getcapbool md5_crypt memmove \
686 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
687 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
688 setenv seteuid setlogin setproctitle setresgid setreuid setrlimit \
689 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
690 strlcat strlcpy strmode strsep sysconf tcgetpgrp truncate utimes \
691 vhangup vsnprintf waitpid __b64_ntop _getpty)
693 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
694 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
695 AC_CHECK_LIB(gen, dirname,[
696 AC_CACHE_CHECK([for broken dirname],
697 ac_cv_have_broken_dirname, [
705 int main(int argc, char **argv) {
708 strncpy(buf,"/etc", 32);
710 if (!s || strncmp(s, "/", 32) != 0) {
717 [ ac_cv_have_broken_dirname="no" ],
718 [ ac_cv_have_broken_dirname="yes" ]
722 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
724 AC_DEFINE(HAVE_DIRNAME)
725 AC_CHECK_HEADERS(libgen.h)
730 dnl Checks for time functions
731 AC_CHECK_FUNCS(gettimeofday time)
732 dnl Checks for utmp functions
733 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
734 AC_CHECK_FUNCS(utmpname)
735 dnl Checks for utmpx functions
736 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
737 AC_CHECK_FUNCS(setutxent utmpxname)
739 AC_CHECK_FUNC(getuserattr,
740 [AC_DEFINE(HAVE_GETUSERATTR)],
741 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
744 AC_CHECK_FUNC(daemon,
745 [AC_DEFINE(HAVE_DAEMON)],
746 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
749 AC_CHECK_FUNC(getpagesize,
750 [AC_DEFINE(HAVE_GETPAGESIZE)],
751 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
754 # Check for broken snprintf
755 if test "x$ac_cv_func_snprintf" = "xyes" ; then
756 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
760 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
762 [AC_MSG_RESULT(yes)],
765 AC_DEFINE(BROKEN_SNPRINTF)
766 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
776 [ --with-pam Enable PAM support ],
778 if test "x$withval" != "xno" ; then
779 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
780 AC_MSG_ERROR([PAM headers not found])
783 AC_CHECK_LIB(dl, dlopen, , )
784 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
785 AC_CHECK_FUNCS(pam_getenvlist)
786 AC_CHECK_FUNCS(pam_putenv)
792 if test $ac_cv_lib_dl_dlopen = yes; then
802 # Check for older PAM
803 if test "x$PAM_MSG" = "xyes" ; then
804 # Check PAM strerror arguments (old PAM)
805 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
809 #include <security/pam_appl.h>
811 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
814 AC_DEFINE(HAVE_OLD_PAM)
816 PAM_MSG="yes (old library)"
822 saved_CPPFLAGS="$CPPFLAGS"
823 saved_LDFLAGS="$LDFLAGS"
825 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
827 if test "x$withval" != "xno" ; then
828 if test -d "$withval/lib"; then
829 if test -n "${need_dash_r}"; then
830 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
832 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
835 if test -n "${need_dash_r}"; then
836 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
838 LDFLAGS="-L${withval} ${LDFLAGS}"
841 if test -d "$withval/include"; then
842 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
844 CPPFLAGS="-I${withval} ${CPPFLAGS}"
850 # Patch up SSL libraries for GSI authentication as needed
851 if test "x$globus_flavor_type" != "xno" ; then
852 # For Globus 2, always link with the static libraries
853 LIBS="$LIBS ${gsi_path}/libglobus_ssl_utils_${globus_flavor_type}.a ${gsi_path}/libssl_${globus_flavor_type}.a ${gsi_path}/libcrypto_${globus_flavor_type}.a"
855 if test "x$gsi_path" != "xno" ; then
856 # Older GSI needs -lssl too
857 LIBS="$LIBS -lssl -lcrypto"
858 else # if no GSI authentication (i.e., OpenSSL default)
859 LIBS="$LIBS -lcrypto"
861 fi # globus_flavor_type
863 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
865 dnl Check default openssl install dir
866 if test -n "${need_dash_r}"; then
867 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
869 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
871 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
872 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
874 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
881 # Sanity check OpenSSL headers
882 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
886 #include <openssl/opensslv.h>
887 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
894 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
898 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
899 # version in OpenSSL. Skip this for PAM
900 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
901 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
905 ### Configure cryptographic random number support
907 # Check wheter OpenSSL seeds itself
908 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
912 #include <openssl/rand.h>
913 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
916 OPENSSL_SEEDS_ITSELF=yes
921 # Default to use of the rand helper if OpenSSL doesn't
928 # Do we want to force the use of the rand helper?
929 AC_ARG_WITH(rand-helper,
930 [ --with-rand-helper Use subprocess to gather strong randomness ],
932 if test "x$withval" = "xno" ; then
933 # Force use of OpenSSL's internal RNG, even if
934 # the previous test showed it to be unseeded.
935 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
936 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
937 OPENSSL_SEEDS_ITSELF=yes
946 # Which randomness source do we use?
947 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
949 AC_DEFINE(OPENSSL_PRNG_ONLY)
950 RAND_MSG="OpenSSL internal ONLY"
951 INSTALL_SSH_RAND_HELPER=""
952 elif test ! -z "$USE_RAND_HELPER" ; then
953 # install rand helper
954 RAND_MSG="ssh-rand-helper"
955 INSTALL_SSH_RAND_HELPER="yes"
957 AC_SUBST(INSTALL_SSH_RAND_HELPER)
959 ### Configuration of ssh-rand-helper
962 AC_ARG_WITH(prngd-port,
963 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
972 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
975 if test ! -z "$withval" ; then
976 PRNGD_PORT="$withval"
977 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
982 # PRNGD Unix domain socket
983 AC_ARG_WITH(prngd-socket,
984 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
988 withval="/var/run/egd-pool"
996 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1000 if test ! -z "$withval" ; then
1001 if test ! -z "$PRNGD_PORT" ; then
1002 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1004 if test ! -r "$withval" ; then
1005 AC_MSG_WARN(Entropy socket is not readable)
1007 PRNGD_SOCKET="$withval"
1008 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1012 # Check for existing socket only if we don't have a random device already
1013 if test "$USE_RAND_HELPER" = yes ; then
1014 AC_MSG_CHECKING(for PRNGD/EGD socket)
1015 # Insert other locations here
1016 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1017 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1018 PRNGD_SOCKET="$sock"
1019 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1023 if test ! -z "$PRNGD_SOCKET" ; then
1024 AC_MSG_RESULT($PRNGD_SOCKET)
1026 AC_MSG_RESULT(not found)
1032 # Change default command timeout for hashing entropy source
1034 AC_ARG_WITH(entropy-timeout,
1035 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1037 if test "x$withval" != "xno" ; then
1038 entropy_timeout=$withval
1042 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1044 ssh_privsep_user=sshd
1045 AC_ARG_WITH(privsep-user,
1046 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1048 if test -n "$withval"; then
1049 ssh_privsep_user=$withval
1053 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user")
1055 # We do this little dance with the search path to insure
1056 # that programs that we select for use by installed programs
1057 # (which may be run by the super-user) come from trusted
1058 # locations before they come from the user's private area.
1059 # This should help avoid accidentally configuring some
1060 # random version of a program in someone's personal bin.
1064 test -h /bin 2> /dev/null && PATH=/usr/bin
1065 test -d /sbin && PATH=$PATH:/sbin
1066 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1067 PATH=$PATH:/etc:$OPATH
1069 # These programs are used by the command hashing source to gather entropy
1070 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1071 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1072 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1073 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1074 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1075 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1076 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1077 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1078 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1079 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1080 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1081 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1082 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1083 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1084 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1085 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1089 # Where does ssh-rand-helper get its randomness from?
1090 INSTALL_SSH_PRNG_CMDS=""
1091 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1092 if test ! -z "$PRNGD_PORT" ; then
1093 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1094 elif test ! -z "$PRNGD_SOCKET" ; then
1095 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1097 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1098 RAND_HELPER_CMDHASH=yes
1099 INSTALL_SSH_PRNG_CMDS="yes"
1102 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1105 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1106 if test ! -z "$SONY" ; then
1107 LIBS="$LIBS -liberty";
1110 # Checks for data types
1111 AC_CHECK_SIZEOF(char, 1)
1112 AC_CHECK_SIZEOF(short int, 2)
1113 AC_CHECK_SIZEOF(int, 4)
1114 AC_CHECK_SIZEOF(long int, 4)
1115 AC_CHECK_SIZEOF(long long int, 8)
1117 # Sanity check long long for some platforms (AIX)
1118 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1119 ac_cv_sizeof_long_long_int=0
1122 # More checks for data types
1123 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1125 [ #include <sys/types.h> ],
1127 [ ac_cv_have_u_int="yes" ],
1128 [ ac_cv_have_u_int="no" ]
1131 if test "x$ac_cv_have_u_int" = "xyes" ; then
1132 AC_DEFINE(HAVE_U_INT)
1136 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1138 [ #include <sys/types.h> ],
1139 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1140 [ ac_cv_have_intxx_t="yes" ],
1141 [ ac_cv_have_intxx_t="no" ]
1144 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1145 AC_DEFINE(HAVE_INTXX_T)
1149 if (test -z "$have_intxx_t" && \
1150 test "x$ac_cv_header_stdint_h" = "xyes")
1152 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1154 [ #include <stdint.h> ],
1155 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1157 AC_DEFINE(HAVE_INTXX_T)
1160 [ AC_MSG_RESULT(no) ]
1164 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1166 [ #include <sys/types.h> ],
1167 [ int64_t a; a = 1;],
1168 [ ac_cv_have_int64_t="yes" ],
1169 [ ac_cv_have_int64_t="no" ]
1172 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1173 AC_DEFINE(HAVE_INT64_T)
1177 if test -z "$have_int64_t" ; then
1178 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1180 [ #include <sys/socket.h> ],
1181 [ int64_t a; a = 1],
1183 AC_DEFINE(HAVE_INT64_T)
1186 [ AC_MSG_RESULT(no) ]
1190 if test -z "$have_int64_t" ; then
1191 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1193 [ #include <sys/bitypes.h> ],
1194 [ int64_t a; a = 1],
1196 AC_DEFINE(HAVE_INT64_T)
1199 [ AC_MSG_RESULT(no) ]
1203 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1205 [ #include <sys/types.h> ],
1206 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1207 [ ac_cv_have_u_intxx_t="yes" ],
1208 [ ac_cv_have_u_intxx_t="no" ]
1211 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1212 AC_DEFINE(HAVE_U_INTXX_T)
1216 if test -z "$have_u_intxx_t" ; then
1217 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1219 [ #include <sys/socket.h> ],
1220 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1222 AC_DEFINE(HAVE_U_INTXX_T)
1225 [ AC_MSG_RESULT(no) ]
1229 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1231 [ #include <sys/types.h> ],
1232 [ u_int64_t a; a = 1;],
1233 [ ac_cv_have_u_int64_t="yes" ],
1234 [ ac_cv_have_u_int64_t="no" ]
1237 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1238 AC_DEFINE(HAVE_U_INT64_T)
1242 if test -z "$have_u_int64_t" ; then
1243 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1245 [ #include <sys/bitypes.h> ],
1246 [ u_int64_t a; a = 1],
1248 AC_DEFINE(HAVE_U_INT64_T)
1251 [ AC_MSG_RESULT(no) ]
1255 if test -z "$have_u_intxx_t" ; then
1256 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1259 #include <sys/types.h>
1261 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1262 [ ac_cv_have_uintxx_t="yes" ],
1263 [ ac_cv_have_uintxx_t="no" ]
1266 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1267 AC_DEFINE(HAVE_UINTXX_T)
1271 if test -z "$have_uintxx_t" ; then
1272 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1274 [ #include <stdint.h> ],
1275 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1277 AC_DEFINE(HAVE_UINTXX_T)
1280 [ AC_MSG_RESULT(no) ]
1284 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1285 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1287 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1290 #include <sys/bitypes.h>
1293 int8_t a; int16_t b; int32_t c;
1294 u_int8_t e; u_int16_t f; u_int32_t g;
1295 a = b = c = e = f = g = 1;
1298 AC_DEFINE(HAVE_U_INTXX_T)
1299 AC_DEFINE(HAVE_INTXX_T)
1307 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1310 #include <sys/types.h>
1312 [ u_char foo; foo = 125; ],
1313 [ ac_cv_have_u_char="yes" ],
1314 [ ac_cv_have_u_char="no" ]
1317 if test "x$ac_cv_have_u_char" = "xyes" ; then
1318 AC_DEFINE(HAVE_U_CHAR)
1323 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1325 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1328 #include <sys/types.h>
1330 [ size_t foo; foo = 1235; ],
1331 [ ac_cv_have_size_t="yes" ],
1332 [ ac_cv_have_size_t="no" ]
1335 if test "x$ac_cv_have_size_t" = "xyes" ; then
1336 AC_DEFINE(HAVE_SIZE_T)
1339 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1342 #include <sys/types.h>
1344 [ ssize_t foo; foo = 1235; ],
1345 [ ac_cv_have_ssize_t="yes" ],
1346 [ ac_cv_have_ssize_t="no" ]
1349 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1350 AC_DEFINE(HAVE_SSIZE_T)
1353 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1358 [ clock_t foo; foo = 1235; ],
1359 [ ac_cv_have_clock_t="yes" ],
1360 [ ac_cv_have_clock_t="no" ]
1363 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1364 AC_DEFINE(HAVE_CLOCK_T)
1367 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1370 #include <sys/types.h>
1371 #include <sys/socket.h>
1373 [ sa_family_t foo; foo = 1235; ],
1374 [ ac_cv_have_sa_family_t="yes" ],
1377 #include <sys/types.h>
1378 #include <sys/socket.h>
1379 #include <netinet/in.h>
1381 [ sa_family_t foo; foo = 1235; ],
1382 [ ac_cv_have_sa_family_t="yes" ],
1384 [ ac_cv_have_sa_family_t="no" ]
1388 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1389 AC_DEFINE(HAVE_SA_FAMILY_T)
1392 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1395 #include <sys/types.h>
1397 [ pid_t foo; foo = 1235; ],
1398 [ ac_cv_have_pid_t="yes" ],
1399 [ ac_cv_have_pid_t="no" ]
1402 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1403 AC_DEFINE(HAVE_PID_T)
1406 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1409 #include <sys/types.h>
1411 [ mode_t foo; foo = 1235; ],
1412 [ ac_cv_have_mode_t="yes" ],
1413 [ ac_cv_have_mode_t="no" ]
1416 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1417 AC_DEFINE(HAVE_MODE_T)
1421 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1424 #include <sys/types.h>
1425 #include <sys/socket.h>
1427 [ struct sockaddr_storage s; ],
1428 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1429 [ ac_cv_have_struct_sockaddr_storage="no" ]
1432 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1433 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1436 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1439 #include <sys/types.h>
1440 #include <netinet/in.h>
1442 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1443 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1444 [ ac_cv_have_struct_sockaddr_in6="no" ]
1447 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1448 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1451 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1454 #include <sys/types.h>
1455 #include <netinet/in.h>
1457 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1458 [ ac_cv_have_struct_in6_addr="yes" ],
1459 [ ac_cv_have_struct_in6_addr="no" ]
1462 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1463 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1466 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1469 #include <sys/types.h>
1470 #include <sys/socket.h>
1473 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1474 [ ac_cv_have_struct_addrinfo="yes" ],
1475 [ ac_cv_have_struct_addrinfo="no" ]
1478 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1479 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1482 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1484 [ #include <sys/time.h> ],
1485 [ struct timeval tv; tv.tv_sec = 1;],
1486 [ ac_cv_have_struct_timeval="yes" ],
1487 [ ac_cv_have_struct_timeval="no" ]
1490 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1491 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1492 have_struct_timeval=1
1495 # If we don't have int64_t then we can't compile sftp-server. So don't
1496 # even attempt to do it.
1497 if test "x$ac_cv_have_int64_t" = "xno" -a \
1498 "x$ac_cv_sizeof_long_int" != "x8" -a \
1499 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1502 dnl test snprintf (broken on SCO w/gcc)
1507 #ifdef HAVE_SNPRINTF
1511 char expected_out[50];
1513 #if (SIZEOF_LONG_INT == 8)
1514 long int num = 0x7fffffffffffffff;
1516 long long num = 0x7fffffffffffffffll;
1518 strcpy(expected_out, "9223372036854775807");
1519 snprintf(buf, mazsize, "%lld", num);
1520 if(strcmp(buf, expected_out) != 0)
1527 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1532 dnl Checks for structure members
1533 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1534 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1535 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1536 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1537 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1538 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1539 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1540 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1541 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1542 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1543 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1544 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1545 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1546 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1547 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1548 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1549 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1551 AC_CHECK_MEMBERS([struct stat.st_blksize])
1553 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1554 ac_cv_have_ss_family_in_struct_ss, [
1557 #include <sys/types.h>
1558 #include <sys/socket.h>
1560 [ struct sockaddr_storage s; s.ss_family = 1; ],
1561 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1562 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1565 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1566 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1569 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1570 ac_cv_have___ss_family_in_struct_ss, [
1573 #include <sys/types.h>
1574 #include <sys/socket.h>
1576 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1577 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1578 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1581 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1582 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1585 AC_CACHE_CHECK([for pw_class field in struct passwd],
1586 ac_cv_have_pw_class_in_struct_passwd, [
1591 [ struct passwd p; p.pw_class = 0; ],
1592 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1593 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1596 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1597 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1600 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1601 ac_cv_have_pw_expire_in_struct_passwd, [
1606 [ struct passwd p; p.pw_expire = 0; ],
1607 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1608 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1611 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1612 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1615 AC_CACHE_CHECK([for pw_change field in struct passwd],
1616 ac_cv_have_pw_change_in_struct_passwd, [
1621 [ struct passwd p; p.pw_change = 0; ],
1622 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1623 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1626 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1627 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1630 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1631 ac_cv_have_accrights_in_msghdr, [
1634 #include <sys/types.h>
1635 #include <sys/socket.h>
1636 #include <sys/uio.h>
1638 [ struct msghdr m; m.msg_accrights = 0; ],
1639 [ ac_cv_have_accrights_in_msghdr="yes" ],
1640 [ ac_cv_have_accrights_in_msghdr="no" ]
1643 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1644 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1647 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1648 ac_cv_have_control_in_msghdr, [
1651 #include <sys/types.h>
1652 #include <sys/socket.h>
1653 #include <sys/uio.h>
1655 [ struct msghdr m; m.msg_control = 0; ],
1656 [ ac_cv_have_control_in_msghdr="yes" ],
1657 [ ac_cv_have_control_in_msghdr="no" ]
1660 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1661 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1664 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1666 [ extern char *__progname; printf("%s", __progname); ],
1667 [ ac_cv_libc_defines___progname="yes" ],
1668 [ ac_cv_libc_defines___progname="no" ]
1671 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1672 AC_DEFINE(HAVE___PROGNAME)
1675 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1679 [ printf("%s", __FUNCTION__); ],
1680 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1681 [ ac_cv_cc_implements___FUNCTION__="no" ]
1684 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1685 AC_DEFINE(HAVE___FUNCTION__)
1688 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1692 [ printf("%s", __func__); ],
1693 [ ac_cv_cc_implements___func__="yes" ],
1694 [ ac_cv_cc_implements___func__="no" ]
1697 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1698 AC_DEFINE(HAVE___func__)
1701 AC_CACHE_CHECK([whether getopt has optreset support],
1702 ac_cv_have_getopt_optreset, [
1707 [ extern int optreset; optreset = 0; ],
1708 [ ac_cv_have_getopt_optreset="yes" ],
1709 [ ac_cv_have_getopt_optreset="no" ]
1712 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1713 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1716 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1718 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1719 [ ac_cv_libc_defines_sys_errlist="yes" ],
1720 [ ac_cv_libc_defines_sys_errlist="no" ]
1723 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1724 AC_DEFINE(HAVE_SYS_ERRLIST)
1728 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1730 [ extern int sys_nerr; printf("%i", sys_nerr);],
1731 [ ac_cv_libc_defines_sys_nerr="yes" ],
1732 [ ac_cv_libc_defines_sys_nerr="no" ]
1735 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1736 AC_DEFINE(HAVE_SYS_NERR)
1741 # Check whether user wants sectok support
1743 [ --with-sectok Enable smartcard support using libsectok],
1745 if test "x$withval" != "xno" ; then
1746 if test "x$withval" != "xyes" ; then
1747 CPPFLAGS="$CPPFLAGS -I${withval}"
1748 LDFLAGS="$LDFLAGS -L${withval}"
1749 if test ! -z "$need_dash_r" ; then
1750 LDFLAGS="$LDFLAGS -R${withval}"
1752 if test ! -z "$blibpath" ; then
1753 blibpath="$blibpath:${withval}"
1756 AC_CHECK_HEADERS(sectok.h)
1757 if test "$ac_cv_header_sectok_h" != yes; then
1758 AC_MSG_ERROR(Can't find sectok.h)
1760 AC_CHECK_LIB(sectok, sectok_open)
1761 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1762 AC_MSG_ERROR(Can't find libsectok)
1764 AC_DEFINE(SMARTCARD)
1765 AC_DEFINE(USE_SECTOK)
1766 SCARD_MSG="yes, using sectok"
1771 # Check whether user wants OpenSC support
1773 AC_HELP_STRING([--with-opensc=PFX],
1774 [Enable smartcard support using OpenSC]),
1775 opensc_config_prefix="$withval", opensc_config_prefix="")
1776 if test x$opensc_config_prefix != x ; then
1777 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1778 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1779 if test "$OPENSC_CONFIG" != "no"; then
1780 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1781 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1782 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1783 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1784 AC_DEFINE(SMARTCARD)
1785 AC_DEFINE(USE_OPENSC)
1786 SCARD_MSG="yes, using OpenSC"
1790 # Check whether user wants Kerberos 5 support
1792 AC_ARG_WITH(kerberos5,
1793 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1795 if test "x$withval" != "xno" ; then
1796 if test "x$withval" = "xyes" ; then
1797 KRB5ROOT="/usr/local"
1801 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1802 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1805 AC_MSG_CHECKING(whether we are using Heimdal)
1806 AC_TRY_COMPILE([ #include <krb5.h> ],
1807 [ char *tmp = heimdal_version; ],
1808 [ AC_MSG_RESULT(yes)
1810 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1813 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1816 if test ! -z "$need_dash_r" ; then
1817 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1819 if test ! -z "$blibpath" ; then
1820 blibpath="$blibpath:${KRB5ROOT}/lib"
1822 AC_CHECK_LIB(resolv, dn_expand, , )
1824 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1826 K5LIBS="-lgssapi $K5LIBS" ],
1827 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1829 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1830 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1835 AC_CHECK_HEADER(gssapi.h, ,
1836 [ unset ac_cv_header_gssapi_h
1837 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1838 AC_CHECK_HEADERS(gssapi.h, ,
1839 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1845 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1846 AC_CHECK_HEADER(gssapi_krb5.h, ,
1847 [ CPPFLAGS="$oldCPP" ])
1853 # Check whether user wants Kerberos 4 support
1855 AC_ARG_WITH(kerberos4,
1856 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1858 if test "x$withval" != "xno" ; then
1859 if test "x$withval" != "xyes" ; then
1860 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1861 LDFLAGS="$LDFLAGS -L${withval}/lib"
1862 if test ! -z "$need_dash_r" ; then
1863 LDFLAGS="$LDFLAGS -R${withval}/lib"
1865 if test ! -z "$blibpath" ; then
1866 blibpath="$blibpath:${withval}/lib"
1869 if test -d /usr/include/kerberosIV ; then
1870 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1874 AC_CHECK_HEADERS(krb.h)
1875 if test "$ac_cv_header_krb_h" != yes; then
1876 AC_MSG_WARN([Cannot find krb.h, build may fail])
1878 AC_CHECK_LIB(krb, main)
1879 if test "$ac_cv_lib_krb_main" != yes; then
1880 AC_CHECK_LIB(krb4, main)
1881 if test "$ac_cv_lib_krb4_main" != yes; then
1882 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1889 AC_CHECK_LIB(des, des_cbc_encrypt)
1890 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1891 AC_CHECK_LIB(des425, des_cbc_encrypt)
1892 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1893 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1900 AC_CHECK_LIB(resolv, dn_expand, , )
1908 # Check whether user wants AFS support
1911 [ --with-afs=PATH Enable AFS support],
1913 if test "x$withval" != "xno" ; then
1915 if test "x$withval" != "xyes" ; then
1916 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1917 LDFLAGS="$LDFLAGS -L${withval}/lib"
1920 if test -z "$KRB4" ; then
1921 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1925 if test ! -z "$AFS_LIBS" ; then
1926 LIBS="$LIBS $AFS_LIBS"
1933 LIBS="$LIBS $KLIBS $K5LIBS"
1935 # Looking for programs, paths and files
1937 [ --with-rsh=PATH Specify path to remote shell program ],
1939 if test "x$withval" != "$no" ; then
1944 AC_PATH_PROG(rsh_path, rsh)
1948 PRIVSEP_PATH=/var/empty
1949 AC_ARG_WITH(privsep-path,
1950 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1952 if test "x$withval" != "$no" ; then
1953 PRIVSEP_PATH=$withval
1957 AC_SUBST(PRIVSEP_PATH)
1960 [ --with-xauth=PATH Specify path to xauth program ],
1962 if test "x$withval" != "xno" ; then
1967 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1968 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1969 xauth_path="/usr/openwin/bin/xauth"
1974 if test -z "$xauth_path" ; then
1975 XAUTH_PATH="undefined"
1976 AC_SUBST(XAUTH_PATH)
1978 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1979 XAUTH_PATH=$xauth_path
1980 AC_SUBST(XAUTH_PATH)
1982 if test ! -z "$rsh_path" ; then
1983 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1986 # Check for mail directory (last resort if we cannot get it from headers)
1987 if test ! -z "$MAIL" ; then
1988 maildir=`dirname $MAIL`
1989 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1992 if test -z "$no_dev_ptmx" ; then
1993 if test "x$disable_ptmx_check" != "xyes" ; then
1994 AC_CHECK_FILE("/dev/ptmx",
1996 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2002 AC_CHECK_FILE("/dev/ptc",
2004 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2009 # Options from here on. Some of these are preset by platform above
2010 AC_ARG_WITH(mantype,
2011 [ --with-mantype=man|cat|doc Set man page type],
2018 AC_MSG_ERROR(invalid man type: $withval)
2023 if test -z "$MANTYPE"; then
2024 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
2025 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2027 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2034 if test "$MANTYPE" = "doc"; then
2041 # Check whether to enable MD5 passwords
2043 AC_ARG_WITH(md5-passwords,
2044 [ --with-md5-passwords Enable use of MD5 passwords],
2046 if test "x$withval" != "xno" ; then
2047 AC_DEFINE(HAVE_MD5_PASSWORDS)
2053 # Whether to disable shadow password support
2055 [ --without-shadow Disable shadow password support],
2057 if test "x$withval" = "xno" ; then
2058 AC_DEFINE(DISABLE_SHADOW)
2064 if test -z "$disable_shadow" ; then
2065 AC_MSG_CHECKING([if the systems has expire shadow information])
2068 #include <sys/types.h>
2071 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2072 [ sp_expire_available=yes ], []
2075 if test "x$sp_expire_available" = "xyes" ; then
2077 AC_DEFINE(HAS_SHADOW_EXPIRE)
2083 # Use ip address instead of hostname in $DISPLAY
2084 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2085 DISPLAY_HACK_MSG="yes"
2086 AC_DEFINE(IPADDR_IN_DISPLAY)
2088 DISPLAY_HACK_MSG="no"
2089 AC_ARG_WITH(ipaddr-display,
2090 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2092 if test "x$withval" != "xno" ; then
2093 AC_DEFINE(IPADDR_IN_DISPLAY)
2094 DISPLAY_HACK_MSG="yes"
2100 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2101 if test $ac_cv_func_login_getcapbool = "yes" -a \
2102 $ac_cv_header_login_cap_h = "yes" ; then
2105 # Whether to mess with the default path
2106 SERVER_PATH_MSG="(default)"
2107 AC_ARG_WITH(default-path,
2108 [ --with-default-path= Specify default \$PATH environment for server],
2110 if test "$USES_LOGIN_CONF" = "yes" ; then
2112 --with-default-path=PATH has no effect on this system.
2113 Edit /etc/login.conf instead.])
2114 elif test "x$withval" != "xno" ; then
2115 user_path="$withval"
2116 SERVER_PATH_MSG="$withval"
2119 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2120 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2124 /* find out what STDPATH is */
2129 #ifndef _PATH_STDPATH
2130 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2132 #include <sys/types.h>
2133 #include <sys/stat.h>
2135 #define DATA "conftest.stdpath"
2142 fd = fopen(DATA,"w");
2146 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2151 ], [ user_path=`cat conftest.stdpath` ],
2152 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2153 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2155 # make sure $bindir is in USER_PATH so scp will work
2156 t_bindir=`eval echo ${bindir}`
2158 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2161 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2163 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2164 if test $? -ne 0 ; then
2165 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2166 if test $? -ne 0 ; then
2167 user_path=$user_path:$t_bindir
2168 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2173 if test "$USES_LOGIN_CONF" != "yes" ; then
2174 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2178 # Set superuser path separately to user path
2180 AC_ARG_WITH(superuser-path,
2181 [ --with-superuser-path= Specify different path for super-user],
2183 if test "x$withval" != "xno" ; then
2184 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2185 superuser_path=$withval
2191 # Whether to force IPv4 by default (needed on broken glibc Linux)
2193 AC_ARG_WITH(ipv4-default,
2194 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2196 if test "x$withval" != "xno" ; then
2197 AC_DEFINE(IPV4_DEFAULT)
2203 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2204 IPV4_IN6_HACK_MSG="no"
2206 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2208 if test "x$withval" != "xno" ; then
2210 AC_DEFINE(IPV4_IN_IPV6)
2211 IPV4_IN6_HACK_MSG="yes"
2216 if test "x$inet6_default_4in6" = "xyes"; then
2217 AC_MSG_RESULT([yes (default)])
2218 AC_DEFINE(IPV4_IN_IPV6)
2219 IPV4_IN6_HACK_MSG="yes"
2221 AC_MSG_RESULT([no (default)])
2226 # Whether to enable BSD auth support
2228 AC_ARG_WITH(bsd-auth,
2229 [ --with-bsd-auth Enable BSD auth support],
2231 if test "x$withval" != "xno" ; then
2238 AC_MSG_CHECKING(whether to install ssh as suid root)
2239 AC_ARG_ENABLE(suid-ssh,
2240 [ --enable-suid-ssh Install ssh as suid root (default)
2241 --disable-suid-ssh Install ssh without suid bit],
2242 [ case "$enableval" in
2247 *) AC_MSG_RESULT(yes)
2257 # Where to place sshd.pid
2259 # make sure the directory exists
2260 if test ! -d $piddir ; then
2261 piddir=`eval echo ${sysconfdir}`
2263 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2267 AC_ARG_WITH(pid-dir,
2268 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2270 if test "x$withval" != "xno" ; then
2272 if test ! -d $piddir ; then
2273 AC_MSG_WARN([** no $piddir directory on this system **])
2279 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2282 dnl allow user to disable some login recording features
2283 AC_ARG_ENABLE(lastlog,
2284 [ --disable-lastlog disable use of lastlog even if detected [no]],
2285 [ AC_DEFINE(DISABLE_LASTLOG) ]
2288 [ --disable-utmp disable use of utmp even if detected [no]],
2289 [ AC_DEFINE(DISABLE_UTMP) ]
2291 AC_ARG_ENABLE(utmpx,
2292 [ --disable-utmpx disable use of utmpx even if detected [no]],
2293 [ AC_DEFINE(DISABLE_UTMPX) ]
2296 [ --disable-wtmp disable use of wtmp even if detected [no]],
2297 [ AC_DEFINE(DISABLE_WTMP) ]
2299 AC_ARG_ENABLE(wtmpx,
2300 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2301 [ AC_DEFINE(DISABLE_WTMPX) ]
2303 AC_ARG_ENABLE(libutil,
2304 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2305 [ AC_DEFINE(DISABLE_LOGIN) ]
2307 AC_ARG_ENABLE(pututline,
2308 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2309 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2311 AC_ARG_ENABLE(pututxline,
2312 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2313 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2315 AC_ARG_WITH(lastlog,
2316 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2318 if test "x$withval" = "xno" ; then
2319 AC_DEFINE(DISABLE_LASTLOG)
2321 conf_lastlog_location=$withval
2326 dnl lastlog, [uw]tmpx? detection
2327 dnl NOTE: set the paths in the platform section to avoid the
2328 dnl need for command-line parameters
2329 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2331 dnl lastlog detection
2332 dnl NOTE: the code itself will detect if lastlog is a directory
2333 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2335 #include <sys/types.h>
2337 #ifdef HAVE_LASTLOG_H
2338 # include <lastlog.h>
2347 [ char *lastlog = LASTLOG_FILE; ],
2348 [ AC_MSG_RESULT(yes) ],
2351 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2353 #include <sys/types.h>
2355 #ifdef HAVE_LASTLOG_H
2356 # include <lastlog.h>
2362 [ char *lastlog = _PATH_LASTLOG; ],
2363 [ AC_MSG_RESULT(yes) ],
2366 system_lastlog_path=no
2371 if test -z "$conf_lastlog_location"; then
2372 if test x"$system_lastlog_path" = x"no" ; then
2373 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2374 if (test -d "$f" || test -f "$f") ; then
2375 conf_lastlog_location=$f
2378 if test -z "$conf_lastlog_location"; then
2379 AC_MSG_WARN([** Cannot find lastlog **])
2380 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2385 if test -n "$conf_lastlog_location"; then
2386 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2390 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2392 #include <sys/types.h>
2398 [ char *utmp = UTMP_FILE; ],
2399 [ AC_MSG_RESULT(yes) ],
2401 system_utmp_path=no ]
2403 if test -z "$conf_utmp_location"; then
2404 if test x"$system_utmp_path" = x"no" ; then
2405 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2406 if test -f $f ; then
2407 conf_utmp_location=$f
2410 if test -z "$conf_utmp_location"; then
2411 AC_DEFINE(DISABLE_UTMP)
2415 if test -n "$conf_utmp_location"; then
2416 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2420 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2422 #include <sys/types.h>
2428 [ char *wtmp = WTMP_FILE; ],
2429 [ AC_MSG_RESULT(yes) ],
2431 system_wtmp_path=no ]
2433 if test -z "$conf_wtmp_location"; then
2434 if test x"$system_wtmp_path" = x"no" ; then
2435 for f in /usr/adm/wtmp /var/log/wtmp; do
2436 if test -f $f ; then
2437 conf_wtmp_location=$f
2440 if test -z "$conf_wtmp_location"; then
2441 AC_DEFINE(DISABLE_WTMP)
2445 if test -n "$conf_wtmp_location"; then
2446 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2450 dnl utmpx detection - I don't know any system so perverse as to require
2451 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2453 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2455 #include <sys/types.h>
2464 [ char *utmpx = UTMPX_FILE; ],
2465 [ AC_MSG_RESULT(yes) ],
2467 system_utmpx_path=no ]
2469 if test -z "$conf_utmpx_location"; then
2470 if test x"$system_utmpx_path" = x"no" ; then
2471 AC_DEFINE(DISABLE_UTMPX)
2474 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2478 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2480 #include <sys/types.h>
2489 [ char *wtmpx = WTMPX_FILE; ],
2490 [ AC_MSG_RESULT(yes) ],
2492 system_wtmpx_path=no ]
2494 if test -z "$conf_wtmpx_location"; then
2495 if test x"$system_wtmpx_path" = x"no" ; then
2496 AC_DEFINE(DISABLE_WTMPX)
2499 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2503 if test ! -z "$blibpath" ; then
2504 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2505 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2508 dnl remove pam and dl because they are in $LIBPAM
2509 if test "$PAM_MSG" = yes ; then
2510 LIBS=`echo $LIBS | sed 's/-lpam //'`
2512 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2513 LIBS=`echo $LIBS | sed 's/-ldl //'`
2517 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2520 # Print summary of options
2522 # Someone please show me a better way :)
2523 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2524 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2525 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2526 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2527 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2528 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2529 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2530 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2531 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2532 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2535 echo "OpenSSH has been configured with the following options:"
2536 echo " User binaries: $B"
2537 echo " System binaries: $C"
2538 echo " Configuration files: $D"
2539 echo " Askpass program: $E"
2540 echo " Manual pages: $F"
2541 echo " PID file: $G"
2542 echo " Privilege separation chroot path: $H"
2543 if test "$USES_LOGIN_CONF" = "yes" ; then
2544 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2546 echo " sshd default user PATH: $I"
2548 if test ! -z "$superuser_path" ; then
2549 echo " sshd superuser user PATH: $J"
2551 echo " Manpage format: $MANTYPE"
2552 echo " PAM support: ${PAM_MSG}"
2553 echo " KerberosIV support: $KRB4_MSG"
2554 echo " KerberosV support: $KRB5_MSG"
2555 echo " Smartcard support: $SCARD_MSG"
2556 echo " AFS support: $AFS_MSG"
2557 echo " S/KEY support: $SKEY_MSG"
2558 echo " TCP Wrappers support: $TCPW_MSG"
2559 echo " MD5 password support: $MD5_MSG"
2560 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2561 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2562 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2563 echo " BSD Auth support: $BSD_AUTH_MSG"
2564 echo " Random number source: $RAND_MSG"
2565 if test ! -z "$USE_RAND_HELPER" ; then
2566 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2571 echo " Host: ${host}"
2572 echo " Compiler: ${CC}"
2573 echo " Compiler flags: ${CFLAGS}"
2574 echo "Preprocessor flags: ${CPPFLAGS}"
2575 echo " Linker flags: ${LDFLAGS}"
2576 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2580 if test "x$PAM_MSG" = "xyes" ; then
2581 echo "PAM is enabled. You may need to install a PAM control file "
2582 echo "for sshd, otherwise password authentication may fail. "
2583 echo "Example PAM control files can be found in the contrib/ "
2588 if test ! -z "$NO_SFTP"; then
2589 echo "sftp-server will be disabled. Your compiler does not "
2590 echo "support 64bit integers."
2594 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2595 echo "WARNING: you are using the builtin random number collection "
2596 echo "service. Please read WARNING.RNG and request that your OS "
2597 echo "vendor includes kernel-based random number collection in "
2598 echo "future versions of your OS."