3 AC_CONFIG_HEADER(config.h)
11 AC_CHECK_PROG(AR, ar, ar)
12 AC_PATH_PROG(PERL, perl)
14 AC_PATH_PROG(ENT, ent)
16 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
18 if test -z "$AR" ; then
19 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
22 # Use LOGIN_PROGRAM from environment if possible
23 if test ! -z "$LOGIN_PROGRAM" ; then
24 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
27 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
28 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
29 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
33 if test -z "$LD" ; then
40 if test "$GCC" = "yes"; then
41 CFLAGS="$CFLAGS -Wall"
44 # Check for some target-specific stuff
48 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
49 LDFLAGS="$LDFLAGS -L/usr/local/lib"
50 if (test "$LD" != "gcc" && test -z "$blibpath"); then
51 blibpath="/usr/lib:/lib:/usr/local/lib"
53 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
54 AC_DEFINE(BROKEN_GETADDRINFO)
57 dnl AIX handles lastlog as part of its login message
58 AC_DEFINE(DISABLE_LASTLOG)
63 LIBS="$LIBS -lregex /usr/lib/textmode.o"
64 AC_DEFINE(HAVE_CYGWIN)
65 AC_DEFINE(DISABLE_SHADOW)
66 AC_DEFINE(IPV4_DEFAULT)
67 AC_DEFINE(IP_TOS_IS_BROKEN)
68 AC_DEFINE(BROKEN_VHANGUP)
73 if test -z "$GCC"; then
76 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
79 AC_DEFINE(DISABLE_SHADOW)
80 AC_DEFINE(DISABLE_UTMP)
81 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
87 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
89 AC_DEFINE(PAM_SUN_CODEBASE)
91 AC_DEFINE(DISABLE_SHADOW)
92 AC_DEFINE(DISABLE_UTMP)
93 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
99 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
101 PATH="$PATH:/usr/etc"
105 AC_DEFINE(BROKEN_INET_NTOA)
108 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
110 PATH="$PATH:/usr/etc"
112 AC_DEFINE(WITH_IRIX_ARRAY)
113 AC_DEFINE(WITH_IRIX_PROJECT)
114 AC_DEFINE(WITH_IRIX_AUDIT)
115 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
118 AC_DEFINE(BROKEN_INET_NTOA)
123 check_for_libcrypt_later=1
124 AC_DEFINE(DONT_TRY_OTHER_AF)
125 AC_DEFINE(PAM_TTY_KLUDGE)
126 inet6_default_4in6=yes
128 mips-sony-bsd|mips-sony-newsos4)
129 AC_DEFINE(HAVE_NEWS4)
131 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
132 AC_MSG_ERROR([*** libiberty missing - please install first ***])
139 conf_lastlog_location="/usr/adm/lastlog"
140 conf_utmp_location=/etc/utmp
141 conf_wtmp_location=/usr/adm/wtmp
144 AC_DEFINE(BROKEN_REALPATH)
146 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
150 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
151 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
153 AC_DEFINE(PAM_SUN_CODEBASE)
154 # hardwire lastlog location (can't detect it on some versions)
155 conf_lastlog_location="/var/adm/lastlog"
156 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
157 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
158 if test "$sol2ver" -ge 8; then
160 AC_DEFINE(DISABLE_UTMP)
161 AC_DEFINE(DISABLE_WTMP)
167 CPPFLAGS="$CPPFLAGS -DSUNOS4"
168 AC_CHECK_FUNCS(getpwanam)
169 AC_DEFINE(PAM_SUN_CODEBASE)
170 conf_utmp_location=/etc/utmp
171 conf_wtmp_location=/var/adm/wtmp
172 conf_lastlog_location=/var/adm/lastlog
178 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
179 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
181 IPADDR_IN_DISPLAY=yes
183 AC_DEFINE(IP_TOS_IS_BROKEN)
185 LIBS="$LIBS -lgen -lnsl -lucb"
188 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
189 LDFLAGS="$LDFLAGS -L/usr/local/lib"
195 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
196 LDFLAGS="$LDFLAGS -L/usr/local/lib"
202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
206 LIBS="$LIBS -lgen -lsocket"
210 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
211 LDFLAGS="$LDFLAGS -L/usr/local/lib"
214 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
217 AC_DEFINE(BROKEN_SYS_TERMIO_H)
218 rsh_path="/usr/bin/rcmd"
219 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
220 AC_DEFINE(DISABLE_SHADOW)
221 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
225 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
226 LDFLAGS="$LDFLAGS -L/usr/local/lib"
229 LIBS="$LIBS -lprot -lx -ltinfo -lm"
231 rsh_path="/usr/bin/rcmd"
232 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
233 AC_DEFINE(DISABLE_SHADOW)
234 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
238 if test ! -z "USE_SIA" ; then
239 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
240 if test -f /etc/sia/matrix.conf; then
242 AC_DEFINE(HAVE_OSF_SIA)
243 AC_DEFINE(DISABLE_LOGIN)
244 LIBS="$LIBS -lsecurity -ldb -lm -laud"
252 # Allow user to specify flags
254 [ --with-cflags Specify additional flags to pass to compiler],
256 if test "x$withval" != "xno" ; then
257 CFLAGS="$CFLAGS $withval"
261 AC_ARG_WITH(cppflags,
262 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
264 if test "x$withval" != "xno"; then
265 CPPFLAGS="$CPPFLAGS $withval"
270 [ --with-ldflags Specify additional flags to pass to linker],
272 if test "x$withval" != "xno" ; then
273 LDFLAGS="$LDFLAGS $withval"
278 [ --with-libs Specify additional libraries to link with],
280 if test "x$withval" != "xno" ; then
281 LIBS="$LIBS $withval"
287 # Checks for libraries.
288 if test -z "$no_libsocket" ; then
289 AC_CHECK_LIB(nsl, yp_match, , )
291 if test -z "$no_libnsl" ; then
292 AC_CHECK_LIB(socket, main, , )
295 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
296 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
297 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
299 AC_CHECK_FUNC(regcomp,
300 [ AC_DEFINE(HAVE_REGCOMP)],
302 AC_CHECK_LIB(pcre, pcre_info,
303 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
308 AC_CHECK_FUNC(strcasecmp,
309 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
311 AC_CHECK_FUNC(utimes,
312 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
315 # Checks for header files.
316 AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.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)
318 dnl Checks for library functions.
319 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
320 dnl Checks for time functions
321 AC_CHECK_FUNCS(gettimeofday time)
322 dnl Checks for libutil functions
323 AC_CHECK_HEADERS(libutil.h)
324 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
325 dnl Checks for utmp functions
326 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
327 AC_CHECK_FUNCS(utmpname)
328 dnl Checks for utmpx functions
329 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
330 AC_CHECK_FUNCS(setutxent utmpxname)
332 AC_CHECK_FUNC(getuserattr,
333 [AC_DEFINE(HAVE_GETUSERATTR)],
334 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
338 [AC_DEFINE(HAVE_LOGIN)],
339 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
342 AC_CHECK_FUNC(daemon,
343 [AC_DEFINE(HAVE_DAEMON)],
344 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
347 AC_CHECK_FUNC(getpagesize,
348 [AC_DEFINE(HAVE_GETPAGESIZE)],
349 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
352 # Check for broken snprintf
353 if test "x$ac_cv_func_snprintf" = "xyes" ; then
354 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
358 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
360 [AC_MSG_RESULT(yes)],
363 AC_DEFINE(BROKEN_SNPRINTF)
364 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
376 [ --with-pam Enable PAM support ],
378 if test "x$withval" != "xno" ; then
379 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
380 AC_MSG_ERROR([PAM headers not found])
383 AC_CHECK_LIB(dl, dlopen, , )
384 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
385 AC_CHECK_FUNCS(pam_getenvlist)
395 # Check for older PAM
396 if test "x$PAM_MSG" = "xyes" ; then
397 # Check PAM strerror arguments (old PAM)
398 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
402 #include <security/pam_appl.h>
404 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
407 AC_DEFINE(HAVE_OLD_PAM)
409 PAM_MSG="yes (old library)"
414 # The big search for OpenSSL
416 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
418 if test "x$withval" != "xno" ; then
425 saved_LDFLAGS="$LDFLAGS"
426 saved_CPPFLAGS="$CPPFLAGS"
427 if test "x$prefix" != "xNONE" ; then
428 tryssldir="$tryssldir $prefix"
430 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
432 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
433 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
434 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
435 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
436 if test ! -z "$need_dash_r" ; then
437 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
440 LDFLAGS="$saved_LDFLAGS"
443 LIBS="$saved_LIBS -lcrypto"
445 # Basic test to check for compatible version and correct linking
446 # *does not* test for RSA - that comes later.
450 #include <openssl/rand.h>
454 memset(a, 0, sizeof(a));
455 RAND_add(a, sizeof(a), sizeof(a));
456 return(RAND_status() <= 0);
465 if test ! -z "$found_crypto" ; then
470 if test -z "$found_crypto" ; then
471 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
473 if test -z "$ssldir" ; then
477 ac_cv_openssldir=$ssldir
480 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
481 AC_DEFINE(HAVE_OPENSSL)
482 dnl Need to recover ssldir - test above runs in subshell
483 ssldir=$ac_cv_openssldir
485 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
486 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
487 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
488 if test ! -z "$need_dash_r" ; then
489 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
491 if test ! -z "$blibpath" ; then
492 blibpath="$blibpath:$ssldir:$ssldir/lib"
496 LIBS="$saved_LIBS -lcrypto"
498 # Now test RSA support
500 AC_MSG_CHECKING([for RSA support])
501 for WANTS_RSAREF in "" 1 ; do
502 if test -z "$WANTS_RSAREF" ; then
505 LIBS="$saved_LIBS -lRSAglue -lrsaref"
509 #include <openssl/rand.h>
510 #include <openssl/rsa.h>
511 #include <openssl/bn.h>
512 #include <openssl/sha.h>
515 int num; RSA *key; static unsigned char p_in[] = "blahblah";
516 unsigned char c[256], p[256];
517 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
518 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
519 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
520 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
529 if test ! -z "$no_rsa" ; then
530 AC_MSG_RESULT(disabled)
533 if test -z "$rsa_works" ; then
534 AC_MSG_WARN([*** No RSA support found *** ])
537 if test -z "$WANTS_RSAREF" ; then
541 RSA_MSG="yes (using RSAref)"
542 AC_MSG_RESULT(using RSAref)
543 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
548 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
549 # version in OpenSSL. Skip this for PAM
550 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
551 AC_CHECK_LIB(crypt, crypt, , )
554 # Cheap hack to ensure NEWS-OS libraries are arranged right.
555 if test ! -z "$SONY" ; then
556 LIBS="$LIBS -liberty";
559 # Checks for data types
560 AC_CHECK_SIZEOF(char, 1)
561 AC_CHECK_SIZEOF(short int, 2)
562 AC_CHECK_SIZEOF(int, 4)
563 AC_CHECK_SIZEOF(long int, 4)
564 AC_CHECK_SIZEOF(long long int, 8)
566 # More checks for data types
567 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
569 [ #include <sys/types.h> ],
571 [ ac_cv_have_u_int="yes" ],
572 [ ac_cv_have_u_int="no" ]
575 if test "x$ac_cv_have_u_int" = "xyes" ; then
576 AC_DEFINE(HAVE_U_INT)
580 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
582 [ #include <sys/types.h> ],
583 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
584 [ ac_cv_have_intxx_t="yes" ],
585 [ ac_cv_have_intxx_t="no" ]
588 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
589 AC_DEFINE(HAVE_INTXX_T)
593 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
595 [ #include <sys/types.h> ],
596 [ int64_t a; a = 1;],
597 [ ac_cv_have_int64_t="yes" ],
598 [ ac_cv_have_int64_t="no" ]
601 if test "x$ac_cv_have_int64_t" = "xyes" ; then
602 AC_DEFINE(HAVE_INT64_T)
606 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
608 [ #include <sys/types.h> ],
609 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
610 [ ac_cv_have_u_intxx_t="yes" ],
611 [ ac_cv_have_u_intxx_t="no" ]
614 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
615 AC_DEFINE(HAVE_U_INTXX_T)
619 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
621 [ #include <sys/types.h> ],
622 [ u_int64_t a; a = 1;],
623 [ ac_cv_have_u_int64_t="yes" ],
624 [ ac_cv_have_u_int64_t="no" ]
627 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
628 AC_DEFINE(HAVE_U_INT64_T)
632 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
633 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
635 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
638 #include <sys/bitypes.h>
641 int8_t a; int16_t b; int32_t c;
642 u_int8_t e; u_int16_t f; u_int32_t g;
643 a = b = c = e = f = g = 1;
646 AC_DEFINE(HAVE_U_INTXX_T)
647 AC_DEFINE(HAVE_INTXX_T)
654 if test -z "$have_u_intxx_t" ; then
655 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
658 #include <sys/types.h>
660 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
661 [ ac_cv_have_uintxx_t="yes" ],
662 [ ac_cv_have_uintxx_t="no" ]
665 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
666 AC_DEFINE(HAVE_UINTXX_T)
670 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
673 #include <sys/types.h>
674 #include <sys/socket.h>
676 [socklen_t foo; foo = 1235;],
677 [ ac_cv_have_socklen_t="yes" ],
678 [ ac_cv_have_socklen_t="no" ]
681 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
682 AC_DEFINE(HAVE_SOCKLEN_T)
685 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
688 #include <sys/types.h>
690 [ size_t foo; foo = 1235; ],
691 [ ac_cv_have_size_t="yes" ],
692 [ ac_cv_have_size_t="no" ]
695 if test "x$ac_cv_have_size_t" = "xyes" ; then
696 AC_DEFINE(HAVE_SIZE_T)
699 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
702 #include <sys/types.h>
704 [ ssize_t foo; foo = 1235; ],
705 [ ac_cv_have_ssize_t="yes" ],
706 [ ac_cv_have_ssize_t="no" ]
709 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
710 AC_DEFINE(HAVE_SSIZE_T)
713 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
718 [ clock_t foo; foo = 1235; ],
719 [ ac_cv_have_clock_t="yes" ],
720 [ ac_cv_have_clock_t="no" ]
723 if test "x$ac_cv_have_clock_t" = "xyes" ; then
724 AC_DEFINE(HAVE_CLOCK_T)
727 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
730 #include <sys/types.h>
731 #include <sys/socket.h>
733 [ sa_family_t foo; foo = 1235; ],
734 [ ac_cv_have_sa_family_t="yes" ],
737 #include <sys/types.h>
738 #include <sys/socket.h>
739 #include <netinet/in.h>
741 [ sa_family_t foo; foo = 1235; ],
742 [ ac_cv_have_sa_family_t="yes" ],
744 [ ac_cv_have_sa_family_t="no" ]
748 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
749 AC_DEFINE(HAVE_SA_FAMILY_T)
752 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
755 #include <sys/types.h>
757 [ pid_t foo; foo = 1235; ],
758 [ ac_cv_have_pid_t="yes" ],
759 [ ac_cv_have_pid_t="no" ]
762 if test "x$ac_cv_have_pid_t" = "xyes" ; then
763 AC_DEFINE(HAVE_PID_T)
766 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
769 #include <sys/types.h>
771 [ mode_t foo; foo = 1235; ],
772 [ ac_cv_have_mode_t="yes" ],
773 [ ac_cv_have_mode_t="no" ]
776 if test "x$ac_cv_have_mode_t" = "xyes" ; then
777 AC_DEFINE(HAVE_MODE_T)
781 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
784 #include <sys/types.h>
785 #include <sys/socket.h>
787 [ struct sockaddr_storage s; ],
788 [ ac_cv_have_struct_sockaddr_storage="yes" ],
789 [ ac_cv_have_struct_sockaddr_storage="no" ]
792 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
793 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
796 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
799 #include <sys/types.h>
800 #include <netinet/in.h>
802 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
803 [ ac_cv_have_struct_sockaddr_in6="yes" ],
804 [ ac_cv_have_struct_sockaddr_in6="no" ]
807 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
808 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
811 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
814 #include <sys/types.h>
815 #include <netinet/in.h>
817 [ struct in6_addr s; s.s6_addr[0] = 0; ],
818 [ ac_cv_have_struct_in6_addr="yes" ],
819 [ ac_cv_have_struct_in6_addr="no" ]
822 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
823 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
826 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
829 #include <sys/types.h>
830 #include <sys/socket.h>
833 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
834 [ ac_cv_have_struct_addrinfo="yes" ],
835 [ ac_cv_have_struct_addrinfo="no" ]
838 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
839 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
842 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
844 [ #include <sys/time.h> ],
845 [ struct timeval tv; tv.tv_sec = 1;],
846 [ ac_cv_have_struct_timeval="yes" ],
847 [ ac_cv_have_struct_timeval="no" ]
850 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
851 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
852 have_struct_timeval=1
855 # If we don't have int64_t then we can't compile sftp-server. So don't
856 # even attempt to do it.
857 if test "x$ac_cv_have_int64_t" = "xno" -a \
858 "x$ac_cv_sizeof_long_int" != "x8" -a \
859 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
864 dnl Checks for structure members
865 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
866 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
867 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
868 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
869 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
870 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
871 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
872 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
873 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
874 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
875 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
876 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
877 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
878 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
879 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
880 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
881 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
884 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
885 ac_cv_have_sun_len_in_struct_sockaddr_un, [
888 #include <sys/types.h>
889 #include <sys/socket.h>
891 [ struct sockaddr_un s; s.sun_len = 1; ],
892 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
893 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
896 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
897 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
900 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
901 ac_cv_have_ss_family_in_struct_ss, [
904 #include <sys/types.h>
905 #include <sys/socket.h>
907 [ struct sockaddr_storage s; s.ss_family = 1; ],
908 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
909 [ ac_cv_have_ss_family_in_struct_ss="no" ],
912 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
913 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
916 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
917 ac_cv_have___ss_family_in_struct_ss, [
920 #include <sys/types.h>
921 #include <sys/socket.h>
923 [ struct sockaddr_storage s; s.__ss_family = 1; ],
924 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
925 [ ac_cv_have___ss_family_in_struct_ss="no" ]
928 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
929 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
932 AC_CACHE_CHECK([for pw_class field in struct passwd],
933 ac_cv_have_pw_class_in_struct_passwd, [
938 [ struct passwd p; p.pw_class = 0; ],
939 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
940 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
943 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
944 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
948 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
950 [ extern char *__progname; printf("%s", __progname); ],
951 [ ac_cv_libc_defines___progname="yes" ],
952 [ ac_cv_libc_defines___progname="no" ]
955 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
956 AC_DEFINE(HAVE___PROGNAME)
960 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
962 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
963 [ ac_cv_libc_defines_sys_errlist="yes" ],
964 [ ac_cv_libc_defines_sys_errlist="no" ]
967 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
968 AC_DEFINE(HAVE_SYS_ERRLIST)
972 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
974 [ extern int sys_nerr; printf("%i", sys_nerr);],
975 [ ac_cv_libc_defines_sys_nerr="yes" ],
976 [ ac_cv_libc_defines_sys_nerr="no" ]
979 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
980 AC_DEFINE(HAVE_SYS_NERR)
984 # Looking for programs, paths and files
986 [ --with-rsh=PATH Specify path to remote shell program ],
988 if test "x$withval" != "$no" ; then
993 AC_PATH_PROG(rsh_path, rsh)
998 [ --with-xauth=PATH Specify path to xauth program ],
1000 if test "x$withval" != "xno" ; then
1005 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1006 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1007 xauth_path="/usr/openwin/bin/xauth"
1012 if test -z "$xauth_path" ; then
1013 XAUTH_PATH="undefined"
1014 AC_SUBST(XAUTH_PATH)
1016 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1017 XAUTH_PATH=$xauth_path
1018 AC_SUBST(XAUTH_PATH)
1020 if test ! -z "$rsh_path" ; then
1021 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1024 # Check for mail directory (last resort if we cannot get it from headers)
1025 if test ! -z "$MAIL" ; then
1026 maildir=`dirname $MAIL`
1027 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1030 if test -z "$no_dev_ptmx" ; then
1031 AC_CHECK_FILE("/dev/ptmx",
1033 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1038 AC_CHECK_FILE("/dev/ptc",
1040 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1045 # Options from here on. Some of these are preset by platform above
1047 # Check for user-specified random device, otherwise check /dev/urandom
1049 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1051 if test "x$withval" != "xno" ; then
1052 RANDOM_POOL="$withval";
1053 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1057 # Check for random device
1058 AC_CHECK_FILE("/dev/urandom",
1060 RANDOM_POOL="/dev/urandom";
1061 AC_SUBST(RANDOM_POOL)
1062 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1068 # Check for EGD pool file
1069 AC_ARG_WITH(egd-pool,
1070 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1072 if test "x$withval" != "xno" ; then
1073 EGD_SOCKET="$withval";
1074 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1078 # Check for existing socket only if we don't have a random device already
1079 if test -z "$RANDOM_POOL" ; then
1080 AC_MSG_CHECKING(for PRNGD/EGD socket)
1081 # Insert other locations here
1082 for egdsock in /var/run/egd-pool /etc/entropy ; do
1083 if test -S $egdsock ; then
1084 EGD_SOCKET="$egdsock"
1085 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1086 AC_MSG_RESULT($egdsock)
1095 # detect pathnames for entropy gathering commands, if we need them
1096 INSTALL_SSH_PRNG_CMDS=""
1098 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1099 # Use these commands to collect entropy
1100 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1101 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1102 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1103 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1104 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1105 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1106 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1107 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1108 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1109 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1110 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1111 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1112 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1113 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1115 INSTALL_SSH_PRNG_CMDS="yes"
1117 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1121 [ --with-catman=man|cat Install preformatted manpages[no]],
1124 if test x"$withval" != x"yes" ; then
1130 if test -z "$MANTYPE" ; then
1131 MANTYPE='$(TROFFMAN)'
1139 # Check whether user wants Kerberos support
1141 AC_ARG_WITH(kerberos4,
1142 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1144 if test "x$withval" != "xno" ; then
1146 if test "x$withval" != "xyes" ; then
1147 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1148 LDFLAGS="$LDFLAGS -L${withval}/lib"
1149 if test ! -z "$need_dash_r" ; then
1150 LDFLAGS="$LDFLAGS -R${withval}/lib"
1152 if test ! -z "$blibpath" ; then
1153 blibpath="$blibpath:${withval}/lib"
1156 if test -d /usr/include/kerberosIV ; then
1157 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1161 AC_CHECK_HEADERS(krb.h)
1162 AC_CHECK_LIB(krb, main)
1163 if test "$ac_cv_header_krb_h" != yes; then
1164 AC_MSG_WARN([Cannot find krb.h, build may fail])
1166 if test "$ac_cv_lib_krb_main" != yes; then
1167 AC_MSG_WARN([Cannot find libkrb, build may fail])
1171 AC_CHECK_LIB(resolv, dn_expand, , )
1179 # Check whether user wants AFS support
1182 [ --with-afs=PATH Enable AFS support],
1184 if test "x$withval" != "xno" ; then
1186 if test "x$withval" != "xyes" ; then
1187 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1188 LDFLAGS="$LDFLAGS -L${withval}/lib"
1191 if test -z "$KRB4" ; then
1192 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1196 if test ! -z "$AFS_LIBS" ; then
1197 LIBS="$LIBS $AFS_LIBS"
1206 # Check whether user wants S/Key support
1209 [ --with-skey=PATH Enable S/Key support],
1211 if test "x$withval" != "xno" ; then
1213 if test "x$withval" != "xyes" ; then
1214 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1215 LDFLAGS="$LDFLAGS -L${withval}/lib"
1222 AC_CHECK_FUNC(skey_keyinfo,
1225 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1231 # Check whether user wants TCP wrappers support
1233 AC_ARG_WITH(tcp-wrappers,
1234 [ --with-tcp-wrappers Enable tcpwrappers support],
1236 if test "x$withval" != "xno" ; then
1239 AC_MSG_CHECKING(for libwrap)
1243 int deny_severity = 0, allow_severity = 0;
1252 AC_MSG_ERROR([*** libwrap missing])
1259 # Check whether to enable MD5 passwords
1261 AC_ARG_WITH(md5-passwords,
1262 [ --with-md5-passwords Enable use of MD5 passwords],
1264 if test "x$withval" != "xno" ; then
1265 AC_DEFINE(HAVE_MD5_PASSWORDS)
1271 # Whether to disable shadow password support
1273 [ --without-shadow Disable shadow password support],
1275 if test "x$withval" = "xno" ; then
1276 AC_DEFINE(DISABLE_SHADOW)
1282 if test -z "$disable_shadow" ; then
1283 AC_MSG_CHECKING([if the systems has expire shadow information])
1286 #include <sys/types.h>
1289 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1290 [ sp_expire_available=yes ], []
1293 if test "x$sp_expire_available" = "xyes" ; then
1295 AC_DEFINE(HAS_SHADOW_EXPIRE)
1301 # Use ip address instead of hostname in $DISPLAY
1302 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1303 DISPLAY_HACK_MSG="yes"
1304 AC_DEFINE(IPADDR_IN_DISPLAY)
1306 DISPLAY_HACK_MSG="no"
1307 AC_ARG_WITH(ipaddr-display,
1308 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1310 if test "x$withval" != "xno" ; then
1311 AC_DEFINE(IPADDR_IN_DISPLAY)
1312 DISPLAY_HACK_MSG="yes"
1318 # Whether to mess with the default path
1319 SERVER_PATH_MSG="(default)"
1320 AC_ARG_WITH(default-path,
1321 [ --with-default-path=PATH Specify default \$PATH environment for server],
1323 if test "x$withval" != "xno" ; then
1324 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1325 SERVER_PATH_MSG="$withval"
1330 # Whether to force IPv4 by default (needed on broken glibc Linux)
1332 AC_ARG_WITH(ipv4-default,
1333 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1335 if test "x$withval" != "xno" ; then
1336 AC_DEFINE(IPV4_DEFAULT)
1342 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1343 IPV4_IN6_HACK_MSG="no"
1345 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1347 if test "x$withval" != "xno" ; then
1349 AC_DEFINE(IPV4_IN_IPV6)
1350 IPV4_IN6_HACK_MSG="yes"
1355 if test "x$inet6_default_4in6" = "xyes"; then
1356 AC_MSG_RESULT([yes (default)])
1357 AC_DEFINE(IPV4_IN_IPV6)
1358 IPV4_IN6_HACK_MSG="yes"
1360 AC_MSG_RESULT([no (default)])
1365 AC_MSG_CHECKING(whether to install ssh as suid root)
1366 AC_ARG_ENABLE(suid-ssh,
1367 [ --enable-suid-ssh Install ssh as suid root (default)
1368 --disable-suid-ssh Install ssh without suid bit],
1369 [ case "$enableval" in
1374 *) AC_MSG_RESULT(yes)
1384 # Where to place sshd.pid
1386 AC_ARG_WITH(pid-dir,
1387 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1389 if test "x$withval" != "xno" ; then
1395 # make sure the directory exists
1396 if test ! -d $piddir ; then
1397 piddir=`eval echo ${sysconfdir}`
1399 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1403 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1406 dnl allow user to disable some login recording features
1407 AC_ARG_ENABLE(lastlog,
1408 [ --disable-lastlog disable use of lastlog even if detected [no]],
1409 [ AC_DEFINE(DISABLE_LASTLOG) ]
1412 [ --disable-utmp disable use of utmp even if detected [no]],
1413 [ AC_DEFINE(DISABLE_UTMP) ]
1415 AC_ARG_ENABLE(utmpx,
1416 [ --disable-utmpx disable use of utmpx even if detected [no]],
1417 [ AC_DEFINE(DISABLE_UTMPX) ]
1420 [ --disable-wtmp disable use of wtmp even if detected [no]],
1421 [ AC_DEFINE(DISABLE_WTMP) ]
1423 AC_ARG_ENABLE(wtmpx,
1424 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1425 [ AC_DEFINE(DISABLE_WTMPX) ]
1427 AC_ARG_ENABLE(libutil,
1428 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1429 [ AC_DEFINE(DISABLE_LOGIN) ]
1431 AC_ARG_ENABLE(pututline,
1432 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1433 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1435 AC_ARG_ENABLE(pututxline,
1436 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1437 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1439 AC_ARG_WITH(lastlog,
1440 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1441 [ conf_lastlog_location="$withval"; ],)
1443 dnl lastlog, [uw]tmpx? detection
1444 dnl NOTE: set the paths in the platform section to avoid the
1445 dnl need for command-line parameters
1446 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1448 dnl lastlog detection
1449 dnl NOTE: the code itself will detect if lastlog is a directory
1450 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1452 #include <sys/types.h>
1454 #ifdef HAVE_LASTLOG_H
1455 # include <lastlog.h>
1461 [ char *lastlog = LASTLOG_FILE; ],
1462 [ AC_MSG_RESULT(yes) ],
1465 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1467 #include <sys/types.h>
1469 #ifdef HAVE_LASTLOG_H
1470 # include <lastlog.h>
1476 [ char *lastlog = _PATH_LASTLOG; ],
1477 [ AC_MSG_RESULT(yes) ],
1480 system_lastlog_path=no
1485 if test -z "$conf_lastlog_location"; then
1486 if test x"$system_lastlog_path" = x"no" ; then
1487 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1488 if (test -d "$f" || test -f "$f") ; then
1489 conf_lastlog_location=$f
1492 if test -z "$conf_lastlog_location"; then
1493 AC_MSG_WARN([** Cannot find lastlog **])
1494 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1499 if test -n "$conf_lastlog_location"; then
1500 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1504 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1506 #include <sys/types.h>
1512 [ char *utmp = UTMP_FILE; ],
1513 [ AC_MSG_RESULT(yes) ],
1515 system_utmp_path=no ]
1517 if test -z "$conf_utmp_location"; then
1518 if test x"$system_utmp_path" = x"no" ; then
1519 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1520 if test -f $f ; then
1521 conf_utmp_location=$f
1524 if test -z "$conf_utmp_location"; then
1525 AC_DEFINE(DISABLE_UTMP)
1529 if test -n "$conf_utmp_location"; then
1530 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1534 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1536 #include <sys/types.h>
1542 [ char *wtmp = WTMP_FILE; ],
1543 [ AC_MSG_RESULT(yes) ],
1545 system_wtmp_path=no ]
1547 if test -z "$conf_wtmp_location"; then
1548 if test x"$system_wtmp_path" = x"no" ; then
1549 for f in /usr/adm/wtmp /var/log/wtmp; do
1550 if test -f $f ; then
1551 conf_wtmp_location=$f
1554 if test -z "$conf_wtmp_location"; then
1555 AC_DEFINE(DISABLE_WTMP)
1559 if test -n "$conf_wtmp_location"; then
1560 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1564 dnl utmpx detection - I don't know any system so perverse as to require
1565 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1567 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1569 #include <sys/types.h>
1578 [ char *utmpx = UTMPX_FILE; ],
1579 [ AC_MSG_RESULT(yes) ],
1581 system_utmpx_path=no ]
1583 if test -z "$conf_utmpx_location"; then
1584 if test x"$system_utmpx_path" = x"no" ; then
1585 AC_DEFINE(DISABLE_UTMPX)
1588 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1592 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1594 #include <sys/types.h>
1603 [ char *wtmpx = WTMPX_FILE; ],
1604 [ AC_MSG_RESULT(yes) ],
1606 system_wtmpx_path=no ]
1608 if test -z "$conf_wtmpx_location"; then
1609 if test x"$system_wtmpx_path" = x"no" ; then
1610 AC_DEFINE(DISABLE_WTMPX)
1613 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1617 # Change default command timeout for builtin PRNG
1619 AC_ARG_WITH(entropy-timeout,
1620 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1622 if test "x$withval" != "xno" ; then
1623 entropy_timeout=$withval
1627 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1630 if test ! -z "$blibpath" ; then
1631 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1632 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1637 AC_OUTPUT(Makefile ssh_prng_cmds)
1639 # Print summary of options
1641 if test x$MANTYPE = x'$(CATMAN)' ; then
1646 if test ! -z "$RANDOM_POOL" ; then
1647 RAND_MSG="Device ($RANDOM_POOL)"
1649 if test ! -z "$EGD_SOCKET" ; then
1650 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1652 RAND_MSG="Builtin (timeout $entropy_timeout)"
1657 # Someone please show me a better way :)
1658 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1659 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1660 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1661 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1662 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1663 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1664 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1667 echo "OpenSSH configured has been configured with the following options."
1668 echo " User binaries: $B"
1669 echo " User binaries: $B"
1670 echo " System binaries: $C"
1671 echo " Configuration files: $D"
1672 echo " Askpass program: $E"
1673 echo " Manual pages: $F"
1674 echo " PID file: $G"
1675 echo " Random number collection: $RAND_MSG"
1676 echo " Manpage format: $MAN_MSG"
1677 echo " PAM support: ${PAM_MSG}"
1678 echo " KerberosIV support: $KRB4_MSG"
1679 echo " AFS support: $AFS_MSG"
1680 echo " S/KEY support: $SKEY_MSG"
1681 echo " TCP Wrappers support: $TCPW_MSG"
1682 echo " MD5 password support: $MD5_MSG"
1683 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1684 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1685 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1689 echo " Host: ${host}"
1690 echo " Compiler: ${CC}"
1691 echo " Compiler flags: ${CFLAGS}"
1692 echo "Preprocessor flags: ${CPPFLAGS}"
1693 echo " Linker flags: ${LDFLAGS}"
1694 echo " Libraries: ${LIBS}"
1698 if test "x$PAM_MSG" = "xyes" ; then
1699 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1700 echo "otherwise password authentication may fail. Example PAM control files"
1701 echo "can be found in the contrib/ subdirectory"
1705 if test ! -z "$BUILTIN_RNG" ; then
1706 echo "WARNING: you are using the builtin random number collection service."
1707 echo "Please read WARNING.RNG and request that your OS vendor includes"
1708 echo "/dev/random in future versions of their OS."
1712 if test ! -z "$NO_SFTP"; then
1713 echo "sftp-server will be disabled. Your compiler does not support"
1714 echo "64bit integers."