3 AC_CONFIG_HEADER(config.h)
12 AC_PATH_PROG(PERL, perl)
14 AC_PATH_PROG(ENT, ent)
16 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
17 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
18 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
19 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
21 if test -z "$AR" ; then
22 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
25 # Use LOGIN_PROGRAM from environment if possible
26 if test ! -z "$LOGIN_PROGRAM" ; then
27 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
30 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
31 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
32 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
36 if test -z "$LD" ; then
43 if test "$GCC" = "yes"; then
44 CFLAGS="$CFLAGS -Wall"
47 # Check for some target-specific stuff
51 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
52 LDFLAGS="$LDFLAGS -L/usr/local/lib"
53 if (test "$LD" != "gcc" && test -z "$blibpath"); then
54 blibpath="/usr/lib:/lib:/usr/local/lib"
56 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
57 AC_DEFINE(BROKEN_GETADDRINFO)
60 dnl AIX handles lastlog as part of its login message
61 AC_DEFINE(DISABLE_LASTLOG)
66 LIBS="$LIBS -lregex /usr/lib/textmode.o"
67 AC_DEFINE(HAVE_CYGWIN)
68 AC_DEFINE(DISABLE_SHADOW)
69 AC_DEFINE(IPV4_DEFAULT)
70 AC_DEFINE(IP_TOS_IS_BROKEN)
71 AC_DEFINE(BROKEN_VHANGUP)
76 if test -z "$GCC"; then
79 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
82 AC_DEFINE(DISABLE_SHADOW)
83 AC_DEFINE(DISABLE_UTMP)
84 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)
102 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
104 PATH="$PATH:/usr/etc"
108 AC_DEFINE(BROKEN_INET_NTOA)
111 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
113 PATH="$PATH:/usr/etc"
115 AC_DEFINE(WITH_IRIX_ARRAY)
116 AC_DEFINE(WITH_IRIX_PROJECT)
117 AC_DEFINE(WITH_IRIX_AUDIT)
118 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
121 AC_DEFINE(BROKEN_INET_NTOA)
126 check_for_libcrypt_later=1
127 AC_DEFINE(DONT_TRY_OTHER_AF)
128 AC_DEFINE(PAM_TTY_KLUDGE)
129 inet6_default_4in6=yes
131 mips-sony-bsd|mips-sony-newsos4)
132 AC_DEFINE(HAVE_NEWS4)
134 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
135 AC_MSG_ERROR([*** libiberty missing - please install first ***])
142 conf_lastlog_location="/usr/adm/lastlog"
143 conf_utmp_location=/etc/utmp
144 conf_wtmp_location=/usr/adm/wtmp
147 AC_DEFINE(BROKEN_REALPATH)
149 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
153 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
154 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
156 AC_DEFINE(PAM_SUN_CODEBASE)
157 # hardwire lastlog location (can't detect it on some versions)
158 conf_lastlog_location="/var/adm/lastlog"
159 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
160 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
161 if test "$sol2ver" -ge 8; then
163 AC_DEFINE(DISABLE_UTMP)
164 AC_DEFINE(DISABLE_WTMP)
170 CPPFLAGS="$CPPFLAGS -DSUNOS4"
171 AC_CHECK_FUNCS(getpwanam)
172 AC_DEFINE(PAM_SUN_CODEBASE)
173 conf_utmp_location=/etc/utmp
174 conf_wtmp_location=/var/adm/wtmp
175 conf_lastlog_location=/var/adm/lastlog
181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
182 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
184 IPADDR_IN_DISPLAY=yes
186 AC_DEFINE(IP_TOS_IS_BROKEN)
188 LIBS="$LIBS -lgen -lnsl -lucb"
191 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
192 LDFLAGS="$LDFLAGS -L/usr/local/lib"
198 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
199 LDFLAGS="$LDFLAGS -L/usr/local/lib"
205 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
206 LDFLAGS="$LDFLAGS -L/usr/local/lib"
209 LIBS="$LIBS -lgen -lsocket"
213 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
214 LDFLAGS="$LDFLAGS -L/usr/local/lib"
217 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
220 AC_DEFINE(BROKEN_SYS_TERMIO_H)
221 rsh_path="/usr/bin/rcmd"
222 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
223 AC_DEFINE(DISABLE_SHADOW)
224 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
228 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
229 LDFLAGS="$LDFLAGS -L/usr/local/lib"
232 LIBS="$LIBS -lprot -lx -ltinfo -lm"
234 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)
241 if test ! -z "USE_SIA" ; then
242 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
243 if test -f /etc/sia/matrix.conf; then
245 AC_DEFINE(HAVE_OSF_SIA)
246 AC_DEFINE(DISABLE_LOGIN)
247 LIBS="$LIBS -lsecurity -ldb -lm -laud"
255 # Allow user to specify flags
257 [ --with-cflags Specify additional flags to pass to compiler],
259 if test "x$withval" != "xno" ; then
260 CFLAGS="$CFLAGS $withval"
264 AC_ARG_WITH(cppflags,
265 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
267 if test "x$withval" != "xno"; then
268 CPPFLAGS="$CPPFLAGS $withval"
273 [ --with-ldflags Specify additional flags to pass to linker],
275 if test "x$withval" != "xno" ; then
276 LDFLAGS="$LDFLAGS $withval"
281 [ --with-libs Specify additional libraries to link with],
283 if test "x$withval" != "xno" ; then
284 LIBS="$LIBS $withval"
290 # Checks for libraries.
291 if test -z "$no_libsocket" ; then
292 AC_CHECK_LIB(nsl, yp_match, , )
294 if test -z "$no_libnsl" ; then
295 AC_CHECK_LIB(socket, main, , )
298 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
299 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
300 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
302 AC_CHECK_FUNC(regcomp,
303 [ AC_DEFINE(HAVE_REGCOMP)],
305 AC_CHECK_LIB(pcre, pcre_info,
306 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
311 AC_CHECK_FUNC(strcasecmp,
312 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
314 AC_CHECK_FUNC(utimes,
315 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
318 # Checks for header files.
319 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)
321 dnl Checks for library functions.
322 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 tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
323 dnl Checks for time functions
324 AC_CHECK_FUNCS(gettimeofday time)
325 dnl Checks for libutil functions
326 AC_CHECK_HEADERS(libutil.h)
327 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
328 dnl Checks for utmp functions
329 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
330 AC_CHECK_FUNCS(utmpname)
331 dnl Checks for utmpx functions
332 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
333 AC_CHECK_FUNCS(setutxent utmpxname)
335 AC_CHECK_FUNC(getuserattr,
336 [AC_DEFINE(HAVE_GETUSERATTR)],
337 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
341 [AC_DEFINE(HAVE_LOGIN)],
342 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
345 AC_CHECK_FUNC(daemon,
346 [AC_DEFINE(HAVE_DAEMON)],
347 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
350 AC_CHECK_FUNC(getpagesize,
351 [AC_DEFINE(HAVE_GETPAGESIZE)],
352 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
355 # Check for broken snprintf
356 if test "x$ac_cv_func_snprintf" = "xyes" ; then
357 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
361 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
363 [AC_MSG_RESULT(yes)],
366 AC_DEFINE(BROKEN_SNPRINTF)
367 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
379 [ --with-pam Enable PAM support ],
381 if test "x$withval" != "xno" ; then
382 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
383 AC_MSG_ERROR([PAM headers not found])
386 AC_CHECK_LIB(dl, dlopen, , )
387 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
388 AC_CHECK_FUNCS(pam_getenvlist)
398 # Check for older PAM
399 if test "x$PAM_MSG" = "xyes" ; then
400 # Check PAM strerror arguments (old PAM)
401 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
405 #include <security/pam_appl.h>
407 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
410 AC_DEFINE(HAVE_OLD_PAM)
412 PAM_MSG="yes (old library)"
417 # The big search for OpenSSL
419 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
421 if test "x$withval" != "xno" ; then
428 saved_LDFLAGS="$LDFLAGS"
429 saved_CPPFLAGS="$CPPFLAGS"
430 if test "x$prefix" != "xNONE" ; then
431 tryssldir="$tryssldir $prefix"
433 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
435 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
436 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
437 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
438 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
439 if test ! -z "$need_dash_r" ; then
440 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
443 LDFLAGS="$saved_LDFLAGS"
446 LIBS="$saved_LIBS -lcrypto"
448 # Basic test to check for compatible version and correct linking
449 # *does not* test for RSA - that comes later.
453 #include <openssl/rand.h>
457 memset(a, 0, sizeof(a));
458 RAND_add(a, sizeof(a), sizeof(a));
459 return(RAND_status() <= 0);
468 if test ! -z "$found_crypto" ; then
473 if test -z "$found_crypto" ; then
474 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
476 if test -z "$ssldir" ; then
480 ac_cv_openssldir=$ssldir
483 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
484 AC_DEFINE(HAVE_OPENSSL)
485 dnl Need to recover ssldir - test above runs in subshell
486 ssldir=$ac_cv_openssldir
488 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
489 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
490 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
491 if test ! -z "$need_dash_r" ; then
492 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
494 if test ! -z "$blibpath" ; then
495 blibpath="$blibpath:$ssldir:$ssldir/lib"
499 LIBS="$saved_LIBS -lcrypto"
501 # Now test RSA support
503 AC_MSG_CHECKING([for RSA support])
504 for WANTS_RSAREF in "" 1 ; do
505 if test -z "$WANTS_RSAREF" ; then
508 LIBS="$saved_LIBS -lRSAglue -lrsaref"
512 #include <openssl/rand.h>
513 #include <openssl/rsa.h>
514 #include <openssl/bn.h>
515 #include <openssl/sha.h>
518 int num; RSA *key; static unsigned char p_in[] = "blahblah";
519 unsigned char c[256], p[256];
520 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
521 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
522 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
523 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
532 if test ! -z "$no_rsa" ; then
533 AC_MSG_RESULT(disabled)
536 if test -z "$rsa_works" ; then
537 AC_MSG_WARN([*** No RSA support found *** ])
540 if test -z "$WANTS_RSAREF" ; then
544 RSA_MSG="yes (using RSAref)"
545 AC_MSG_RESULT(using RSAref)
546 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
551 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
552 # version in OpenSSL. Skip this for PAM
553 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
554 AC_CHECK_LIB(crypt, crypt, , )
557 # Cheap hack to ensure NEWS-OS libraries are arranged right.
558 if test ! -z "$SONY" ; then
559 LIBS="$LIBS -liberty";
562 # Checks for data types
563 AC_CHECK_SIZEOF(char, 1)
564 AC_CHECK_SIZEOF(short int, 2)
565 AC_CHECK_SIZEOF(int, 4)
566 AC_CHECK_SIZEOF(long int, 4)
567 AC_CHECK_SIZEOF(long long int, 8)
569 # More checks for data types
570 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
572 [ #include <sys/types.h> ],
574 [ ac_cv_have_u_int="yes" ],
575 [ ac_cv_have_u_int="no" ]
578 if test "x$ac_cv_have_u_int" = "xyes" ; then
579 AC_DEFINE(HAVE_U_INT)
583 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
585 [ #include <sys/types.h> ],
586 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
587 [ ac_cv_have_intxx_t="yes" ],
588 [ ac_cv_have_intxx_t="no" ]
591 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
592 AC_DEFINE(HAVE_INTXX_T)
596 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
598 [ #include <sys/types.h> ],
599 [ int64_t a; a = 1;],
600 [ ac_cv_have_int64_t="yes" ],
601 [ ac_cv_have_int64_t="no" ]
604 if test "x$ac_cv_have_int64_t" = "xyes" ; then
605 AC_DEFINE(HAVE_INT64_T)
609 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
611 [ #include <sys/types.h> ],
612 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
613 [ ac_cv_have_u_intxx_t="yes" ],
614 [ ac_cv_have_u_intxx_t="no" ]
617 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
618 AC_DEFINE(HAVE_U_INTXX_T)
622 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
624 [ #include <sys/types.h> ],
625 [ u_int64_t a; a = 1;],
626 [ ac_cv_have_u_int64_t="yes" ],
627 [ ac_cv_have_u_int64_t="no" ]
630 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
631 AC_DEFINE(HAVE_U_INT64_T)
635 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
636 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
638 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
641 #include <sys/bitypes.h>
644 int8_t a; int16_t b; int32_t c;
645 u_int8_t e; u_int16_t f; u_int32_t g;
646 a = b = c = e = f = g = 1;
649 AC_DEFINE(HAVE_U_INTXX_T)
650 AC_DEFINE(HAVE_INTXX_T)
657 if test -z "$have_u_intxx_t" ; then
658 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
661 #include <sys/types.h>
663 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
664 [ ac_cv_have_uintxx_t="yes" ],
665 [ ac_cv_have_uintxx_t="no" ]
668 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
669 AC_DEFINE(HAVE_UINTXX_T)
673 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
676 #include <sys/types.h>
677 #include <sys/socket.h>
679 [socklen_t foo; foo = 1235;],
680 [ ac_cv_have_socklen_t="yes" ],
681 [ ac_cv_have_socklen_t="no" ]
684 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
685 AC_DEFINE(HAVE_SOCKLEN_T)
688 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
691 #include <sys/types.h>
693 [ size_t foo; foo = 1235; ],
694 [ ac_cv_have_size_t="yes" ],
695 [ ac_cv_have_size_t="no" ]
698 if test "x$ac_cv_have_size_t" = "xyes" ; then
699 AC_DEFINE(HAVE_SIZE_T)
702 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
705 #include <sys/types.h>
707 [ ssize_t foo; foo = 1235; ],
708 [ ac_cv_have_ssize_t="yes" ],
709 [ ac_cv_have_ssize_t="no" ]
712 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
713 AC_DEFINE(HAVE_SSIZE_T)
716 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
721 [ clock_t foo; foo = 1235; ],
722 [ ac_cv_have_clock_t="yes" ],
723 [ ac_cv_have_clock_t="no" ]
726 if test "x$ac_cv_have_clock_t" = "xyes" ; then
727 AC_DEFINE(HAVE_CLOCK_T)
730 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
733 #include <sys/types.h>
734 #include <sys/socket.h>
736 [ sa_family_t foo; foo = 1235; ],
737 [ ac_cv_have_sa_family_t="yes" ],
740 #include <sys/types.h>
741 #include <sys/socket.h>
742 #include <netinet/in.h>
744 [ sa_family_t foo; foo = 1235; ],
745 [ ac_cv_have_sa_family_t="yes" ],
747 [ ac_cv_have_sa_family_t="no" ]
751 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
752 AC_DEFINE(HAVE_SA_FAMILY_T)
755 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
758 #include <sys/types.h>
760 [ pid_t foo; foo = 1235; ],
761 [ ac_cv_have_pid_t="yes" ],
762 [ ac_cv_have_pid_t="no" ]
765 if test "x$ac_cv_have_pid_t" = "xyes" ; then
766 AC_DEFINE(HAVE_PID_T)
769 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
772 #include <sys/types.h>
774 [ mode_t foo; foo = 1235; ],
775 [ ac_cv_have_mode_t="yes" ],
776 [ ac_cv_have_mode_t="no" ]
779 if test "x$ac_cv_have_mode_t" = "xyes" ; then
780 AC_DEFINE(HAVE_MODE_T)
784 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
787 #include <sys/types.h>
788 #include <sys/socket.h>
790 [ struct sockaddr_storage s; ],
791 [ ac_cv_have_struct_sockaddr_storage="yes" ],
792 [ ac_cv_have_struct_sockaddr_storage="no" ]
795 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
796 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
799 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
802 #include <sys/types.h>
803 #include <netinet/in.h>
805 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
806 [ ac_cv_have_struct_sockaddr_in6="yes" ],
807 [ ac_cv_have_struct_sockaddr_in6="no" ]
810 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
811 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
814 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
817 #include <sys/types.h>
818 #include <netinet/in.h>
820 [ struct in6_addr s; s.s6_addr[0] = 0; ],
821 [ ac_cv_have_struct_in6_addr="yes" ],
822 [ ac_cv_have_struct_in6_addr="no" ]
825 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
826 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
829 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
832 #include <sys/types.h>
833 #include <sys/socket.h>
836 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
837 [ ac_cv_have_struct_addrinfo="yes" ],
838 [ ac_cv_have_struct_addrinfo="no" ]
841 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
842 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
845 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
847 [ #include <sys/time.h> ],
848 [ struct timeval tv; tv.tv_sec = 1;],
849 [ ac_cv_have_struct_timeval="yes" ],
850 [ ac_cv_have_struct_timeval="no" ]
853 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
854 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
855 have_struct_timeval=1
858 # If we don't have int64_t then we can't compile sftp-server. So don't
859 # even attempt to do it.
860 if test "x$ac_cv_have_int64_t" = "xno" -a \
861 "x$ac_cv_sizeof_long_int" != "x8" -a \
862 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
867 dnl Checks for structure members
868 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
869 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
870 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
871 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
872 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
873 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
874 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
875 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
876 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
877 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
878 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
879 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
880 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
881 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
882 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
883 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
884 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
887 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
888 ac_cv_have_sun_len_in_struct_sockaddr_un, [
891 #include <sys/types.h>
892 #include <sys/socket.h>
894 [ struct sockaddr_un s; s.sun_len = 1; ],
895 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
896 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
899 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
900 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
903 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
904 ac_cv_have_ss_family_in_struct_ss, [
907 #include <sys/types.h>
908 #include <sys/socket.h>
910 [ struct sockaddr_storage s; s.ss_family = 1; ],
911 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
912 [ ac_cv_have_ss_family_in_struct_ss="no" ],
915 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
916 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
919 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
920 ac_cv_have___ss_family_in_struct_ss, [
923 #include <sys/types.h>
924 #include <sys/socket.h>
926 [ struct sockaddr_storage s; s.__ss_family = 1; ],
927 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
928 [ ac_cv_have___ss_family_in_struct_ss="no" ]
931 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
932 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
935 AC_CACHE_CHECK([for pw_class field in struct passwd],
936 ac_cv_have_pw_class_in_struct_passwd, [
941 [ struct passwd p; p.pw_class = 0; ],
942 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
943 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
946 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
947 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
951 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
953 [ extern char *__progname; printf("%s", __progname); ],
954 [ ac_cv_libc_defines___progname="yes" ],
955 [ ac_cv_libc_defines___progname="no" ]
958 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
959 AC_DEFINE(HAVE___PROGNAME)
963 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
965 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
966 [ ac_cv_libc_defines_sys_errlist="yes" ],
967 [ ac_cv_libc_defines_sys_errlist="no" ]
970 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
971 AC_DEFINE(HAVE_SYS_ERRLIST)
975 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
977 [ extern int sys_nerr; printf("%i", sys_nerr);],
978 [ ac_cv_libc_defines_sys_nerr="yes" ],
979 [ ac_cv_libc_defines_sys_nerr="no" ]
982 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
983 AC_DEFINE(HAVE_SYS_NERR)
987 # Looking for programs, paths and files
989 [ --with-rsh=PATH Specify path to remote shell program ],
991 if test "x$withval" != "$no" ; then
996 AC_PATH_PROG(rsh_path, rsh)
1001 [ --with-xauth=PATH Specify path to xauth program ],
1003 if test "x$withval" != "xno" ; then
1008 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1009 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1010 xauth_path="/usr/openwin/bin/xauth"
1015 if test -z "$xauth_path" ; then
1016 XAUTH_PATH="undefined"
1017 AC_SUBST(XAUTH_PATH)
1019 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1020 XAUTH_PATH=$xauth_path
1021 AC_SUBST(XAUTH_PATH)
1023 if test ! -z "$rsh_path" ; then
1024 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1027 # Check for mail directory (last resort if we cannot get it from headers)
1028 if test ! -z "$MAIL" ; then
1029 maildir=`dirname $MAIL`
1030 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1033 if test -z "$no_dev_ptmx" ; then
1034 AC_CHECK_FILE("/dev/ptmx",
1036 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1041 AC_CHECK_FILE("/dev/ptc",
1043 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1048 # Options from here on. Some of these are preset by platform above
1050 # Check for user-specified random device, otherwise check /dev/urandom
1052 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1054 if test "x$withval" != "xno" ; then
1055 RANDOM_POOL="$withval";
1056 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1060 # Check for random device
1061 AC_CHECK_FILE("/dev/urandom",
1063 RANDOM_POOL="/dev/urandom";
1064 AC_SUBST(RANDOM_POOL)
1065 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1071 # Check for EGD pool file
1072 AC_ARG_WITH(egd-pool,
1073 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1075 if test "x$withval" != "xno" ; then
1076 EGD_SOCKET="$withval";
1077 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1081 # Check for existing socket only if we don't have a random device already
1082 if test -z "$RANDOM_POOL" ; then
1083 AC_MSG_CHECKING(for PRNGD/EGD socket)
1084 # Insert other locations here
1085 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1086 if $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
1087 EGD_SOCKET="$egdsock"
1088 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1092 if test -x "$EGD_SOCKET" ; then
1093 AC_MSG_RESULT($EGD_SOCKET)
1095 AC_MSG_RESULT(not found)
1102 # detect pathnames for entropy gathering commands, if we need them
1103 INSTALL_SSH_PRNG_CMDS=""
1105 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1106 # Use these commands to collect entropy
1107 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1108 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1109 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1110 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1111 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1112 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1113 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1114 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1115 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1116 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1117 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1118 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1119 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1120 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1122 INSTALL_SSH_PRNG_CMDS="yes"
1124 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1128 [ --with-catman=man|cat Install preformatted manpages[no]],
1131 if test x"$withval" != x"yes" ; then
1137 if test -z "$MANTYPE" ; then
1138 MANTYPE='$(TROFFMAN)'
1146 # Check whether user wants Kerberos support
1148 AC_ARG_WITH(kerberos4,
1149 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1151 if test "x$withval" != "xno" ; then
1153 if test "x$withval" != "xyes" ; then
1154 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1155 LDFLAGS="$LDFLAGS -L${withval}/lib"
1156 if test ! -z "$need_dash_r" ; then
1157 LDFLAGS="$LDFLAGS -R${withval}/lib"
1159 if test ! -z "$blibpath" ; then
1160 blibpath="$blibpath:${withval}/lib"
1163 if test -d /usr/include/kerberosIV ; then
1164 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1168 AC_CHECK_HEADERS(krb.h)
1169 AC_CHECK_LIB(krb, main)
1170 if test "$ac_cv_header_krb_h" != yes; then
1171 AC_MSG_WARN([Cannot find krb.h, build may fail])
1173 if test "$ac_cv_lib_krb_main" != yes; then
1174 AC_MSG_WARN([Cannot find libkrb, build may fail])
1178 AC_CHECK_LIB(resolv, dn_expand, , )
1186 # Check whether user wants AFS support
1189 [ --with-afs=PATH Enable AFS support],
1191 if test "x$withval" != "xno" ; then
1193 if test "x$withval" != "xyes" ; then
1194 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1195 LDFLAGS="$LDFLAGS -L${withval}/lib"
1198 if test -z "$KRB4" ; then
1199 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1203 if test ! -z "$AFS_LIBS" ; then
1204 LIBS="$LIBS $AFS_LIBS"
1213 # Check whether user wants S/Key support
1216 [ --with-skey=PATH Enable S/Key support],
1218 if test "x$withval" != "xno" ; then
1220 if test "x$withval" != "xyes" ; then
1221 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1222 LDFLAGS="$LDFLAGS -L${withval}/lib"
1229 AC_CHECK_FUNC(skey_keyinfo,
1232 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1238 # Check whether user wants TCP wrappers support
1240 AC_ARG_WITH(tcp-wrappers,
1241 [ --with-tcp-wrappers Enable tcpwrappers support],
1243 if test "x$withval" != "xno" ; then
1246 AC_MSG_CHECKING(for libwrap)
1250 int deny_severity = 0, allow_severity = 0;
1259 AC_MSG_ERROR([*** libwrap missing])
1266 # Check whether to enable MD5 passwords
1268 AC_ARG_WITH(md5-passwords,
1269 [ --with-md5-passwords Enable use of MD5 passwords],
1271 if test "x$withval" != "xno" ; then
1272 AC_DEFINE(HAVE_MD5_PASSWORDS)
1278 # Whether to disable shadow password support
1280 [ --without-shadow Disable shadow password support],
1282 if test "x$withval" = "xno" ; then
1283 AC_DEFINE(DISABLE_SHADOW)
1289 if test -z "$disable_shadow" ; then
1290 AC_MSG_CHECKING([if the systems has expire shadow information])
1293 #include <sys/types.h>
1296 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1297 [ sp_expire_available=yes ], []
1300 if test "x$sp_expire_available" = "xyes" ; then
1302 AC_DEFINE(HAS_SHADOW_EXPIRE)
1308 # Use ip address instead of hostname in $DISPLAY
1309 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1310 DISPLAY_HACK_MSG="yes"
1311 AC_DEFINE(IPADDR_IN_DISPLAY)
1313 DISPLAY_HACK_MSG="no"
1314 AC_ARG_WITH(ipaddr-display,
1315 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1317 if test "x$withval" != "xno" ; then
1318 AC_DEFINE(IPADDR_IN_DISPLAY)
1319 DISPLAY_HACK_MSG="yes"
1325 # Whether to mess with the default path
1326 SERVER_PATH_MSG="(default)"
1327 AC_ARG_WITH(default-path,
1328 [ --with-default-path=PATH Specify default \$PATH environment for server],
1330 if test "x$withval" != "xno" ; then
1331 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1332 SERVER_PATH_MSG="$withval"
1337 # Whether to force IPv4 by default (needed on broken glibc Linux)
1339 AC_ARG_WITH(ipv4-default,
1340 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1342 if test "x$withval" != "xno" ; then
1343 AC_DEFINE(IPV4_DEFAULT)
1349 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1350 IPV4_IN6_HACK_MSG="no"
1352 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1354 if test "x$withval" != "xno" ; then
1356 AC_DEFINE(IPV4_IN_IPV6)
1357 IPV4_IN6_HACK_MSG="yes"
1362 if test "x$inet6_default_4in6" = "xyes"; then
1363 AC_MSG_RESULT([yes (default)])
1364 AC_DEFINE(IPV4_IN_IPV6)
1365 IPV4_IN6_HACK_MSG="yes"
1367 AC_MSG_RESULT([no (default)])
1372 AC_MSG_CHECKING(whether to install ssh as suid root)
1373 AC_ARG_ENABLE(suid-ssh,
1374 [ --enable-suid-ssh Install ssh as suid root (default)
1375 --disable-suid-ssh Install ssh without suid bit],
1376 [ case "$enableval" in
1381 *) AC_MSG_RESULT(yes)
1391 # Where to place sshd.pid
1393 AC_ARG_WITH(pid-dir,
1394 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1396 if test "x$withval" != "xno" ; then
1402 # make sure the directory exists
1403 if test ! -d $piddir ; then
1404 piddir=`eval echo ${sysconfdir}`
1406 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1410 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1413 dnl allow user to disable some login recording features
1414 AC_ARG_ENABLE(lastlog,
1415 [ --disable-lastlog disable use of lastlog even if detected [no]],
1416 [ AC_DEFINE(DISABLE_LASTLOG) ]
1419 [ --disable-utmp disable use of utmp even if detected [no]],
1420 [ AC_DEFINE(DISABLE_UTMP) ]
1422 AC_ARG_ENABLE(utmpx,
1423 [ --disable-utmpx disable use of utmpx even if detected [no]],
1424 [ AC_DEFINE(DISABLE_UTMPX) ]
1427 [ --disable-wtmp disable use of wtmp even if detected [no]],
1428 [ AC_DEFINE(DISABLE_WTMP) ]
1430 AC_ARG_ENABLE(wtmpx,
1431 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1432 [ AC_DEFINE(DISABLE_WTMPX) ]
1434 AC_ARG_ENABLE(libutil,
1435 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1436 [ AC_DEFINE(DISABLE_LOGIN) ]
1438 AC_ARG_ENABLE(pututline,
1439 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1440 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1442 AC_ARG_ENABLE(pututxline,
1443 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1444 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1446 AC_ARG_WITH(lastlog,
1447 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1449 if test "x$withval" = "xno" ; then
1450 AC_DEFINE(DISABLE_LASTLOG)
1452 conf_lastlog_location=$withval
1457 dnl lastlog, [uw]tmpx? detection
1458 dnl NOTE: set the paths in the platform section to avoid the
1459 dnl need for command-line parameters
1460 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1462 dnl lastlog detection
1463 dnl NOTE: the code itself will detect if lastlog is a directory
1464 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1466 #include <sys/types.h>
1468 #ifdef HAVE_LASTLOG_H
1469 # include <lastlog.h>
1475 [ char *lastlog = LASTLOG_FILE; ],
1476 [ AC_MSG_RESULT(yes) ],
1479 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1481 #include <sys/types.h>
1483 #ifdef HAVE_LASTLOG_H
1484 # include <lastlog.h>
1490 [ char *lastlog = _PATH_LASTLOG; ],
1491 [ AC_MSG_RESULT(yes) ],
1494 system_lastlog_path=no
1499 if test -z "$conf_lastlog_location"; then
1500 if test x"$system_lastlog_path" = x"no" ; then
1501 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1502 if (test -d "$f" || test -f "$f") ; then
1503 conf_lastlog_location=$f
1506 if test -z "$conf_lastlog_location"; then
1507 AC_MSG_WARN([** Cannot find lastlog **])
1508 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1513 if test -n "$conf_lastlog_location"; then
1514 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1518 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1520 #include <sys/types.h>
1526 [ char *utmp = UTMP_FILE; ],
1527 [ AC_MSG_RESULT(yes) ],
1529 system_utmp_path=no ]
1531 if test -z "$conf_utmp_location"; then
1532 if test x"$system_utmp_path" = x"no" ; then
1533 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1534 if test -f $f ; then
1535 conf_utmp_location=$f
1538 if test -z "$conf_utmp_location"; then
1539 AC_DEFINE(DISABLE_UTMP)
1543 if test -n "$conf_utmp_location"; then
1544 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1548 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1550 #include <sys/types.h>
1556 [ char *wtmp = WTMP_FILE; ],
1557 [ AC_MSG_RESULT(yes) ],
1559 system_wtmp_path=no ]
1561 if test -z "$conf_wtmp_location"; then
1562 if test x"$system_wtmp_path" = x"no" ; then
1563 for f in /usr/adm/wtmp /var/log/wtmp; do
1564 if test -f $f ; then
1565 conf_wtmp_location=$f
1568 if test -z "$conf_wtmp_location"; then
1569 AC_DEFINE(DISABLE_WTMP)
1573 if test -n "$conf_wtmp_location"; then
1574 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1578 dnl utmpx detection - I don't know any system so perverse as to require
1579 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1581 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1583 #include <sys/types.h>
1592 [ char *utmpx = UTMPX_FILE; ],
1593 [ AC_MSG_RESULT(yes) ],
1595 system_utmpx_path=no ]
1597 if test -z "$conf_utmpx_location"; then
1598 if test x"$system_utmpx_path" = x"no" ; then
1599 AC_DEFINE(DISABLE_UTMPX)
1602 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1606 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1608 #include <sys/types.h>
1617 [ char *wtmpx = WTMPX_FILE; ],
1618 [ AC_MSG_RESULT(yes) ],
1620 system_wtmpx_path=no ]
1622 if test -z "$conf_wtmpx_location"; then
1623 if test x"$system_wtmpx_path" = x"no" ; then
1624 AC_DEFINE(DISABLE_WTMPX)
1627 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1631 # Change default command timeout for builtin PRNG
1633 AC_ARG_WITH(entropy-timeout,
1634 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1636 if test "x$withval" != "xno" ; then
1637 entropy_timeout=$withval
1641 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1644 if test ! -z "$blibpath" ; then
1645 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1646 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1651 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1653 # Print summary of options
1655 if test x$MANTYPE = x'$(CATMAN)' ; then
1660 if test ! -z "$RANDOM_POOL" ; then
1661 RAND_MSG="Device ($RANDOM_POOL)"
1663 if test ! -z "$EGD_SOCKET" ; then
1664 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1666 RAND_MSG="Builtin (timeout $entropy_timeout)"
1671 # Someone please show me a better way :)
1672 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1673 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1674 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1675 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1676 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1677 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1678 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1681 echo "OpenSSH configured has been configured with the following options."
1682 echo " User binaries: $B"
1683 echo " System binaries: $C"
1684 echo " Configuration files: $D"
1685 echo " Askpass program: $E"
1686 echo " Manual pages: $F"
1687 echo " PID file: $G"
1688 echo " Random number collection: $RAND_MSG"
1689 echo " Manpage format: $MAN_MSG"
1690 echo " PAM support: ${PAM_MSG}"
1691 echo " KerberosIV support: $KRB4_MSG"
1692 echo " AFS support: $AFS_MSG"
1693 echo " S/KEY support: $SKEY_MSG"
1694 echo " TCP Wrappers support: $TCPW_MSG"
1695 echo " MD5 password support: $MD5_MSG"
1696 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1697 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1698 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1702 echo " Host: ${host}"
1703 echo " Compiler: ${CC}"
1704 echo " Compiler flags: ${CFLAGS}"
1705 echo "Preprocessor flags: ${CPPFLAGS}"
1706 echo " Linker flags: ${LDFLAGS}"
1707 echo " Libraries: ${LIBS}"
1711 if test "x$PAM_MSG" = "xyes" ; then
1712 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1713 echo "otherwise password authentication may fail. Example PAM control files"
1714 echo "can be found in the contrib/ subdirectory"
1718 if test ! -z "$BUILTIN_RNG" ; then
1719 echo "WARNING: you are using the builtin random number collection service."
1720 echo "Please read WARNING.RNG and request that your OS vendor includes"
1721 echo "/dev/random in future versions of their OS."
1725 if test ! -z "$NO_SFTP"; then
1726 echo "sftp-server will be disabled. Your compiler does not support"
1727 echo "64bit integers."