5 AC_CONFIG_HEADER(config.h)
10 # Checks for programs.
15 AC_PATH_PROGS(PERL, perl5 perl)
17 AC_PATH_PROG(ENT, ent)
19 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
20 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
21 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
24 if test -z "$AR" ; then
25 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
28 # Use LOGIN_PROGRAM from environment if possible
29 if test ! -z "$LOGIN_PROGRAM" ; then
30 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
33 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
34 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
39 if test -z "$LD" ; then
46 if test "$GCC" = "yes"; then
47 CFLAGS="$CFLAGS -Wall"
50 # Check for some target-specific stuff
54 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
55 LDFLAGS="$LDFLAGS -L/usr/local/lib"
56 if (test "$LD" != "gcc" && test -z "$blibpath"); then
57 blibpath="/usr/lib:/lib:/usr/local/lib"
59 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
60 AC_DEFINE(BROKEN_GETADDRINFO)
61 dnl AIX handles lastlog as part of its login message
62 AC_DEFINE(DISABLE_LASTLOG)
65 LIBS="$LIBS -lregex /usr/lib/textmode.o"
66 AC_DEFINE(HAVE_CYGWIN)
67 AC_DEFINE(DISABLE_SHADOW)
68 AC_DEFINE(IPV4_DEFAULT)
69 AC_DEFINE(IP_TOS_IS_BROKEN)
70 AC_DEFINE(NO_X11_UNIX_SOCKETS)
75 AC_DEFINE(IP_TOS_IS_BROKEN)
78 if test -z "$GCC"; then
81 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
84 AC_DEFINE(DISABLE_SHADOW)
85 AC_DEFINE(DISABLE_UTMP)
86 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
90 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
92 AC_DEFINE(PAM_SUN_CODEBASE)
94 AC_DEFINE(DISABLE_SHADOW)
95 AC_DEFINE(DISABLE_UTMP)
96 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
100 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
102 PATH="$PATH:/usr/etc"
105 AC_DEFINE(BROKEN_INET_NTOA)
108 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
110 PATH="$PATH:/usr/etc"
111 AC_DEFINE(WITH_IRIX_ARRAY)
112 AC_DEFINE(WITH_IRIX_PROJECT)
113 AC_DEFINE(WITH_IRIX_AUDIT)
114 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
117 AC_DEFINE(BROKEN_INET_NTOA)
121 check_for_libcrypt_later=1
122 AC_DEFINE(DONT_TRY_OTHER_AF)
123 AC_DEFINE(PAM_TTY_KLUDGE)
124 inet6_default_4in6=yes
126 mips-sony-bsd|mips-sony-newsos4)
127 AC_DEFINE(HAVE_NEWS4)
129 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
130 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
137 check_for_libcrypt_later=1
140 conf_lastlog_location="/usr/adm/lastlog"
141 conf_utmp_location=/etc/utmp
142 conf_wtmp_location=/usr/adm/wtmp
145 AC_DEFINE(BROKEN_REALPATH)
147 AC_DEFINE(BROKEN_SAVED_UIDS)
148 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
152 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
153 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
155 AC_DEFINE(PAM_SUN_CODEBASE)
156 AC_DEFINE(LOGIN_NEEDS_UTMPX)
157 AC_DEFINE(LOGIN_NEEDS_TERM)
158 # hardwire lastlog location (can't detect it on some versions)
159 conf_lastlog_location="/var/adm/lastlog"
160 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
161 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
162 if test "$sol2ver" -ge 8; then
164 AC_DEFINE(DISABLE_UTMP)
165 AC_DEFINE(DISABLE_WTMP)
171 CPPFLAGS="$CPPFLAGS -DSUNOS4"
172 AC_CHECK_FUNCS(getpwanam)
173 AC_DEFINE(PAM_SUN_CODEBASE)
174 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
175 conf_utmp_location=/etc/utmp
176 conf_wtmp_location=/var/adm/wtmp
177 conf_lastlog_location=/var/adm/lastlog
181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
182 LDFLAGS="$LDFLAGS -L/usr/local/lib"
183 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
184 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
187 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
188 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
189 IPADDR_IN_DISPLAY=yes
191 AC_DEFINE(IP_TOS_IS_BROKEN)
192 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
193 LIBS="$LIBS -lgen -lnsl -lucb"
196 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
197 LDFLAGS="$LDFLAGS -L/usr/local/lib"
202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
209 LDFLAGS="$LDFLAGS -L/usr/local/lib"
210 LIBS="$LIBS -lgen -lsocket"
213 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
214 LDFLAGS="$LDFLAGS -L/usr/local/lib"
215 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
216 rsh_path="/usr/bin/rcmd"
219 AC_DEFINE(BROKEN_SYS_TERMIO_H)
221 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
222 AC_DEFINE(DISABLE_SHADOW)
223 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
224 AC_DEFINE(BROKEN_SAVED_UIDS)
225 AC_CHECK_FUNCS(getluid setluid)
229 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
230 LDFLAGS="$LDFLAGS -L/usr/local/lib"
231 LIBS="$LIBS -lprot -lx -ltinfo -lm"
233 rsh_path="/usr/bin/rcmd"
235 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
236 AC_DEFINE(DISABLE_SHADOW)
237 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
238 AC_CHECK_FUNCS(getluid setluid)
242 if test ! -z "$USE_SIA" ; then
243 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
244 if test -f /etc/sia/matrix.conf; then
246 AC_DEFINE(HAVE_OSF_SIA)
247 AC_DEFINE(DISABLE_LOGIN)
248 LIBS="$LIBS -lsecurity -ldb -lm -laud"
256 # Allow user to specify flags
258 [ --with-cflags Specify additional flags to pass to compiler],
260 if test "x$withval" != "xno" ; then
261 CFLAGS="$CFLAGS $withval"
265 AC_ARG_WITH(cppflags,
266 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
268 if test "x$withval" != "xno"; then
269 CPPFLAGS="$CPPFLAGS $withval"
274 [ --with-ldflags Specify additional flags to pass to linker],
276 if test "x$withval" != "xno" ; then
277 LDFLAGS="$LDFLAGS $withval"
282 [ --with-libs Specify additional libraries to link with],
284 if test "x$withval" != "xno" ; then
285 LIBS="$LIBS $withval"
291 [ --with-pcre Override built in regex library with pcre],
294 AC_CHECK_LIB(pcre, pcre_info,
296 AC_DEFINE(HAVE_LIBPCRE)
297 LIBS="$LIBS -lpcreposix -lpcre"
300 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
305 # Checks for libraries.
306 if test -z "$no_libnsl" ; then
307 AC_CHECK_LIB(nsl, yp_match, , )
309 if test -z "$no_libsocket" ; then
310 AC_CHECK_LIB(socket, main, , )
313 dnl SCO OS3 needs this for libwrap
314 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
316 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
317 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
318 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
320 # We don't want to check if we did an pcre override.
321 if test -z "$no_comp_check" ; then
322 AC_CHECK_FUNC(regcomp,
323 [ AC_DEFINE(HAVE_REGCOMP)],
325 AC_CHECK_LIB(pcre, pcre_info,
327 AC_DEFINE(HAVE_LIBPCRE)
328 LIBS="$LIBS -lpcreposix -lpcre"
331 AC_MSG_ERROR([*** No regex library found.])
338 AC_CHECK_FUNC(strcasecmp,
339 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
341 AC_CHECK_FUNC(utimes,
342 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
347 # Checks for header files.
348 AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h getopt.h glob.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h regex.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
350 # Check for ALTDIRFUNC glob() extension
351 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
352 AC_EGREP_CPP(FOUNDIT,
355 #ifdef GLOB_ALTDIRFUNC
360 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
368 # Check for g.gl_matchc glob() extension
369 AC_MSG_CHECKING(for gl_matchc field in glob_t)
370 AC_EGREP_CPP(FOUNDIT,
373 int main(void){glob_t g; g.gl_matchc = 1;}
376 AC_DEFINE(GLOB_HAS_GL_MATCHC)
384 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
387 #include <sys/types.h>
389 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
391 [AC_MSG_RESULT(yes)],
394 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
398 # Check whether user wants S/Key support
401 [ --with-skey=PATH Enable S/Key support],
403 if test "x$withval" != "xno" ; then
405 if test "x$withval" != "xyes" ; then
406 CPPFLAGS="$CPPFLAGS -I${withval}/include"
407 LDFLAGS="$LDFLAGS -L${withval}/lib"
414 AC_CHECK_FUNC(skey_keyinfo,
417 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
423 # Check whether user wants TCP wrappers support
425 AC_ARG_WITH(tcp-wrappers,
426 [ --with-tcp-wrappers Enable tcpwrappers support],
428 if test "x$withval" != "xno" ; then
431 AC_MSG_CHECKING(for libwrap)
435 int deny_severity = 0, allow_severity = 0;
444 AC_MSG_ERROR([*** libwrap missing])
451 dnl Checks for library functions.
452 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent getusershell glob inet_aton inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv setegid seteuid setlogin setproctitle setresgid setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
453 dnl Checks for time functions
454 AC_CHECK_FUNCS(gettimeofday time)
455 dnl Checks for libutil functions
456 AC_CHECK_HEADERS(libutil.h)
457 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
458 dnl Checks for utmp functions
459 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
460 AC_CHECK_FUNCS(utmpname)
461 dnl Checks for utmpx functions
462 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
463 AC_CHECK_FUNCS(setutxent utmpxname)
465 AC_CHECK_FUNC(getuserattr,
466 [AC_DEFINE(HAVE_GETUSERATTR)],
467 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
471 [AC_DEFINE(HAVE_LOGIN)],
472 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
475 AC_CHECK_FUNC(daemon,
476 [AC_DEFINE(HAVE_DAEMON)],
477 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
480 AC_CHECK_FUNC(getpagesize,
481 [AC_DEFINE(HAVE_GETPAGESIZE)],
482 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
485 # Check for broken snprintf
486 if test "x$ac_cv_func_snprintf" = "xyes" ; then
487 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
491 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
493 [AC_MSG_RESULT(yes)],
496 AC_DEFINE(BROKEN_SNPRINTF)
497 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
507 [ --with-pam Enable PAM support ],
509 if test "x$withval" != "xno" ; then
510 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
511 AC_MSG_ERROR([PAM headers not found])
514 AC_CHECK_LIB(dl, dlopen, , )
515 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
516 AC_CHECK_FUNCS(pam_getenvlist)
526 # Check for older PAM
527 if test "x$PAM_MSG" = "xyes" ; then
528 # Check PAM strerror arguments (old PAM)
529 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
533 #include <security/pam_appl.h>
535 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
538 AC_DEFINE(HAVE_OLD_PAM)
540 PAM_MSG="yes (old library)"
545 # The big search for OpenSSL
547 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
549 if test "x$withval" != "xno" ; then
556 saved_LDFLAGS="$LDFLAGS"
557 saved_CPPFLAGS="$CPPFLAGS"
558 if test "x$prefix" != "xNONE" ; then
559 tryssldir="$tryssldir $prefix"
561 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
562 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
563 CPPFLAGS="$saved_CPPFLAGS"
564 LDFLAGS="$saved_LDFLAGS"
565 LIBS="$saved_LIBS -lcrypto"
567 # Skip directories if they don't exist
568 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
571 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
572 # Try to use $ssldir/lib if it exists, otherwise
574 if test -d "$ssldir/lib" ; then
575 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
576 if test ! -z "$need_dash_r" ; then
577 LDFLAGS="-R$ssldir/lib $LDFLAGS"
580 LDFLAGS="-L$ssldir $saved_LDFLAGS"
581 if test ! -z "$need_dash_r" ; then
582 LDFLAGS="-R$ssldir $LDFLAGS"
585 # Try to use $ssldir/include if it exists, otherwise
587 if test -d "$ssldir/include" ; then
588 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
590 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
594 # Basic test to check for compatible version and correct linking
595 # *does not* test for RSA - that comes later.
599 #include <openssl/rand.h>
603 memset(a, 0, sizeof(a));
604 RAND_add(a, sizeof(a), sizeof(a));
605 return(RAND_status() <= 0);
614 if test ! -z "$found_crypto" ; then
619 if test -z "$found_crypto" ; then
620 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
622 if test -z "$ssldir" ; then
626 ac_cv_openssldir=$ssldir
629 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
630 AC_DEFINE(HAVE_OPENSSL)
631 dnl Need to recover ssldir - test above runs in subshell
632 ssldir=$ac_cv_openssldir
633 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
634 # Try to use $ssldir/lib if it exists, otherwise
636 if test -d "$ssldir/lib" ; then
637 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
638 if test ! -z "$need_dash_r" ; then
639 LDFLAGS="-R$ssldir/lib $LDFLAGS"
642 LDFLAGS="-L$ssldir $saved_LDFLAGS"
643 if test ! -z "$need_dash_r" ; then
644 LDFLAGS="-R$ssldir $LDFLAGS"
647 # Try to use $ssldir/include if it exists, otherwise
649 if test -d "$ssldir/include" ; then
650 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
652 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
656 LIBS="$saved_LIBS -lcrypto"
658 # Now test RSA support
660 AC_MSG_CHECKING([for RSA support])
661 for WANTS_RSAREF in "" 1 ; do
662 if test -z "$WANTS_RSAREF" ; then
665 LIBS="$saved_LIBS -lRSAglue -lrsaref"
669 #include <openssl/rand.h>
670 #include <openssl/rsa.h>
671 #include <openssl/bn.h>
672 #include <openssl/sha.h>
675 int num; RSA *key; static unsigned char p_in[] = "blahblah";
676 unsigned char c[256], p[256];
677 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
678 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
679 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
680 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
689 if test ! -z "$no_rsa" ; then
690 AC_MSG_RESULT(disabled)
693 if test -z "$rsa_works" ; then
694 AC_MSG_WARN([*** No RSA support found *** ])
697 if test -z "$WANTS_RSAREF" ; then
701 RSA_MSG="yes (using RSAref)"
702 AC_MSG_RESULT(using RSAref)
703 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
708 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
709 # version in OpenSSL. Skip this for PAM
710 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
711 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
714 # Cheap hack to ensure NEWS-OS libraries are arranged right.
715 if test ! -z "$SONY" ; then
716 LIBS="$LIBS -liberty";
719 # Checks for data types
720 AC_CHECK_SIZEOF(char, 1)
721 AC_CHECK_SIZEOF(short int, 2)
722 AC_CHECK_SIZEOF(int, 4)
723 AC_CHECK_SIZEOF(long int, 4)
724 AC_CHECK_SIZEOF(long long int, 8)
726 # More checks for data types
727 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
729 [ #include <sys/types.h> ],
731 [ ac_cv_have_u_int="yes" ],
732 [ ac_cv_have_u_int="no" ]
735 if test "x$ac_cv_have_u_int" = "xyes" ; then
736 AC_DEFINE(HAVE_U_INT)
740 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
742 [ #include <sys/types.h> ],
743 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
744 [ ac_cv_have_intxx_t="yes" ],
745 [ ac_cv_have_intxx_t="no" ]
748 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
749 AC_DEFINE(HAVE_INTXX_T)
753 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
755 [ #include <sys/types.h> ],
756 [ int64_t a; a = 1;],
757 [ ac_cv_have_int64_t="yes" ],
758 [ ac_cv_have_int64_t="no" ]
761 if test "x$ac_cv_have_int64_t" = "xyes" ; then
762 AC_DEFINE(HAVE_INT64_T)
766 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
768 [ #include <sys/types.h> ],
769 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
770 [ ac_cv_have_u_intxx_t="yes" ],
771 [ ac_cv_have_u_intxx_t="no" ]
774 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
775 AC_DEFINE(HAVE_U_INTXX_T)
779 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
781 [ #include <sys/types.h> ],
782 [ u_int64_t a; a = 1;],
783 [ ac_cv_have_u_int64_t="yes" ],
784 [ ac_cv_have_u_int64_t="no" ]
787 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
788 AC_DEFINE(HAVE_U_INT64_T)
792 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
793 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
795 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
798 #include <sys/bitypes.h>
801 int8_t a; int16_t b; int32_t c;
802 u_int8_t e; u_int16_t f; u_int32_t g;
803 a = b = c = e = f = g = 1;
806 AC_DEFINE(HAVE_U_INTXX_T)
807 AC_DEFINE(HAVE_INTXX_T)
814 if test -z "$have_u_intxx_t" ; then
815 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
818 #include <sys/types.h>
820 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
821 [ ac_cv_have_uintxx_t="yes" ],
822 [ ac_cv_have_uintxx_t="no" ]
825 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
826 AC_DEFINE(HAVE_UINTXX_T)
830 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
833 #include <sys/types.h>
834 #include <sys/socket.h>
836 [socklen_t foo; foo = 1235;],
837 [ ac_cv_have_socklen_t="yes" ],
838 [ ac_cv_have_socklen_t="no" ]
841 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
842 AC_DEFINE(HAVE_SOCKLEN_T)
845 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
848 #include <sys/types.h>
850 [ size_t foo; foo = 1235; ],
851 [ ac_cv_have_size_t="yes" ],
852 [ ac_cv_have_size_t="no" ]
855 if test "x$ac_cv_have_size_t" = "xyes" ; then
856 AC_DEFINE(HAVE_SIZE_T)
859 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
862 #include <sys/types.h>
864 [ ssize_t foo; foo = 1235; ],
865 [ ac_cv_have_ssize_t="yes" ],
866 [ ac_cv_have_ssize_t="no" ]
869 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
870 AC_DEFINE(HAVE_SSIZE_T)
873 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
878 [ clock_t foo; foo = 1235; ],
879 [ ac_cv_have_clock_t="yes" ],
880 [ ac_cv_have_clock_t="no" ]
883 if test "x$ac_cv_have_clock_t" = "xyes" ; then
884 AC_DEFINE(HAVE_CLOCK_T)
887 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
890 #include <sys/types.h>
891 #include <sys/socket.h>
893 [ sa_family_t foo; foo = 1235; ],
894 [ ac_cv_have_sa_family_t="yes" ],
897 #include <sys/types.h>
898 #include <sys/socket.h>
899 #include <netinet/in.h>
901 [ sa_family_t foo; foo = 1235; ],
902 [ ac_cv_have_sa_family_t="yes" ],
904 [ ac_cv_have_sa_family_t="no" ]
908 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
909 AC_DEFINE(HAVE_SA_FAMILY_T)
912 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
915 #include <sys/types.h>
917 [ pid_t foo; foo = 1235; ],
918 [ ac_cv_have_pid_t="yes" ],
919 [ ac_cv_have_pid_t="no" ]
922 if test "x$ac_cv_have_pid_t" = "xyes" ; then
923 AC_DEFINE(HAVE_PID_T)
926 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
929 #include <sys/types.h>
931 [ mode_t foo; foo = 1235; ],
932 [ ac_cv_have_mode_t="yes" ],
933 [ ac_cv_have_mode_t="no" ]
936 if test "x$ac_cv_have_mode_t" = "xyes" ; then
937 AC_DEFINE(HAVE_MODE_T)
941 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
944 #include <sys/types.h>
945 #include <sys/socket.h>
947 [ struct sockaddr_storage s; ],
948 [ ac_cv_have_struct_sockaddr_storage="yes" ],
949 [ ac_cv_have_struct_sockaddr_storage="no" ]
952 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
953 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
956 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
959 #include <sys/types.h>
960 #include <netinet/in.h>
962 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
963 [ ac_cv_have_struct_sockaddr_in6="yes" ],
964 [ ac_cv_have_struct_sockaddr_in6="no" ]
967 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
968 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
971 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
974 #include <sys/types.h>
975 #include <netinet/in.h>
977 [ struct in6_addr s; s.s6_addr[0] = 0; ],
978 [ ac_cv_have_struct_in6_addr="yes" ],
979 [ ac_cv_have_struct_in6_addr="no" ]
982 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
983 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
986 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
989 #include <sys/types.h>
990 #include <sys/socket.h>
993 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
994 [ ac_cv_have_struct_addrinfo="yes" ],
995 [ ac_cv_have_struct_addrinfo="no" ]
998 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
999 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1002 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1004 [ #include <sys/time.h> ],
1005 [ struct timeval tv; tv.tv_sec = 1;],
1006 [ ac_cv_have_struct_timeval="yes" ],
1007 [ ac_cv_have_struct_timeval="no" ]
1010 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1011 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1012 have_struct_timeval=1
1015 # If we don't have int64_t then we can't compile sftp-server. So don't
1016 # even attempt to do it.
1017 if test "x$ac_cv_have_int64_t" = "xno" -a \
1018 "x$ac_cv_sizeof_long_int" != "x8" -a \
1019 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1022 dnl test snprintf (broken on SCO w/gcc)
1027 #ifdef HAVE_SNPRINTF
1031 char expected_out[50];
1033 #if (SIZEOF_LONG_INT == 8)
1034 long int num = 0x7fffffffffffffff;
1036 long long num = 0x7fffffffffffffff;
1038 strcpy(expected_out, "9223372036854775807");
1039 snprintf(buf, mazsize, "%lld", num);
1040 if(strcmp(buf, expected_out) != 0)
1047 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1052 dnl Checks for structure members
1053 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1054 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1055 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1056 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1057 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1058 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1059 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1060 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1061 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1062 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1063 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1064 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1065 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1066 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1067 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1068 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1069 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1070 AC_STRUCT_ST_BLKSIZE
1072 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1073 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1076 #include <sys/types.h>
1077 #include <sys/socket.h>
1079 [ struct sockaddr_un s; s.sun_len = 1; ],
1080 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1081 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1084 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1085 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1088 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1089 ac_cv_have_ss_family_in_struct_ss, [
1092 #include <sys/types.h>
1093 #include <sys/socket.h>
1095 [ struct sockaddr_storage s; s.ss_family = 1; ],
1096 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1097 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1100 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1101 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1104 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1105 ac_cv_have___ss_family_in_struct_ss, [
1108 #include <sys/types.h>
1109 #include <sys/socket.h>
1111 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1112 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1113 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1116 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1117 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1120 AC_CACHE_CHECK([for pw_class field in struct passwd],
1121 ac_cv_have_pw_class_in_struct_passwd, [
1126 [ struct passwd p; p.pw_class = 0; ],
1127 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1128 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1131 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1132 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1136 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1138 [ extern char *__progname; printf("%s", __progname); ],
1139 [ ac_cv_libc_defines___progname="yes" ],
1140 [ ac_cv_libc_defines___progname="no" ]
1143 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1144 AC_DEFINE(HAVE___PROGNAME)
1148 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1150 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1151 [ ac_cv_libc_defines_sys_errlist="yes" ],
1152 [ ac_cv_libc_defines_sys_errlist="no" ]
1155 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1156 AC_DEFINE(HAVE_SYS_ERRLIST)
1160 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1162 [ extern int sys_nerr; printf("%i", sys_nerr);],
1163 [ ac_cv_libc_defines_sys_nerr="yes" ],
1164 [ ac_cv_libc_defines_sys_nerr="no" ]
1167 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1168 AC_DEFINE(HAVE_SYS_NERR)
1172 # Check whether user wants Kerberos support
1174 AC_ARG_WITH(kerberos4,
1175 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1177 if test "x$withval" != "xno" ; then
1179 if test "x$withval" != "xyes" ; then
1180 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1181 LDFLAGS="$LDFLAGS -L${withval}/lib"
1182 if test ! -z "$need_dash_r" ; then
1183 LDFLAGS="$LDFLAGS -R${withval}/lib"
1185 if test ! -z "$blibpath" ; then
1186 blibpath="$blibpath:${withval}/lib"
1189 if test -d /usr/include/kerberosIV ; then
1190 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1194 AC_CHECK_HEADERS(krb.h)
1195 if test "$ac_cv_header_krb_h" != yes; then
1196 AC_MSG_WARN([Cannot find krb.h, build may fail])
1198 AC_CHECK_LIB(krb, main)
1199 if test "$ac_cv_lib_krb_main" != yes; then
1200 AC_CHECK_LIB(krb4, main)
1201 if test "$ac_cv_lib_krb4_main" != yes; then
1202 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1209 AC_CHECK_LIB(des, des_cbc_encrypt)
1210 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1211 AC_CHECK_LIB(des425, des_cbc_encrypt)
1212 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1213 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1220 AC_CHECK_LIB(resolv, dn_expand, , )
1228 # Check whether user wants AFS support
1231 [ --with-afs=PATH Enable AFS support],
1233 if test "x$withval" != "xno" ; then
1235 if test "x$withval" != "xyes" ; then
1236 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1237 LDFLAGS="$LDFLAGS -L${withval}/lib"
1240 if test -z "$KRB4" ; then
1241 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1245 if test ! -z "$AFS_LIBS" ; then
1246 LIBS="$LIBS $AFS_LIBS"
1255 # Looking for programs, paths and files
1257 [ --with-rsh=PATH Specify path to remote shell program ],
1259 if test "x$withval" != "$no" ; then
1264 AC_PATH_PROG(rsh_path, rsh)
1269 [ --with-xauth=PATH Specify path to xauth program ],
1271 if test "x$withval" != "xno" ; then
1276 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1277 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1278 xauth_path="/usr/openwin/bin/xauth"
1283 if test -z "$xauth_path" ; then
1284 XAUTH_PATH="undefined"
1285 AC_SUBST(XAUTH_PATH)
1287 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1288 XAUTH_PATH=$xauth_path
1289 AC_SUBST(XAUTH_PATH)
1291 if test ! -z "$rsh_path" ; then
1292 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1295 # Check for mail directory (last resort if we cannot get it from headers)
1296 if test ! -z "$MAIL" ; then
1297 maildir=`dirname $MAIL`
1298 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1301 if test -z "$no_dev_ptmx" ; then
1302 AC_CHECK_FILE("/dev/ptmx",
1304 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1309 AC_CHECK_FILE("/dev/ptc",
1311 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1316 # Options from here on. Some of these are preset by platform above
1318 # Check for user-specified random device, otherwise check /dev/urandom
1320 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1322 if test "x$withval" != "xno" ; then
1323 RANDOM_POOL="$withval";
1324 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1328 # Check for random device
1329 AC_CHECK_FILE("/dev/urandom",
1331 RANDOM_POOL="/dev/urandom";
1332 AC_SUBST(RANDOM_POOL)
1333 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1339 # Check for PRNGD/EGD pool file
1340 AC_ARG_WITH(prngd-port,
1341 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1343 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1344 PRNGD_PORT="$withval"
1345 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1350 # Check for PRNGD/EGD pool file
1351 AC_ARG_WITH(prngd-socket,
1352 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1354 if test "x$withval" != "xno" ; then
1355 PRNGD_SOCKET="$withval"
1356 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1360 # Check for existing socket only if we don't have a random device already
1361 if test -z "$RANDOM_POOL" ; then
1362 AC_MSG_CHECKING(for PRNGD/EGD socket)
1363 # Insert other locations here
1364 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1365 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1366 PRNGD_SOCKET="$sock"
1367 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1371 if test ! -z "$PRNGD_SOCKET" ; then
1372 AC_MSG_RESULT($PRNGD_SOCKET)
1374 AC_MSG_RESULT(not found)
1381 # detect pathnames for entropy gathering commands, if we need them
1382 INSTALL_SSH_PRNG_CMDS=""
1384 if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
1385 # Use these commands to collect entropy
1386 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1387 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1388 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1389 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1390 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1391 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1392 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1393 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1394 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1395 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1396 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1397 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1398 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1399 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1401 INSTALL_SSH_PRNG_CMDS="yes"
1403 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1407 [ --with-mantype=man|cat|doc Set man page type],
1414 AC_MSG_ERROR(invalid man type: $withval)
1419 if test -z "$MANTYPE"; then
1420 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
1421 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1423 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1430 if test "$MANTYPE" = "doc"; then
1437 # Check whether to enable MD5 passwords
1439 AC_ARG_WITH(md5-passwords,
1440 [ --with-md5-passwords Enable use of MD5 passwords],
1442 if test "x$withval" != "xno" ; then
1443 AC_DEFINE(HAVE_MD5_PASSWORDS)
1449 # Whether to disable shadow password support
1451 [ --without-shadow Disable shadow password support],
1453 if test "x$withval" = "xno" ; then
1454 AC_DEFINE(DISABLE_SHADOW)
1460 if test -z "$disable_shadow" ; then
1461 AC_MSG_CHECKING([if the systems has expire shadow information])
1464 #include <sys/types.h>
1467 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1468 [ sp_expire_available=yes ], []
1471 if test "x$sp_expire_available" = "xyes" ; then
1473 AC_DEFINE(HAS_SHADOW_EXPIRE)
1479 # Use ip address instead of hostname in $DISPLAY
1480 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1481 DISPLAY_HACK_MSG="yes"
1482 AC_DEFINE(IPADDR_IN_DISPLAY)
1484 DISPLAY_HACK_MSG="no"
1485 AC_ARG_WITH(ipaddr-display,
1486 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1488 if test "x$withval" != "xno" ; then
1489 AC_DEFINE(IPADDR_IN_DISPLAY)
1490 DISPLAY_HACK_MSG="yes"
1496 # Whether to mess with the default path
1497 SERVER_PATH_MSG="(default)"
1498 AC_ARG_WITH(default-path,
1499 [ --with-default-path=PATH Specify default \$PATH environment for server],
1501 if test "x$withval" != "xno" ; then
1502 user_path="$withval"
1503 SERVER_PATH_MSG="$withval"
1509 /* find out what STDPATH is */
1514 #ifndef _PATH_STDPATH
1515 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1517 #include <sys/types.h>
1518 #include <sys/stat.h>
1520 #define DATA "conftest.stdpath"
1527 fd = fopen(DATA,"w");
1531 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1536 ], [ user_path=`cat conftest.stdpath` ],
1537 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1538 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1540 # make sure $bindir is in USER_PATH so scp will work
1541 t_bindir=`eval echo ${bindir}`
1543 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1546 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1548 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1549 if test $? -ne 0 ; then
1550 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1551 if test $? -ne 0 ; then
1552 user_path=$user_path:$t_bindir
1553 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1558 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1561 # Whether to force IPv4 by default (needed on broken glibc Linux)
1563 AC_ARG_WITH(ipv4-default,
1564 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1566 if test "x$withval" != "xno" ; then
1567 AC_DEFINE(IPV4_DEFAULT)
1573 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1574 IPV4_IN6_HACK_MSG="no"
1576 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1578 if test "x$withval" != "xno" ; then
1580 AC_DEFINE(IPV4_IN_IPV6)
1581 IPV4_IN6_HACK_MSG="yes"
1586 if test "x$inet6_default_4in6" = "xyes"; then
1587 AC_MSG_RESULT([yes (default)])
1588 AC_DEFINE(IPV4_IN_IPV6)
1589 IPV4_IN6_HACK_MSG="yes"
1591 AC_MSG_RESULT([no (default)])
1596 # Whether to enable BSD auth support
1597 AC_ARG_WITH(bsd-auth,
1598 [ --with-bsd-auth Enable BSD auth support],
1600 if test "x$withval" != "xno" ; then
1607 AC_MSG_CHECKING(whether to install ssh as suid root)
1608 AC_ARG_ENABLE(suid-ssh,
1609 [ --enable-suid-ssh Install ssh as suid root (default)
1610 --disable-suid-ssh Install ssh without suid bit],
1611 [ case "$enableval" in
1616 *) AC_MSG_RESULT(yes)
1626 # Where to place sshd.pid
1628 AC_ARG_WITH(pid-dir,
1629 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1631 if test "x$withval" != "xno" ; then
1637 # make sure the directory exists
1638 if test ! -d $piddir ; then
1639 piddir=`eval echo ${sysconfdir}`
1641 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1645 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1648 dnl allow user to disable some login recording features
1649 AC_ARG_ENABLE(lastlog,
1650 [ --disable-lastlog disable use of lastlog even if detected [no]],
1651 [ AC_DEFINE(DISABLE_LASTLOG) ]
1654 [ --disable-utmp disable use of utmp even if detected [no]],
1655 [ AC_DEFINE(DISABLE_UTMP) ]
1657 AC_ARG_ENABLE(utmpx,
1658 [ --disable-utmpx disable use of utmpx even if detected [no]],
1659 [ AC_DEFINE(DISABLE_UTMPX) ]
1662 [ --disable-wtmp disable use of wtmp even if detected [no]],
1663 [ AC_DEFINE(DISABLE_WTMP) ]
1665 AC_ARG_ENABLE(wtmpx,
1666 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1667 [ AC_DEFINE(DISABLE_WTMPX) ]
1669 AC_ARG_ENABLE(libutil,
1670 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1671 [ AC_DEFINE(DISABLE_LOGIN) ]
1673 AC_ARG_ENABLE(pututline,
1674 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1675 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1677 AC_ARG_ENABLE(pututxline,
1678 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1679 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1681 AC_ARG_WITH(lastlog,
1682 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1684 if test "x$withval" = "xno" ; then
1685 AC_DEFINE(DISABLE_LASTLOG)
1687 conf_lastlog_location=$withval
1692 dnl lastlog, [uw]tmpx? detection
1693 dnl NOTE: set the paths in the platform section to avoid the
1694 dnl need for command-line parameters
1695 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1697 dnl lastlog detection
1698 dnl NOTE: the code itself will detect if lastlog is a directory
1699 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1701 #include <sys/types.h>
1703 #ifdef HAVE_LASTLOG_H
1704 # include <lastlog.h>
1710 [ char *lastlog = LASTLOG_FILE; ],
1711 [ AC_MSG_RESULT(yes) ],
1714 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1716 #include <sys/types.h>
1718 #ifdef HAVE_LASTLOG_H
1719 # include <lastlog.h>
1725 [ char *lastlog = _PATH_LASTLOG; ],
1726 [ AC_MSG_RESULT(yes) ],
1729 system_lastlog_path=no
1734 if test -z "$conf_lastlog_location"; then
1735 if test x"$system_lastlog_path" = x"no" ; then
1736 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1737 if (test -d "$f" || test -f "$f") ; then
1738 conf_lastlog_location=$f
1741 if test -z "$conf_lastlog_location"; then
1742 AC_MSG_WARN([** Cannot find lastlog **])
1743 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1748 if test -n "$conf_lastlog_location"; then
1749 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1753 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1755 #include <sys/types.h>
1761 [ char *utmp = UTMP_FILE; ],
1762 [ AC_MSG_RESULT(yes) ],
1764 system_utmp_path=no ]
1766 if test -z "$conf_utmp_location"; then
1767 if test x"$system_utmp_path" = x"no" ; then
1768 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1769 if test -f $f ; then
1770 conf_utmp_location=$f
1773 if test -z "$conf_utmp_location"; then
1774 AC_DEFINE(DISABLE_UTMP)
1778 if test -n "$conf_utmp_location"; then
1779 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1783 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1785 #include <sys/types.h>
1791 [ char *wtmp = WTMP_FILE; ],
1792 [ AC_MSG_RESULT(yes) ],
1794 system_wtmp_path=no ]
1796 if test -z "$conf_wtmp_location"; then
1797 if test x"$system_wtmp_path" = x"no" ; then
1798 for f in /usr/adm/wtmp /var/log/wtmp; do
1799 if test -f $f ; then
1800 conf_wtmp_location=$f
1803 if test -z "$conf_wtmp_location"; then
1804 AC_DEFINE(DISABLE_WTMP)
1808 if test -n "$conf_wtmp_location"; then
1809 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1813 dnl utmpx detection - I don't know any system so perverse as to require
1814 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1816 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1818 #include <sys/types.h>
1827 [ char *utmpx = UTMPX_FILE; ],
1828 [ AC_MSG_RESULT(yes) ],
1830 system_utmpx_path=no ]
1832 if test -z "$conf_utmpx_location"; then
1833 if test x"$system_utmpx_path" = x"no" ; then
1834 AC_DEFINE(DISABLE_UTMPX)
1837 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1841 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1843 #include <sys/types.h>
1852 [ char *wtmpx = WTMPX_FILE; ],
1853 [ AC_MSG_RESULT(yes) ],
1855 system_wtmpx_path=no ]
1857 if test -z "$conf_wtmpx_location"; then
1858 if test x"$system_wtmpx_path" = x"no" ; then
1859 AC_DEFINE(DISABLE_WTMPX)
1862 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1866 # Change default command timeout for builtin PRNG
1868 AC_ARG_WITH(entropy-timeout,
1869 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1871 if test "x$withval" != "xno" ; then
1872 entropy_timeout=$withval
1876 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1879 if test ! -z "$blibpath" ; then
1880 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1881 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1886 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1888 # Print summary of options
1890 if test ! -z "$RANDOM_POOL" ; then
1891 RAND_MSG="Device ($RANDOM_POOL)"
1893 if test ! -z "$PRNGD_PORT" ; then
1894 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1895 elif test ! -z "$PRNGD_SOCKET" ; then
1896 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
1898 RAND_MSG="Builtin (timeout $entropy_timeout)"
1903 # Someone please show me a better way :)
1904 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1905 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1906 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1907 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1908 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1909 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1910 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1911 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
1914 echo "OpenSSH has been configured with the following options:"
1915 echo " User binaries: $B"
1916 echo " System binaries: $C"
1917 echo " Configuration files: $D"
1918 echo " Askpass program: $E"
1919 echo " Manual pages: $F"
1920 echo " PID file: $G"
1921 echo " sshd default user PATH: $H"
1922 echo " Random number collection: $RAND_MSG"
1923 echo " Manpage format: $MANTYPE"
1924 echo " PAM support: ${PAM_MSG}"
1925 echo " KerberosIV support: $KRB4_MSG"
1926 echo " AFS support: $AFS_MSG"
1927 echo " S/KEY support: $SKEY_MSG"
1928 echo " TCP Wrappers support: $TCPW_MSG"
1929 echo " MD5 password support: $MD5_MSG"
1930 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1931 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1932 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1934 if test ! -z "$bsd_auth"; then
1935 echo " BSD Auth support: yes"
1940 echo " Host: ${host}"
1941 echo " Compiler: ${CC}"
1942 echo " Compiler flags: ${CFLAGS}"
1943 echo "Preprocessor flags: ${CPPFLAGS}"
1944 echo " Linker flags: ${LDFLAGS}"
1945 echo " Libraries: ${LIBS}"
1949 if test "x$PAM_MSG" = "xyes" ; then
1950 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1951 echo "otherwise password authentication may fail. Example PAM control files"
1952 echo "can be found in the contrib/ subdirectory"
1956 if test ! -z "$BUILTIN_RNG" ; then
1957 echo "WARNING: you are using the builtin random number collection service."
1958 echo "Please read WARNING.RNG and request that your OS vendor includes"
1959 echo "/dev/random in future versions of their OS."
1963 if test ! -z "$NO_SFTP"; then
1964 echo "sftp-server will be disabled. Your compiler does not support"
1965 echo "64bit integers."