4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
18 AC_PATH_PROG(ENT, ent)
20 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
21 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
29 if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
33 # Use LOGIN_PROGRAM from environment if possible
34 if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
44 if test -z "$LD" ; then
50 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
54 # Check for some target-specific stuff
58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60 if (test "$LD" != "gcc" && test -z "$blibpath"); then
61 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
68 blibpath="/usr/lib:/lib:/usr/local/lib"
72 LDFLAGS="$saved_LDFLAGS"
74 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
75 AC_DEFINE(BROKEN_GETADDRINFO)
76 AC_DEFINE(BROKEN_REALPATH)
77 dnl AIX handles lastlog as part of its login message
78 AC_DEFINE(DISABLE_LASTLOG)
79 AC_DEFINE(LOGIN_NEEDS_UTMPX)
82 LIBS="$LIBS /usr/lib/textmode.o"
83 AC_DEFINE(HAVE_CYGWIN)
85 AC_DEFINE(DISABLE_SHADOW)
86 AC_DEFINE(IPV4_DEFAULT)
87 AC_DEFINE(IP_TOS_IS_BROKEN)
88 AC_DEFINE(NO_X11_UNIX_SOCKETS)
89 AC_DEFINE(BROKEN_FD_PASSING)
90 AC_DEFINE(SETGROUPS_NOOP)
93 AC_DEFINE(IP_TOS_IS_BROKEN)
96 AC_DEFINE(BROKEN_GETADDRINFO)
99 if test -z "$GCC"; then
102 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
103 IPADDR_IN_DISPLAY=yes
104 AC_DEFINE(HAVE_SECUREWARE)
106 AC_DEFINE(LOGIN_NO_ENDOPT)
107 AC_DEFINE(LOGIN_NEEDS_UTMPX)
108 AC_DEFINE(DISABLE_SHADOW)
109 AC_DEFINE(DISABLE_UTMP)
110 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
111 LIBS="$LIBS -lxnet -lsec -lsecpw"
112 disable_ptmx_check=yes
115 if test -z "$GCC"; then
118 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
119 IPADDR_IN_DISPLAY=yes
121 AC_DEFINE(LOGIN_NO_ENDOPT)
122 AC_DEFINE(LOGIN_NEEDS_UTMPX)
123 AC_DEFINE(DISABLE_SHADOW)
124 AC_DEFINE(DISABLE_UTMP)
125 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
126 LIBS="$LIBS -lxnet -lsec"
129 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
130 IPADDR_IN_DISPLAY=yes
131 AC_DEFINE(PAM_SUN_CODEBASE)
133 AC_DEFINE(LOGIN_NO_ENDOPT)
134 AC_DEFINE(LOGIN_NEEDS_UTMPX)
135 AC_DEFINE(DISABLE_SHADOW)
136 AC_DEFINE(DISABLE_UTMP)
137 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
138 LIBS="$LIBS -lxnet -lsec"
141 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
143 PATH="$PATH:/usr/etc"
144 AC_DEFINE(BROKEN_INET_NTOA)
145 AC_DEFINE(WITH_ABBREV_NO_TTY)
148 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
150 PATH="$PATH:/usr/etc"
151 AC_DEFINE(WITH_IRIX_ARRAY)
152 AC_DEFINE(WITH_IRIX_PROJECT)
153 AC_DEFINE(WITH_IRIX_AUDIT)
154 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
155 AC_DEFINE(BROKEN_INET_NTOA)
156 AC_DEFINE(WITH_ABBREV_NO_TTY)
160 check_for_libcrypt_later=1
161 AC_DEFINE(DONT_TRY_OTHER_AF)
162 AC_DEFINE(PAM_TTY_KLUDGE)
163 inet6_default_4in6=yes
165 mips-sony-bsd|mips-sony-newsos4)
166 AC_DEFINE(HAVE_NEWS4)
173 check_for_libcrypt_later=1
176 conf_lastlog_location="/usr/adm/lastlog"
177 conf_utmp_location=/etc/utmp
178 conf_wtmp_location=/usr/adm/wtmp
181 AC_DEFINE(BROKEN_REALPATH)
183 AC_DEFINE(BROKEN_SAVED_UIDS)
184 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
188 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
189 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
191 AC_DEFINE(PAM_SUN_CODEBASE)
192 AC_DEFINE(LOGIN_NEEDS_UTMPX)
193 AC_DEFINE(LOGIN_NEEDS_TERM)
194 AC_DEFINE(PAM_TTY_KLUDGE)
195 # hardwire lastlog location (can't detect it on some versions)
196 conf_lastlog_location="/var/adm/lastlog"
197 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
198 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
199 if test "$sol2ver" -ge 8; then
201 AC_DEFINE(DISABLE_UTMP)
202 AC_DEFINE(DISABLE_WTMP)
208 CPPFLAGS="$CPPFLAGS -DSUNOS4"
209 AC_CHECK_FUNCS(getpwanam)
210 AC_DEFINE(PAM_SUN_CODEBASE)
211 conf_utmp_location=/etc/utmp
212 conf_wtmp_location=/var/adm/wtmp
213 conf_lastlog_location=/var/adm/lastlog
217 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
218 LDFLAGS="$LDFLAGS -L/usr/local/lib"
223 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
224 # /usr/ucblib MUST NOT be searched on ReliantUNIX
225 LDFLAGS="$LDFLAGS -L/usr/local/lib"
226 IPADDR_IN_DISPLAY=yes
228 AC_DEFINE(IP_TOS_IS_BROKEN)
229 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
230 # Attention: always take care to bind libsocket and libnsl before libc,
231 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
234 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
235 LDFLAGS="$LDFLAGS -L/usr/local/lib"
239 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
240 LDFLAGS="$LDFLAGS -L/usr/local/lib"
244 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
245 LDFLAGS="$LDFLAGS -L/usr/local/lib"
248 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
249 LDFLAGS="$LDFLAGS -L/usr/local/lib"
250 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
253 AC_DEFINE(BROKEN_SYS_TERMIO_H)
255 AC_DEFINE(HAVE_SECUREWARE)
256 AC_DEFINE(DISABLE_SHADOW)
257 AC_DEFINE(BROKEN_SAVED_UIDS)
258 AC_CHECK_FUNCS(getluid setluid)
260 do_sco3_extra_lib_check=yes
263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
265 LIBS="$LIBS -lprot -lx -ltinfo -lm"
268 AC_DEFINE(HAVE_SECUREWARE)
269 AC_DEFINE(DISABLE_SHADOW)
270 AC_DEFINE(BROKEN_FD_PASSING)
271 AC_CHECK_FUNCS(getluid setluid)
278 AC_DEFINE(BROKEN_FD_PASSING)
279 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
280 LIBS="$LIBS -lgen -lrsc"
283 AC_MSG_CHECKING(for Digital Unix SIA)
286 [ --with-osfsia Enable Digital Unix SIA],
288 if test "x$withval" = "xno" ; then
289 AC_MSG_RESULT(disabled)
294 if test -z "$no_osfsia" ; then
295 if test -f /etc/sia/matrix.conf; then
297 AC_DEFINE(HAVE_OSF_SIA)
298 AC_DEFINE(DISABLE_LOGIN)
299 LIBS="$LIBS -lsecurity -ldb -lm -laud"
308 AC_DEFINE(NO_X11_UNIX_SOCKETS)
309 AC_DEFINE(MISSING_NFDBITS)
310 AC_DEFINE(MISSING_HOWMANY)
311 AC_DEFINE(MISSING_FD_MASK)
315 # Allow user to specify flags
317 [ --with-cflags Specify additional flags to pass to compiler],
319 if test "x$withval" != "xno" ; then
320 CFLAGS="$CFLAGS $withval"
324 AC_ARG_WITH(cppflags,
325 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
327 if test "x$withval" != "xno"; then
328 CPPFLAGS="$CPPFLAGS $withval"
333 [ --with-ldflags Specify additional flags to pass to linker],
335 if test "x$withval" != "xno" ; then
336 LDFLAGS="$LDFLAGS $withval"
341 [ --with-libs Specify additional libraries to link with],
343 if test "x$withval" != "xno" ; then
344 LIBS="$LIBS $withval"
349 # Checks for header files.
350 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
351 getopt.h glob.h lastlog.h limits.h login.h \
352 login_cap.h maillock.h netdb.h netgroup.h \
353 netinet/in_systm.h paths.h pty.h readpassphrase.h \
354 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
355 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
356 sys/mman.h sys/select.h sys/stat.h \
357 sys/stropts.h sys/sysmacros.h sys/time.h \
358 sys/un.h time.h ttyent.h usersec.h \
359 util.h utime.h utmp.h utmpx.h)
361 # Checks for libraries.
362 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
363 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
365 dnl SCO OS3 needs this for libwrap
366 if test "x$with_tcp_wrappers" != "xno" ; then
367 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
368 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
372 AC_CHECK_FUNC(getspnam, ,
373 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
376 [ --without-rpath Disable auto-added -R linker paths],
378 if test "x$withval" = "xno" ; then
381 if test "x$withval" = "xyes" ; then
389 [ --with-zlib=PATH Use zlib in PATH],
391 if test "x$withval" = "xno" ; then
392 AC_MSG_ERROR([*** zlib is required ***])
394 if test -d "$withval/lib"; then
395 if test -n "${need_dash_r}"; then
396 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
398 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
401 if test -n "${need_dash_r}"; then
402 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
404 LDFLAGS="-L${withval} ${LDFLAGS}"
407 if test -d "$withval/include"; then
408 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
410 CPPFLAGS="-I${withval} ${CPPFLAGS}"
415 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
418 AC_CHECK_FUNC(strcasecmp,
419 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
421 AC_CHECK_FUNC(utimes,
422 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
425 dnl Checks for libutil functions
426 AC_CHECK_HEADERS(libutil.h)
427 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
428 AC_CHECK_FUNCS(logout updwtmp logwtmp)
432 # Check for ALTDIRFUNC glob() extension
433 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
434 AC_EGREP_CPP(FOUNDIT,
437 #ifdef GLOB_ALTDIRFUNC
442 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
450 # Check for g.gl_matchc glob() extension
451 AC_MSG_CHECKING(for gl_matchc field in glob_t)
452 AC_EGREP_CPP(FOUNDIT,
455 int main(void){glob_t g; g.gl_matchc = 1;}
458 AC_DEFINE(GLOB_HAS_GL_MATCHC)
466 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
469 #include <sys/types.h>
471 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
473 [AC_MSG_RESULT(yes)],
476 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
480 # Check whether the user wants GSI (Globus) support
483 [ --with-gsi=PATH Enable GSI/Globus authentication support],
490 [ --with-globus=PATH Enable GSI/Globus authentication support],
496 # Check whether the user has a Globus flavor type
497 globus_flavor_type="no"
498 AC_ARG_WITH(globus-flavor,
499 [ --with-globus-flavor=TYPE Describe Globus flavor type (ex: gcc32dbg, etc.)],
501 globus_flavor_type="$withval"
505 if test "x$gsi_path" != "xno" ; then
506 # Globus GSSAPI configuration
510 # Find GLOBUS/GSI installation Directory
511 AC_MSG_CHECKING(for Globus/GSI installation directory)
513 globus_install_dir=$gsi_path
515 if test "x$globus_install_dir" = "xyes" ; then
516 AC_MSG_ERROR(Cannot find Globus/GSI installation directory -- a path must be specified!)
518 AC_MSG_RESULT($globus_install_dir)
520 # Find GLOBUS/GSI development directory
521 AC_MSG_CHECKING(for Globus/GSI development directory)
523 if test -d ${globus_install_dir}/lib ; then
524 # Looks like a flat directory structure from configure/make
525 # and not globus-install or gsi-install
526 globus_dev_dir=$globus_install_dir
529 # Assume a true globus installation with architecture
530 # directories and run globus-development-path to find
531 # the development directory
533 # Set GLOBUS_INSTALL_PATH
534 GLOBUS_INSTALL_PATH=$globus_install_dir
535 export GLOBUS_INSTALL_PATH
537 dev_path_program=${globus_install_dir}/bin/globus-development-path
539 if test ! -x ${dev_path_program} ; then
540 AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
543 globus_dev_dir=`${dev_path_program}`
545 if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
546 AC_MSG_ERROR(Cannot find Globus/GSI development directory)
549 if test ! -d "$globus_dev_dir" ; then
550 AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
553 AC_MSG_RESULT($globus_dev_dir)
555 # Find GLOBUS/GSI flavor Directory
556 AC_MSG_CHECKING(for Globus flavor type)
558 if test "x$globus_flavor_type" = "xno" ; then
559 GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa"
560 GSI_LDFLAGS="-L${globus_dev_dir}/lib"
561 GSI_CFLAGS="-I${globus_dev_dir}/include"
564 GLOBUS_FLAVOR_TYPE_INCL_DIR="${globus_dev_dir}/include/${globus_flavor_type}"
566 if test ! -d "$GLOBUS_FLAVOR_TYPE_INCL_DIR" ; then
567 AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_FLAVOR_TYPE_INCL_DIR})
570 AC_MSG_RESULT($globus_flavor_type)
571 GSI_LIBS="${gsi_path}/lib/libglobus_gss_assist_${globus_flavor_type}.a ${gsi_path}/lib/libglobus_gssapi_gsi_${globus_flavor_type}.a"
572 GSI_CFLAGS="-I${GLOBUS_FLAVOR_TYPE_INCL_DIR}"
575 LIBS="$LIBS $GSI_LIBS"
576 LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
577 CFLAGS="$CFLAGS $GSI_CFLAGS"
578 # End Globus/GSI section
581 # Check whether user wants S/Key support
584 [ --with-skey[[=PATH]] Enable S/Key support
585 (optionally in PATH)],
587 if test "x$withval" != "xno" ; then
589 if test "x$withval" != "xyes" ; then
590 CPPFLAGS="$CPPFLAGS -I${withval}/include"
591 LDFLAGS="$LDFLAGS -L${withval}/lib"
598 AC_MSG_CHECKING([for s/key support])
603 int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
605 [AC_MSG_RESULT(yes)],
608 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
614 # Check whether user wants TCP wrappers support
616 AC_ARG_WITH(tcp-wrappers,
617 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
618 (optionally in PATH)],
620 if test "x$withval" != "xno" ; then
622 saved_LDFLAGS="$LDFLAGS"
623 saved_CPPFLAGS="$CPPFLAGS"
624 if test -n "${withval}" -a "${withval}" != "yes"; then
625 if test -d "${withval}/lib"; then
626 if test -n "${need_dash_r}"; then
627 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
629 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
632 if test -n "${need_dash_r}"; then
633 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
635 LDFLAGS="-L${withval} ${LDFLAGS}"
638 if test -d "${withval}/include"; then
639 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
641 CPPFLAGS="-I${withval} ${CPPFLAGS}"
645 LIBS="$LIBWRAP $LIBS"
646 AC_MSG_CHECKING(for libwrap)
650 int deny_severity = 0, allow_severity = 0;
660 AC_MSG_ERROR([*** libwrap missing])
668 dnl Checks for library functions.
669 AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
670 clock fchmod fchown freeaddrinfo futimes gai_strerror \
671 getaddrinfo getcwd getgrouplist getnameinfo getopt \
672 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
673 inet_ntop innetgr login_getcapbool md5_crypt memmove \
674 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
675 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
676 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
677 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
678 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
679 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
681 if test $ac_cv_func_mmap = yes ; then
682 AC_MSG_CHECKING([for mmap anon shared])
686 #include <sys/mman.h>
687 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
688 #define MAP_ANON MAP_ANONYMOUS
691 p = (char *) mmap(NULL, 10, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, 0);
699 AC_DEFINE(HAVE_MMAP_ANON_SHARED)
701 [ AC_MSG_RESULT(no) ]
705 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
706 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
707 AC_CHECK_LIB(gen, dirname,[
708 AC_CACHE_CHECK([for broken dirname],
709 ac_cv_have_broken_dirname, [
717 int main(int argc, char **argv) {
720 strncpy(buf,"/etc", 32);
722 if (!s || strncmp(s, "/", 32) != 0) {
729 [ ac_cv_have_broken_dirname="no" ],
730 [ ac_cv_have_broken_dirname="yes" ]
734 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
736 AC_DEFINE(HAVE_DIRNAME)
737 AC_CHECK_HEADERS(libgen.h)
742 dnl Checks for time functions
743 AC_CHECK_FUNCS(gettimeofday time)
744 dnl Checks for utmp functions
745 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
746 AC_CHECK_FUNCS(utmpname)
747 dnl Checks for utmpx functions
748 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
749 AC_CHECK_FUNCS(setutxent utmpxname)
751 AC_CHECK_FUNC(daemon,
752 [AC_DEFINE(HAVE_DAEMON)],
753 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
756 AC_CHECK_FUNC(getpagesize,
757 [AC_DEFINE(HAVE_GETPAGESIZE)],
758 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
761 # Check for broken snprintf
762 if test "x$ac_cv_func_snprintf" = "xyes" ; then
763 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
767 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
769 [AC_MSG_RESULT(yes)],
772 AC_DEFINE(BROKEN_SNPRINTF)
773 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
783 [ --with-pam Enable PAM support ],
785 if test "x$withval" != "xno" ; then
786 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
787 AC_MSG_ERROR([PAM headers not found])
790 AC_CHECK_LIB(dl, dlopen, , )
791 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
792 AC_CHECK_FUNCS(pam_getenvlist)
793 AC_CHECK_FUNCS(pam_putenv)
799 if test $ac_cv_lib_dl_dlopen = yes; then
809 # Check for older PAM
810 if test "x$PAM_MSG" = "xyes" ; then
811 # Check PAM strerror arguments (old PAM)
812 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
816 #include <security/pam_appl.h>
818 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
821 AC_DEFINE(HAVE_OLD_PAM)
823 PAM_MSG="yes (old library)"
829 saved_CPPFLAGS="$CPPFLAGS"
830 saved_LDFLAGS="$LDFLAGS"
832 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
834 if test "x$withval" != "xno" ; then
835 if test -d "$withval/lib"; then
836 if test -n "${need_dash_r}"; then
837 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
839 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
842 if test -n "${need_dash_r}"; then
843 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
845 LDFLAGS="-L${withval} ${LDFLAGS}"
848 if test -d "$withval/include"; then
849 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
851 CPPFLAGS="-I${withval} ${CPPFLAGS}"
857 # Patch up SSL libraries for GSI authentication as needed
858 if test "x$globus_flavor_type" != "xno" ; then
859 # For Globus 2, always link with the static libraries
860 LIBS="$LIBS ${gsi_path}/lib/libglobus_ssl_utils_${globus_flavor_type}.a ${gsi_path}/lib/libssl_${globus_flavor_type}.a ${gsi_path}/lib/libcrypto_${globus_flavor_type}.a"
862 if test "x$gsi_path" != "xno" ; then
863 # Older GSI needs -lssl too
864 LIBS="$LIBS -lssl -lcrypto"
865 else # if no GSI authentication (i.e., OpenSSL default)
866 LIBS="$LIBS -lcrypto"
868 fi # globus_flavor_type
870 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
872 dnl Check default openssl install dir
873 if test -n "${need_dash_r}"; then
874 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
876 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
878 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
879 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
881 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
888 # Sanity check OpenSSL headers
889 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
893 #include <openssl/opensslv.h>
894 int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
901 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
905 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
906 # version in OpenSSL. Skip this for PAM
907 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
908 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
912 ### Configure cryptographic random number support
914 # Check wheter OpenSSL seeds itself
915 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
919 #include <openssl/rand.h>
920 int main(void) { return(RAND_status() == 1 ? 0 : 1); }
923 OPENSSL_SEEDS_ITSELF=yes
928 # Default to use of the rand helper if OpenSSL doesn't
935 # Do we want to force the use of the rand helper?
936 AC_ARG_WITH(rand-helper,
937 [ --with-rand-helper Use subprocess to gather strong randomness ],
939 if test "x$withval" = "xno" ; then
940 # Force use of OpenSSL's internal RNG, even if
941 # the previous test showed it to be unseeded.
942 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
943 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
944 OPENSSL_SEEDS_ITSELF=yes
953 # Which randomness source do we use?
954 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
956 AC_DEFINE(OPENSSL_PRNG_ONLY)
957 RAND_MSG="OpenSSL internal ONLY"
958 INSTALL_SSH_RAND_HELPER=""
959 elif test ! -z "$USE_RAND_HELPER" ; then
960 # install rand helper
961 RAND_MSG="ssh-rand-helper"
962 INSTALL_SSH_RAND_HELPER="yes"
964 AC_SUBST(INSTALL_SSH_RAND_HELPER)
966 ### Configuration of ssh-rand-helper
969 AC_ARG_WITH(prngd-port,
970 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
979 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
982 if test ! -z "$withval" ; then
983 PRNGD_PORT="$withval"
984 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
989 # PRNGD Unix domain socket
990 AC_ARG_WITH(prngd-socket,
991 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
995 withval="/var/run/egd-pool"
1003 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1007 if test ! -z "$withval" ; then
1008 if test ! -z "$PRNGD_PORT" ; then
1009 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1011 if test ! -r "$withval" ; then
1012 AC_MSG_WARN(Entropy socket is not readable)
1014 PRNGD_SOCKET="$withval"
1015 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1019 # Check for existing socket only if we don't have a random device already
1020 if test "$USE_RAND_HELPER" = yes ; then
1021 AC_MSG_CHECKING(for PRNGD/EGD socket)
1022 # Insert other locations here
1023 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1024 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1025 PRNGD_SOCKET="$sock"
1026 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1030 if test ! -z "$PRNGD_SOCKET" ; then
1031 AC_MSG_RESULT($PRNGD_SOCKET)
1033 AC_MSG_RESULT(not found)
1039 # Change default command timeout for hashing entropy source
1041 AC_ARG_WITH(entropy-timeout,
1042 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1044 if test "x$withval" != "xno" ; then
1045 entropy_timeout=$withval
1049 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1051 SSH_PRIVSEP_USER=sshd
1052 AC_ARG_WITH(privsep-user,
1053 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1055 if test -n "$withval"; then
1056 SSH_PRIVSEP_USER=$withval
1060 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1061 AC_SUBST(SSH_PRIVSEP_USER)
1063 # We do this little dance with the search path to insure
1064 # that programs that we select for use by installed programs
1065 # (which may be run by the super-user) come from trusted
1066 # locations before they come from the user's private area.
1067 # This should help avoid accidentally configuring some
1068 # random version of a program in someone's personal bin.
1072 test -h /bin 2> /dev/null && PATH=/usr/bin
1073 test -d /sbin && PATH=$PATH:/sbin
1074 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1075 PATH=$PATH:/etc:$OPATH
1077 # These programs are used by the command hashing source to gather entropy
1078 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1079 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1080 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1081 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1082 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1083 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1084 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1085 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1086 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1087 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1088 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1089 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1090 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1091 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1092 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1093 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1097 # Where does ssh-rand-helper get its randomness from?
1098 INSTALL_SSH_PRNG_CMDS=""
1099 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1100 if test ! -z "$PRNGD_PORT" ; then
1101 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1102 elif test ! -z "$PRNGD_SOCKET" ; then
1103 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1105 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1106 RAND_HELPER_CMDHASH=yes
1107 INSTALL_SSH_PRNG_CMDS="yes"
1110 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1113 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1114 if test ! -z "$SONY" ; then
1115 LIBS="$LIBS -liberty";
1118 # Checks for data types
1119 AC_CHECK_SIZEOF(char, 1)
1120 AC_CHECK_SIZEOF(short int, 2)
1121 AC_CHECK_SIZEOF(int, 4)
1122 AC_CHECK_SIZEOF(long int, 4)
1123 AC_CHECK_SIZEOF(long long int, 8)
1125 # Sanity check long long for some platforms (AIX)
1126 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1127 ac_cv_sizeof_long_long_int=0
1130 # More checks for data types
1131 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1133 [ #include <sys/types.h> ],
1135 [ ac_cv_have_u_int="yes" ],
1136 [ ac_cv_have_u_int="no" ]
1139 if test "x$ac_cv_have_u_int" = "xyes" ; then
1140 AC_DEFINE(HAVE_U_INT)
1144 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1146 [ #include <sys/types.h> ],
1147 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1148 [ ac_cv_have_intxx_t="yes" ],
1149 [ ac_cv_have_intxx_t="no" ]
1152 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1153 AC_DEFINE(HAVE_INTXX_T)
1157 if (test -z "$have_intxx_t" && \
1158 test "x$ac_cv_header_stdint_h" = "xyes")
1160 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1162 [ #include <stdint.h> ],
1163 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1165 AC_DEFINE(HAVE_INTXX_T)
1168 [ AC_MSG_RESULT(no) ]
1172 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1174 [ #include <sys/types.h> ],
1175 [ int64_t a; a = 1;],
1176 [ ac_cv_have_int64_t="yes" ],
1177 [ ac_cv_have_int64_t="no" ]
1180 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1181 AC_DEFINE(HAVE_INT64_T)
1185 if test -z "$have_int64_t" ; then
1186 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1188 [ #include <sys/socket.h> ],
1189 [ int64_t a; a = 1],
1191 AC_DEFINE(HAVE_INT64_T)
1194 [ AC_MSG_RESULT(no) ]
1198 if test -z "$have_int64_t" ; then
1199 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1201 [ #include <sys/bitypes.h> ],
1202 [ int64_t a; a = 1],
1204 AC_DEFINE(HAVE_INT64_T)
1207 [ AC_MSG_RESULT(no) ]
1211 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1213 [ #include <sys/types.h> ],
1214 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1215 [ ac_cv_have_u_intxx_t="yes" ],
1216 [ ac_cv_have_u_intxx_t="no" ]
1219 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1220 AC_DEFINE(HAVE_U_INTXX_T)
1224 if test -z "$have_u_intxx_t" ; then
1225 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1227 [ #include <sys/socket.h> ],
1228 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1230 AC_DEFINE(HAVE_U_INTXX_T)
1233 [ AC_MSG_RESULT(no) ]
1237 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1239 [ #include <sys/types.h> ],
1240 [ u_int64_t a; a = 1;],
1241 [ ac_cv_have_u_int64_t="yes" ],
1242 [ ac_cv_have_u_int64_t="no" ]
1245 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1246 AC_DEFINE(HAVE_U_INT64_T)
1250 if test -z "$have_u_int64_t" ; then
1251 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1253 [ #include <sys/bitypes.h> ],
1254 [ u_int64_t a; a = 1],
1256 AC_DEFINE(HAVE_U_INT64_T)
1259 [ AC_MSG_RESULT(no) ]
1263 if test -z "$have_u_intxx_t" ; then
1264 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1267 #include <sys/types.h>
1269 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1270 [ ac_cv_have_uintxx_t="yes" ],
1271 [ ac_cv_have_uintxx_t="no" ]
1274 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1275 AC_DEFINE(HAVE_UINTXX_T)
1279 if test -z "$have_uintxx_t" ; then
1280 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1282 [ #include <stdint.h> ],
1283 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1285 AC_DEFINE(HAVE_UINTXX_T)
1288 [ AC_MSG_RESULT(no) ]
1292 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1293 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1295 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1298 #include <sys/bitypes.h>
1301 int8_t a; int16_t b; int32_t c;
1302 u_int8_t e; u_int16_t f; u_int32_t g;
1303 a = b = c = e = f = g = 1;
1306 AC_DEFINE(HAVE_U_INTXX_T)
1307 AC_DEFINE(HAVE_INTXX_T)
1315 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1318 #include <sys/types.h>
1320 [ u_char foo; foo = 125; ],
1321 [ ac_cv_have_u_char="yes" ],
1322 [ ac_cv_have_u_char="no" ]
1325 if test "x$ac_cv_have_u_char" = "xyes" ; then
1326 AC_DEFINE(HAVE_U_CHAR)
1331 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1333 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1336 #include <sys/types.h>
1338 [ size_t foo; foo = 1235; ],
1339 [ ac_cv_have_size_t="yes" ],
1340 [ ac_cv_have_size_t="no" ]
1343 if test "x$ac_cv_have_size_t" = "xyes" ; then
1344 AC_DEFINE(HAVE_SIZE_T)
1347 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1350 #include <sys/types.h>
1352 [ ssize_t foo; foo = 1235; ],
1353 [ ac_cv_have_ssize_t="yes" ],
1354 [ ac_cv_have_ssize_t="no" ]
1357 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1358 AC_DEFINE(HAVE_SSIZE_T)
1361 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1366 [ clock_t foo; foo = 1235; ],
1367 [ ac_cv_have_clock_t="yes" ],
1368 [ ac_cv_have_clock_t="no" ]
1371 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1372 AC_DEFINE(HAVE_CLOCK_T)
1375 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1378 #include <sys/types.h>
1379 #include <sys/socket.h>
1381 [ sa_family_t foo; foo = 1235; ],
1382 [ ac_cv_have_sa_family_t="yes" ],
1385 #include <sys/types.h>
1386 #include <sys/socket.h>
1387 #include <netinet/in.h>
1389 [ sa_family_t foo; foo = 1235; ],
1390 [ ac_cv_have_sa_family_t="yes" ],
1392 [ ac_cv_have_sa_family_t="no" ]
1396 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1397 AC_DEFINE(HAVE_SA_FAMILY_T)
1400 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1403 #include <sys/types.h>
1405 [ pid_t foo; foo = 1235; ],
1406 [ ac_cv_have_pid_t="yes" ],
1407 [ ac_cv_have_pid_t="no" ]
1410 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1411 AC_DEFINE(HAVE_PID_T)
1414 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1417 #include <sys/types.h>
1419 [ mode_t foo; foo = 1235; ],
1420 [ ac_cv_have_mode_t="yes" ],
1421 [ ac_cv_have_mode_t="no" ]
1424 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1425 AC_DEFINE(HAVE_MODE_T)
1429 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1432 #include <sys/types.h>
1433 #include <sys/socket.h>
1435 [ struct sockaddr_storage s; ],
1436 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1437 [ ac_cv_have_struct_sockaddr_storage="no" ]
1440 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1441 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1444 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1447 #include <sys/types.h>
1448 #include <netinet/in.h>
1450 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1451 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1452 [ ac_cv_have_struct_sockaddr_in6="no" ]
1455 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1456 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1459 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1462 #include <sys/types.h>
1463 #include <netinet/in.h>
1465 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1466 [ ac_cv_have_struct_in6_addr="yes" ],
1467 [ ac_cv_have_struct_in6_addr="no" ]
1470 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1471 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1474 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1477 #include <sys/types.h>
1478 #include <sys/socket.h>
1481 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1482 [ ac_cv_have_struct_addrinfo="yes" ],
1483 [ ac_cv_have_struct_addrinfo="no" ]
1486 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1487 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1490 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1492 [ #include <sys/time.h> ],
1493 [ struct timeval tv; tv.tv_sec = 1;],
1494 [ ac_cv_have_struct_timeval="yes" ],
1495 [ ac_cv_have_struct_timeval="no" ]
1498 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1499 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1500 have_struct_timeval=1
1503 # If we don't have int64_t then we can't compile sftp-server. So don't
1504 # even attempt to do it.
1505 if test "x$ac_cv_have_int64_t" = "xno" -a \
1506 "x$ac_cv_sizeof_long_int" != "x8" -a \
1507 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1510 dnl test snprintf (broken on SCO w/gcc)
1515 #ifdef HAVE_SNPRINTF
1519 char expected_out[50];
1521 #if (SIZEOF_LONG_INT == 8)
1522 long int num = 0x7fffffffffffffff;
1524 long long num = 0x7fffffffffffffffll;
1526 strcpy(expected_out, "9223372036854775807");
1527 snprintf(buf, mazsize, "%lld", num);
1528 if(strcmp(buf, expected_out) != 0)
1535 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1540 dnl Checks for structure members
1541 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1542 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1543 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1544 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1545 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1546 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1547 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1548 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1549 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1550 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1551 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1552 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1553 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1554 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1555 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1556 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1557 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1559 AC_CHECK_MEMBERS([struct stat.st_blksize])
1561 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1562 ac_cv_have_ss_family_in_struct_ss, [
1565 #include <sys/types.h>
1566 #include <sys/socket.h>
1568 [ struct sockaddr_storage s; s.ss_family = 1; ],
1569 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1570 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1573 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1574 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1577 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1578 ac_cv_have___ss_family_in_struct_ss, [
1581 #include <sys/types.h>
1582 #include <sys/socket.h>
1584 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1585 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1586 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1589 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1590 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1593 AC_CACHE_CHECK([for pw_class field in struct passwd],
1594 ac_cv_have_pw_class_in_struct_passwd, [
1599 [ struct passwd p; p.pw_class = 0; ],
1600 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1601 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1604 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1605 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1608 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1609 ac_cv_have_pw_expire_in_struct_passwd, [
1614 [ struct passwd p; p.pw_expire = 0; ],
1615 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1616 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1619 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1620 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1623 AC_CACHE_CHECK([for pw_change field in struct passwd],
1624 ac_cv_have_pw_change_in_struct_passwd, [
1629 [ struct passwd p; p.pw_change = 0; ],
1630 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1631 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1634 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1635 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1638 dnl make sure we're using the real structure members and not defines
1639 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1640 ac_cv_have_accrights_in_msghdr, [
1643 #include <sys/types.h>
1644 #include <sys/socket.h>
1645 #include <sys/uio.h>
1647 #ifdef msg_accrights
1651 m.msg_accrights = 0;
1655 [ ac_cv_have_accrights_in_msghdr="yes" ],
1656 [ ac_cv_have_accrights_in_msghdr="no" ]
1659 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1660 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1663 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1664 ac_cv_have_control_in_msghdr, [
1667 #include <sys/types.h>
1668 #include <sys/socket.h>
1669 #include <sys/uio.h>
1679 [ ac_cv_have_control_in_msghdr="yes" ],
1680 [ ac_cv_have_control_in_msghdr="no" ]
1683 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1684 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1687 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1689 [ extern char *__progname; printf("%s", __progname); ],
1690 [ ac_cv_libc_defines___progname="yes" ],
1691 [ ac_cv_libc_defines___progname="no" ]
1694 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1695 AC_DEFINE(HAVE___PROGNAME)
1698 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1702 [ printf("%s", __FUNCTION__); ],
1703 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1704 [ ac_cv_cc_implements___FUNCTION__="no" ]
1707 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1708 AC_DEFINE(HAVE___FUNCTION__)
1711 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1715 [ printf("%s", __func__); ],
1716 [ ac_cv_cc_implements___func__="yes" ],
1717 [ ac_cv_cc_implements___func__="no" ]
1720 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1721 AC_DEFINE(HAVE___func__)
1724 AC_CACHE_CHECK([whether getopt has optreset support],
1725 ac_cv_have_getopt_optreset, [
1730 [ extern int optreset; optreset = 0; ],
1731 [ ac_cv_have_getopt_optreset="yes" ],
1732 [ ac_cv_have_getopt_optreset="no" ]
1735 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1736 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1739 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1741 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1742 [ ac_cv_libc_defines_sys_errlist="yes" ],
1743 [ ac_cv_libc_defines_sys_errlist="no" ]
1746 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1747 AC_DEFINE(HAVE_SYS_ERRLIST)
1751 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1753 [ extern int sys_nerr; printf("%i", sys_nerr);],
1754 [ ac_cv_libc_defines_sys_nerr="yes" ],
1755 [ ac_cv_libc_defines_sys_nerr="no" ]
1758 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1759 AC_DEFINE(HAVE_SYS_NERR)
1764 # Check whether user wants sectok support
1766 [ --with-sectok Enable smartcard support using libsectok],
1768 if test "x$withval" != "xno" ; then
1769 if test "x$withval" != "xyes" ; then
1770 CPPFLAGS="$CPPFLAGS -I${withval}"
1771 LDFLAGS="$LDFLAGS -L${withval}"
1772 if test ! -z "$need_dash_r" ; then
1773 LDFLAGS="$LDFLAGS -R${withval}"
1775 if test ! -z "$blibpath" ; then
1776 blibpath="$blibpath:${withval}"
1779 AC_CHECK_HEADERS(sectok.h)
1780 if test "$ac_cv_header_sectok_h" != yes; then
1781 AC_MSG_ERROR(Can't find sectok.h)
1783 AC_CHECK_LIB(sectok, sectok_open)
1784 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1785 AC_MSG_ERROR(Can't find libsectok)
1787 AC_DEFINE(SMARTCARD)
1788 AC_DEFINE(USE_SECTOK)
1789 SCARD_MSG="yes, using sectok"
1794 # Check whether user wants OpenSC support
1796 AC_HELP_STRING([--with-opensc=PFX],
1797 [Enable smartcard support using OpenSC]),
1798 opensc_config_prefix="$withval", opensc_config_prefix="")
1799 if test x$opensc_config_prefix != x ; then
1800 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1801 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1802 if test "$OPENSC_CONFIG" != "no"; then
1803 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1804 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1805 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1806 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1807 AC_DEFINE(SMARTCARD)
1808 AC_DEFINE(USE_OPENSC)
1809 SCARD_MSG="yes, using OpenSC"
1813 # Check whether user wants Kerberos 5 support
1815 AC_ARG_WITH(kerberos5,
1816 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1818 if test "x$withval" != "xno" ; then
1819 if test "x$withval" = "xyes" ; then
1820 KRB5ROOT="/usr/local"
1824 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1825 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1828 AC_MSG_CHECKING(whether we are using Heimdal)
1829 AC_TRY_COMPILE([ #include <krb5.h> ],
1830 [ char *tmp = heimdal_version; ],
1831 [ AC_MSG_RESULT(yes)
1833 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1836 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1839 if test ! -z "$need_dash_r" ; then
1840 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1842 if test ! -z "$blibpath" ; then
1843 blibpath="$blibpath:${KRB5ROOT}/lib"
1845 AC_CHECK_LIB(resolv, dn_expand, , )
1847 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1849 K5LIBS="-lgssapi $K5LIBS" ],
1850 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1852 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1853 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1858 AC_CHECK_HEADER(gssapi.h, ,
1859 [ unset ac_cv_header_gssapi_h
1860 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1861 AC_CHECK_HEADERS(gssapi.h, ,
1862 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1868 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1869 AC_CHECK_HEADER(gssapi_krb5.h, ,
1870 [ CPPFLAGS="$oldCPP" ])
1876 # Check whether user wants Kerberos 4 support
1878 AC_ARG_WITH(kerberos4,
1879 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1881 if test "x$withval" != "xno" ; then
1882 if test "x$withval" != "xyes" ; then
1883 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1884 LDFLAGS="$LDFLAGS -L${withval}/lib"
1885 if test ! -z "$need_dash_r" ; then
1886 LDFLAGS="$LDFLAGS -R${withval}/lib"
1888 if test ! -z "$blibpath" ; then
1889 blibpath="$blibpath:${withval}/lib"
1892 if test -d /usr/include/kerberosIV ; then
1893 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1897 AC_CHECK_HEADERS(krb.h)
1898 if test "$ac_cv_header_krb_h" != yes; then
1899 AC_MSG_WARN([Cannot find krb.h, build may fail])
1901 AC_CHECK_LIB(krb, main)
1902 if test "$ac_cv_lib_krb_main" != yes; then
1903 AC_CHECK_LIB(krb4, main)
1904 if test "$ac_cv_lib_krb4_main" != yes; then
1905 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1912 AC_CHECK_LIB(des, des_cbc_encrypt)
1913 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1914 AC_CHECK_LIB(des425, des_cbc_encrypt)
1915 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1916 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1923 AC_CHECK_LIB(resolv, dn_expand, , )
1931 # Check whether user wants AFS support
1934 [ --with-afs=PATH Enable AFS support],
1936 if test "x$withval" != "xno" ; then
1938 if test "x$withval" != "xyes" ; then
1939 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1940 LDFLAGS="$LDFLAGS -L${withval}/lib"
1943 if test -z "$KRB4" ; then
1944 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1948 if test ! -z "$AFS_LIBS" ; then
1949 LIBS="$LIBS $AFS_LIBS"
1956 LIBS="$LIBS $KLIBS $K5LIBS"
1958 # Looking for programs, paths and files
1960 PRIVSEP_PATH=/var/empty
1961 AC_ARG_WITH(privsep-path,
1962 [ --with-privsep-path=xxx Path for privilege separation chroot ],
1964 if test "x$withval" != "$no" ; then
1965 PRIVSEP_PATH=$withval
1969 AC_SUBST(PRIVSEP_PATH)
1972 [ --with-xauth=PATH Specify path to xauth program ],
1974 if test "x$withval" != "xno" ; then
1979 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1980 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1981 xauth_path="/usr/openwin/bin/xauth"
1986 if test -z "$xauth_path" ; then
1987 XAUTH_PATH="undefined"
1988 AC_SUBST(XAUTH_PATH)
1990 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1991 XAUTH_PATH=$xauth_path
1992 AC_SUBST(XAUTH_PATH)
1995 # Check for mail directory (last resort if we cannot get it from headers)
1996 if test ! -z "$MAIL" ; then
1997 maildir=`dirname $MAIL`
1998 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2001 if test -z "$no_dev_ptmx" ; then
2002 if test "x$disable_ptmx_check" != "xyes" ; then
2003 AC_CHECK_FILE("/dev/ptmx",
2005 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2011 AC_CHECK_FILE("/dev/ptc",
2013 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2018 # Options from here on. Some of these are preset by platform above
2019 AC_ARG_WITH(mantype,
2020 [ --with-mantype=man|cat|doc Set man page type],
2027 AC_MSG_ERROR(invalid man type: $withval)
2032 if test -z "$MANTYPE"; then
2033 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
2034 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2036 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2043 if test "$MANTYPE" = "doc"; then
2050 # Check whether to enable MD5 passwords
2052 AC_ARG_WITH(md5-passwords,
2053 [ --with-md5-passwords Enable use of MD5 passwords],
2055 if test "x$withval" != "xno" ; then
2056 AC_DEFINE(HAVE_MD5_PASSWORDS)
2062 # Whether to disable shadow password support
2064 [ --without-shadow Disable shadow password support],
2066 if test "x$withval" = "xno" ; then
2067 AC_DEFINE(DISABLE_SHADOW)
2073 if test -z "$disable_shadow" ; then
2074 AC_MSG_CHECKING([if the systems has expire shadow information])
2077 #include <sys/types.h>
2080 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2081 [ sp_expire_available=yes ], []
2084 if test "x$sp_expire_available" = "xyes" ; then
2086 AC_DEFINE(HAS_SHADOW_EXPIRE)
2092 # Use ip address instead of hostname in $DISPLAY
2093 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2094 DISPLAY_HACK_MSG="yes"
2095 AC_DEFINE(IPADDR_IN_DISPLAY)
2097 DISPLAY_HACK_MSG="no"
2098 AC_ARG_WITH(ipaddr-display,
2099 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2101 if test "x$withval" != "xno" ; then
2102 AC_DEFINE(IPADDR_IN_DISPLAY)
2103 DISPLAY_HACK_MSG="yes"
2109 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2110 if test $ac_cv_func_login_getcapbool = "yes" -a \
2111 $ac_cv_header_login_cap_h = "yes" ; then
2114 # Whether to mess with the default path
2115 SERVER_PATH_MSG="(default)"
2116 AC_ARG_WITH(default-path,
2117 [ --with-default-path= Specify default \$PATH environment for server],
2119 if test "$USES_LOGIN_CONF" = "yes" ; then
2121 --with-default-path=PATH has no effect on this system.
2122 Edit /etc/login.conf instead.])
2123 elif test "x$withval" != "xno" ; then
2124 user_path="$withval"
2125 SERVER_PATH_MSG="$withval"
2128 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2129 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2133 /* find out what STDPATH is */
2138 #ifndef _PATH_STDPATH
2139 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2141 #include <sys/types.h>
2142 #include <sys/stat.h>
2144 #define DATA "conftest.stdpath"
2151 fd = fopen(DATA,"w");
2155 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2160 ], [ user_path=`cat conftest.stdpath` ],
2161 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2162 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2164 # make sure $bindir is in USER_PATH so scp will work
2165 t_bindir=`eval echo ${bindir}`
2167 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2170 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2172 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2173 if test $? -ne 0 ; then
2174 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2175 if test $? -ne 0 ; then
2176 user_path=$user_path:$t_bindir
2177 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2182 if test "$USES_LOGIN_CONF" != "yes" ; then
2183 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2187 # Set superuser path separately to user path
2188 AC_ARG_WITH(superuser-path,
2189 [ --with-superuser-path= Specify different path for super-user],
2191 if test "x$withval" != "xno" ; then
2192 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2193 superuser_path=$withval
2199 # Whether to force IPv4 by default (needed on broken glibc Linux)
2201 AC_ARG_WITH(ipv4-default,
2202 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2204 if test "x$withval" != "xno" ; then
2205 AC_DEFINE(IPV4_DEFAULT)
2211 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2212 IPV4_IN6_HACK_MSG="no"
2214 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2216 if test "x$withval" != "xno" ; then
2218 AC_DEFINE(IPV4_IN_IPV6)
2219 IPV4_IN6_HACK_MSG="yes"
2224 if test "x$inet6_default_4in6" = "xyes"; then
2225 AC_MSG_RESULT([yes (default)])
2226 AC_DEFINE(IPV4_IN_IPV6)
2227 IPV4_IN6_HACK_MSG="yes"
2229 AC_MSG_RESULT([no (default)])
2234 # Whether to enable BSD auth support
2236 AC_ARG_WITH(bsd-auth,
2237 [ --with-bsd-auth Enable BSD auth support],
2239 if test "x$withval" != "xno" ; then
2246 # Where to place sshd.pid
2248 # make sure the directory exists
2249 if test ! -d $piddir ; then
2250 piddir=`eval echo ${sysconfdir}`
2252 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2256 AC_ARG_WITH(pid-dir,
2257 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2259 if test "x$withval" != "xno" ; then
2261 if test ! -d $piddir ; then
2262 AC_MSG_WARN([** no $piddir directory on this system **])
2268 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2271 dnl allow user to disable some login recording features
2272 AC_ARG_ENABLE(lastlog,
2273 [ --disable-lastlog disable use of lastlog even if detected [no]],
2274 [ AC_DEFINE(DISABLE_LASTLOG) ]
2277 [ --disable-utmp disable use of utmp even if detected [no]],
2278 [ AC_DEFINE(DISABLE_UTMP) ]
2280 AC_ARG_ENABLE(utmpx,
2281 [ --disable-utmpx disable use of utmpx even if detected [no]],
2282 [ AC_DEFINE(DISABLE_UTMPX) ]
2285 [ --disable-wtmp disable use of wtmp even if detected [no]],
2286 [ AC_DEFINE(DISABLE_WTMP) ]
2288 AC_ARG_ENABLE(wtmpx,
2289 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2290 [ AC_DEFINE(DISABLE_WTMPX) ]
2292 AC_ARG_ENABLE(libutil,
2293 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2294 [ AC_DEFINE(DISABLE_LOGIN) ]
2296 AC_ARG_ENABLE(pututline,
2297 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2298 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2300 AC_ARG_ENABLE(pututxline,
2301 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2302 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2304 AC_ARG_WITH(lastlog,
2305 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2307 if test "x$withval" = "xno" ; then
2308 AC_DEFINE(DISABLE_LASTLOG)
2310 conf_lastlog_location=$withval
2315 dnl lastlog, [uw]tmpx? detection
2316 dnl NOTE: set the paths in the platform section to avoid the
2317 dnl need for command-line parameters
2318 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2320 dnl lastlog detection
2321 dnl NOTE: the code itself will detect if lastlog is a directory
2322 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2324 #include <sys/types.h>
2326 #ifdef HAVE_LASTLOG_H
2327 # include <lastlog.h>
2336 [ char *lastlog = LASTLOG_FILE; ],
2337 [ AC_MSG_RESULT(yes) ],
2340 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2342 #include <sys/types.h>
2344 #ifdef HAVE_LASTLOG_H
2345 # include <lastlog.h>
2351 [ char *lastlog = _PATH_LASTLOG; ],
2352 [ AC_MSG_RESULT(yes) ],
2355 system_lastlog_path=no
2360 if test -z "$conf_lastlog_location"; then
2361 if test x"$system_lastlog_path" = x"no" ; then
2362 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2363 if (test -d "$f" || test -f "$f") ; then
2364 conf_lastlog_location=$f
2367 if test -z "$conf_lastlog_location"; then
2368 AC_MSG_WARN([** Cannot find lastlog **])
2369 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2374 if test -n "$conf_lastlog_location"; then
2375 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2379 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2381 #include <sys/types.h>
2387 [ char *utmp = UTMP_FILE; ],
2388 [ AC_MSG_RESULT(yes) ],
2390 system_utmp_path=no ]
2392 if test -z "$conf_utmp_location"; then
2393 if test x"$system_utmp_path" = x"no" ; then
2394 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2395 if test -f $f ; then
2396 conf_utmp_location=$f
2399 if test -z "$conf_utmp_location"; then
2400 AC_DEFINE(DISABLE_UTMP)
2404 if test -n "$conf_utmp_location"; then
2405 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2409 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2411 #include <sys/types.h>
2417 [ char *wtmp = WTMP_FILE; ],
2418 [ AC_MSG_RESULT(yes) ],
2420 system_wtmp_path=no ]
2422 if test -z "$conf_wtmp_location"; then
2423 if test x"$system_wtmp_path" = x"no" ; then
2424 for f in /usr/adm/wtmp /var/log/wtmp; do
2425 if test -f $f ; then
2426 conf_wtmp_location=$f
2429 if test -z "$conf_wtmp_location"; then
2430 AC_DEFINE(DISABLE_WTMP)
2434 if test -n "$conf_wtmp_location"; then
2435 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2439 dnl utmpx detection - I don't know any system so perverse as to require
2440 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2442 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2444 #include <sys/types.h>
2453 [ char *utmpx = UTMPX_FILE; ],
2454 [ AC_MSG_RESULT(yes) ],
2456 system_utmpx_path=no ]
2458 if test -z "$conf_utmpx_location"; then
2459 if test x"$system_utmpx_path" = x"no" ; then
2460 AC_DEFINE(DISABLE_UTMPX)
2463 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2467 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2469 #include <sys/types.h>
2478 [ char *wtmpx = WTMPX_FILE; ],
2479 [ AC_MSG_RESULT(yes) ],
2481 system_wtmpx_path=no ]
2483 if test -z "$conf_wtmpx_location"; then
2484 if test x"$system_wtmpx_path" = x"no" ; then
2485 AC_DEFINE(DISABLE_WTMPX)
2488 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2492 if test ! -z "$blibpath" ; then
2493 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2494 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2497 dnl remove pam and dl because they are in $LIBPAM
2498 if test "$PAM_MSG" = yes ; then
2499 LIBS=`echo $LIBS | sed 's/-lpam //'`
2501 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2502 LIBS=`echo $LIBS | sed 's/-ldl //'`
2506 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2509 # Print summary of options
2511 # Someone please show me a better way :)
2512 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2513 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2514 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2515 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2516 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2517 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2518 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2519 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2520 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2521 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2524 echo "OpenSSH has been configured with the following options:"
2525 echo " User binaries: $B"
2526 echo " System binaries: $C"
2527 echo " Configuration files: $D"
2528 echo " Askpass program: $E"
2529 echo " Manual pages: $F"
2530 echo " PID file: $G"
2531 echo " Privilege separation chroot path: $H"
2532 if test "$USES_LOGIN_CONF" = "yes" ; then
2533 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2535 echo " sshd default user PATH: $I"
2537 if test ! -z "$superuser_path" ; then
2538 echo " sshd superuser user PATH: $J"
2540 echo " Manpage format: $MANTYPE"
2541 echo " PAM support: ${PAM_MSG}"
2542 echo " KerberosIV support: $KRB4_MSG"
2543 echo " KerberosV support: $KRB5_MSG"
2544 echo " Smartcard support: $SCARD_MSG"
2545 echo " AFS support: $AFS_MSG"
2546 echo " S/KEY support: $SKEY_MSG"
2547 echo " TCP Wrappers support: $TCPW_MSG"
2548 echo " MD5 password support: $MD5_MSG"
2549 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2550 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2551 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2552 echo " BSD Auth support: $BSD_AUTH_MSG"
2553 echo " Random number source: $RAND_MSG"
2554 if test ! -z "$USE_RAND_HELPER" ; then
2555 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2560 echo " Host: ${host}"
2561 echo " Compiler: ${CC}"
2562 echo " Compiler flags: ${CFLAGS}"
2563 echo "Preprocessor flags: ${CPPFLAGS}"
2564 echo " Linker flags: ${LDFLAGS}"
2565 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2569 if test "x$PAM_MSG" = "xyes" ; then
2570 echo "PAM is enabled. You may need to install a PAM control file "
2571 echo "for sshd, otherwise password authentication may fail. "
2572 echo "Example PAM control files can be found in the contrib/ "
2577 if test ! -z "$NO_SFTP"; then
2578 echo "sftp-server will be disabled. Your compiler does not "
2579 echo "support 64bit integers."
2583 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2584 echo "WARNING: you are using the builtin random number collection "
2585 echo "service. Please read WARNING.RNG and request that your OS "
2586 echo "vendor includes kernel-based random number collection in "
2587 echo "future versions of your OS."