5 AC_CONFIG_HEADER(config.h)
14 AC_PATH_PROG(PERL, perl)
16 AC_PATH_PROG(ENT, ent)
18 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
19 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
20 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
21 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
23 if test -z "$AR" ; then
24 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
27 # Use LOGIN_PROGRAM from environment if possible
28 if test ! -z "$LOGIN_PROGRAM" ; then
29 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
32 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
33 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
38 if test -z "$LD" ; then
45 if test "$GCC" = "yes"; then
46 CFLAGS="$CFLAGS -Wall"
49 # Check for some target-specific stuff
53 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
54 LDFLAGS="$LDFLAGS -L/usr/local/lib"
55 if (test "$LD" != "gcc" && test -z "$blibpath"); then
56 blibpath="/usr/lib:/lib:/usr/local/lib"
58 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
59 AC_DEFINE(BROKEN_GETADDRINFO)
62 dnl AIX handles lastlog as part of its login message
63 AC_DEFINE(DISABLE_LASTLOG)
68 LIBS="$LIBS -lregex /usr/lib/textmode.o"
69 AC_DEFINE(HAVE_CYGWIN)
70 AC_DEFINE(DISABLE_SHADOW)
71 AC_DEFINE(IPV4_DEFAULT)
72 AC_DEFINE(IP_TOS_IS_BROKEN)
73 AC_DEFINE(BROKEN_VHANGUP)
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)
92 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
94 AC_DEFINE(PAM_SUN_CODEBASE)
96 AC_DEFINE(DISABLE_SHADOW)
97 AC_DEFINE(DISABLE_UTMP)
98 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
104 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
106 PATH="$PATH:/usr/etc"
110 AC_DEFINE(BROKEN_INET_NTOA)
113 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
115 PATH="$PATH:/usr/etc"
117 AC_DEFINE(WITH_IRIX_ARRAY)
118 AC_DEFINE(WITH_IRIX_PROJECT)
119 AC_DEFINE(WITH_IRIX_AUDIT)
120 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
123 AC_DEFINE(BROKEN_INET_NTOA)
128 check_for_libcrypt_later=1
129 AC_DEFINE(DONT_TRY_OTHER_AF)
130 AC_DEFINE(PAM_TTY_KLUDGE)
131 inet6_default_4in6=yes
133 mips-sony-bsd|mips-sony-newsos4)
134 AC_DEFINE(HAVE_NEWS4)
136 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
137 AC_MSG_ERROR([*** libiberty missing - please install first ***])
144 conf_lastlog_location="/usr/adm/lastlog"
145 conf_utmp_location=/etc/utmp
146 conf_wtmp_location=/usr/adm/wtmp
149 AC_DEFINE(BROKEN_REALPATH)
151 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
155 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
156 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
158 AC_DEFINE(PAM_SUN_CODEBASE)
159 # hardwire lastlog location (can't detect it on some versions)
160 conf_lastlog_location="/var/adm/lastlog"
161 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
162 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
163 if test "$sol2ver" -ge 8; then
165 AC_DEFINE(DISABLE_UTMP)
166 AC_DEFINE(DISABLE_WTMP)
172 CPPFLAGS="$CPPFLAGS -DSUNOS4"
173 AC_CHECK_FUNCS(getpwanam)
174 AC_DEFINE(PAM_SUN_CODEBASE)
175 conf_utmp_location=/etc/utmp
176 conf_wtmp_location=/var/adm/wtmp
177 conf_lastlog_location=/var/adm/lastlog
183 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
184 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
186 IPADDR_IN_DISPLAY=yes
188 AC_DEFINE(IP_TOS_IS_BROKEN)
190 LIBS="$LIBS -lgen -lnsl -lucb"
193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
194 LDFLAGS="$LDFLAGS -L/usr/local/lib"
200 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
201 LDFLAGS="$LDFLAGS -L/usr/local/lib"
207 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
208 LDFLAGS="$LDFLAGS -L/usr/local/lib"
211 LIBS="$LIBS -lgen -lsocket"
215 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
216 LDFLAGS="$LDFLAGS -L/usr/local/lib"
219 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
222 AC_DEFINE(BROKEN_SYS_TERMIO_H)
223 rsh_path="/usr/bin/rcmd"
224 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
225 AC_DEFINE(DISABLE_SHADOW)
226 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
230 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
231 LDFLAGS="$LDFLAGS -L/usr/local/lib"
234 LIBS="$LIBS -lprot -lx -ltinfo -lm"
236 rsh_path="/usr/bin/rcmd"
237 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
238 AC_DEFINE(DISABLE_SHADOW)
239 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
243 if test ! -z "USE_SIA" ; then
244 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
245 if test -f /etc/sia/matrix.conf; then
247 AC_DEFINE(HAVE_OSF_SIA)
248 AC_DEFINE(DISABLE_LOGIN)
249 LIBS="$LIBS -lsecurity -ldb -lm -laud"
257 # Allow user to specify flags
259 [ --with-cflags Specify additional flags to pass to compiler],
261 if test "x$withval" != "xno" ; then
262 CFLAGS="$CFLAGS $withval"
266 AC_ARG_WITH(cppflags,
267 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
269 if test "x$withval" != "xno"; then
270 CPPFLAGS="$CPPFLAGS $withval"
275 [ --with-ldflags Specify additional flags to pass to linker],
277 if test "x$withval" != "xno" ; then
278 LDFLAGS="$LDFLAGS $withval"
283 [ --with-libs Specify additional libraries to link with],
285 if test "x$withval" != "xno" ; then
286 LIBS="$LIBS $withval"
292 # Checks for libraries.
293 if test -z "$no_libsocket" ; then
294 AC_CHECK_LIB(nsl, yp_match, , )
296 if test -z "$no_libnsl" ; then
297 AC_CHECK_LIB(socket, main, , )
300 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
301 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
302 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
304 AC_CHECK_FUNC(regcomp,
305 [ AC_DEFINE(HAVE_REGCOMP)],
307 AC_CHECK_LIB(pcre, pcre_info,
308 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
313 AC_CHECK_FUNC(strcasecmp,
314 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
316 AC_CHECK_FUNC(utimes,
317 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
320 # Checks for header files.
321 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)
323 dnl Checks for library functions.
324 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)
325 dnl Checks for time functions
326 AC_CHECK_FUNCS(gettimeofday time)
327 dnl Checks for libutil functions
328 AC_CHECK_HEADERS(libutil.h)
329 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
330 dnl Checks for utmp functions
331 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
332 AC_CHECK_FUNCS(utmpname)
333 dnl Checks for utmpx functions
334 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
335 AC_CHECK_FUNCS(setutxent utmpxname)
337 AC_CHECK_FUNC(getuserattr,
338 [AC_DEFINE(HAVE_GETUSERATTR)],
339 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
343 [AC_DEFINE(HAVE_LOGIN)],
344 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
347 AC_CHECK_FUNC(daemon,
348 [AC_DEFINE(HAVE_DAEMON)],
349 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
352 AC_CHECK_FUNC(getpagesize,
353 [AC_DEFINE(HAVE_GETPAGESIZE)],
354 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
357 # Check for broken snprintf
358 if test "x$ac_cv_func_snprintf" = "xyes" ; then
359 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
363 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
365 [AC_MSG_RESULT(yes)],
368 AC_DEFINE(BROKEN_SNPRINTF)
369 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
381 [ --with-pam Enable PAM support ],
383 if test "x$withval" != "xno" ; then
384 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
385 AC_MSG_ERROR([PAM headers not found])
388 AC_CHECK_LIB(dl, dlopen, , )
389 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
390 AC_CHECK_FUNCS(pam_getenvlist)
400 # Check for older PAM
401 if test "x$PAM_MSG" = "xyes" ; then
402 # Check PAM strerror arguments (old PAM)
403 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
407 #include <security/pam_appl.h>
409 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
412 AC_DEFINE(HAVE_OLD_PAM)
414 PAM_MSG="yes (old library)"
419 # The big search for OpenSSL
421 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
423 if test "x$withval" != "xno" ; then
430 saved_LDFLAGS="$LDFLAGS"
431 saved_CPPFLAGS="$CPPFLAGS"
432 if test "x$prefix" != "xNONE" ; then
433 tryssldir="$tryssldir $prefix"
435 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
437 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
438 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
439 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
440 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
441 if test ! -z "$need_dash_r" ; then
442 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
445 LDFLAGS="$saved_LDFLAGS"
448 LIBS="$saved_LIBS -lcrypto"
450 # Basic test to check for compatible version and correct linking
451 # *does not* test for RSA - that comes later.
455 #include <openssl/rand.h>
459 memset(a, 0, sizeof(a));
460 RAND_add(a, sizeof(a), sizeof(a));
461 return(RAND_status() <= 0);
470 if test ! -z "$found_crypto" ; then
475 if test -z "$found_crypto" ; then
476 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
478 if test -z "$ssldir" ; then
482 ac_cv_openssldir=$ssldir
485 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
486 AC_DEFINE(HAVE_OPENSSL)
487 dnl Need to recover ssldir - test above runs in subshell
488 ssldir=$ac_cv_openssldir
490 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
491 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
492 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
493 if test ! -z "$need_dash_r" ; then
494 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
496 if test ! -z "$blibpath" ; then
497 blibpath="$blibpath:$ssldir:$ssldir/lib"
501 LIBS="$saved_LIBS -lcrypto"
503 # Now test RSA support
505 AC_MSG_CHECKING([for RSA support])
506 for WANTS_RSAREF in "" 1 ; do
507 if test -z "$WANTS_RSAREF" ; then
510 LIBS="$saved_LIBS -lRSAglue -lrsaref"
514 #include <openssl/rand.h>
515 #include <openssl/rsa.h>
516 #include <openssl/bn.h>
517 #include <openssl/sha.h>
520 int num; RSA *key; static unsigned char p_in[] = "blahblah";
521 unsigned char c[256], p[256];
522 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
523 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
524 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
525 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
534 if test ! -z "$no_rsa" ; then
535 AC_MSG_RESULT(disabled)
538 if test -z "$rsa_works" ; then
539 AC_MSG_WARN([*** No RSA support found *** ])
542 if test -z "$WANTS_RSAREF" ; then
546 RSA_MSG="yes (using RSAref)"
547 AC_MSG_RESULT(using RSAref)
548 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
553 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
554 # version in OpenSSL. Skip this for PAM
555 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
556 AC_CHECK_LIB(crypt, crypt, , )
559 # Cheap hack to ensure NEWS-OS libraries are arranged right.
560 if test ! -z "$SONY" ; then
561 LIBS="$LIBS -liberty";
564 # Checks for data types
565 AC_CHECK_SIZEOF(char, 1)
566 AC_CHECK_SIZEOF(short int, 2)
567 AC_CHECK_SIZEOF(int, 4)
568 AC_CHECK_SIZEOF(long int, 4)
569 AC_CHECK_SIZEOF(long long int, 8)
571 # More checks for data types
572 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
574 [ #include <sys/types.h> ],
576 [ ac_cv_have_u_int="yes" ],
577 [ ac_cv_have_u_int="no" ]
580 if test "x$ac_cv_have_u_int" = "xyes" ; then
581 AC_DEFINE(HAVE_U_INT)
585 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
587 [ #include <sys/types.h> ],
588 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
589 [ ac_cv_have_intxx_t="yes" ],
590 [ ac_cv_have_intxx_t="no" ]
593 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
594 AC_DEFINE(HAVE_INTXX_T)
598 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
600 [ #include <sys/types.h> ],
601 [ int64_t a; a = 1;],
602 [ ac_cv_have_int64_t="yes" ],
603 [ ac_cv_have_int64_t="no" ]
606 if test "x$ac_cv_have_int64_t" = "xyes" ; then
607 AC_DEFINE(HAVE_INT64_T)
611 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
613 [ #include <sys/types.h> ],
614 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
615 [ ac_cv_have_u_intxx_t="yes" ],
616 [ ac_cv_have_u_intxx_t="no" ]
619 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
620 AC_DEFINE(HAVE_U_INTXX_T)
624 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
626 [ #include <sys/types.h> ],
627 [ u_int64_t a; a = 1;],
628 [ ac_cv_have_u_int64_t="yes" ],
629 [ ac_cv_have_u_int64_t="no" ]
632 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
633 AC_DEFINE(HAVE_U_INT64_T)
637 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
638 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
640 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
643 #include <sys/bitypes.h>
646 int8_t a; int16_t b; int32_t c;
647 u_int8_t e; u_int16_t f; u_int32_t g;
648 a = b = c = e = f = g = 1;
651 AC_DEFINE(HAVE_U_INTXX_T)
652 AC_DEFINE(HAVE_INTXX_T)
659 if test -z "$have_u_intxx_t" ; then
660 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
663 #include <sys/types.h>
665 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
666 [ ac_cv_have_uintxx_t="yes" ],
667 [ ac_cv_have_uintxx_t="no" ]
670 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
671 AC_DEFINE(HAVE_UINTXX_T)
675 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
678 #include <sys/types.h>
679 #include <sys/socket.h>
681 [socklen_t foo; foo = 1235;],
682 [ ac_cv_have_socklen_t="yes" ],
683 [ ac_cv_have_socklen_t="no" ]
686 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
687 AC_DEFINE(HAVE_SOCKLEN_T)
690 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
693 #include <sys/types.h>
695 [ size_t foo; foo = 1235; ],
696 [ ac_cv_have_size_t="yes" ],
697 [ ac_cv_have_size_t="no" ]
700 if test "x$ac_cv_have_size_t" = "xyes" ; then
701 AC_DEFINE(HAVE_SIZE_T)
704 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
707 #include <sys/types.h>
709 [ ssize_t foo; foo = 1235; ],
710 [ ac_cv_have_ssize_t="yes" ],
711 [ ac_cv_have_ssize_t="no" ]
714 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
715 AC_DEFINE(HAVE_SSIZE_T)
718 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
723 [ clock_t foo; foo = 1235; ],
724 [ ac_cv_have_clock_t="yes" ],
725 [ ac_cv_have_clock_t="no" ]
728 if test "x$ac_cv_have_clock_t" = "xyes" ; then
729 AC_DEFINE(HAVE_CLOCK_T)
732 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
735 #include <sys/types.h>
736 #include <sys/socket.h>
738 [ sa_family_t foo; foo = 1235; ],
739 [ ac_cv_have_sa_family_t="yes" ],
742 #include <sys/types.h>
743 #include <sys/socket.h>
744 #include <netinet/in.h>
746 [ sa_family_t foo; foo = 1235; ],
747 [ ac_cv_have_sa_family_t="yes" ],
749 [ ac_cv_have_sa_family_t="no" ]
753 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
754 AC_DEFINE(HAVE_SA_FAMILY_T)
757 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
760 #include <sys/types.h>
762 [ pid_t foo; foo = 1235; ],
763 [ ac_cv_have_pid_t="yes" ],
764 [ ac_cv_have_pid_t="no" ]
767 if test "x$ac_cv_have_pid_t" = "xyes" ; then
768 AC_DEFINE(HAVE_PID_T)
771 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
774 #include <sys/types.h>
776 [ mode_t foo; foo = 1235; ],
777 [ ac_cv_have_mode_t="yes" ],
778 [ ac_cv_have_mode_t="no" ]
781 if test "x$ac_cv_have_mode_t" = "xyes" ; then
782 AC_DEFINE(HAVE_MODE_T)
786 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
789 #include <sys/types.h>
790 #include <sys/socket.h>
792 [ struct sockaddr_storage s; ],
793 [ ac_cv_have_struct_sockaddr_storage="yes" ],
794 [ ac_cv_have_struct_sockaddr_storage="no" ]
797 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
798 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
801 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
804 #include <sys/types.h>
805 #include <netinet/in.h>
807 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
808 [ ac_cv_have_struct_sockaddr_in6="yes" ],
809 [ ac_cv_have_struct_sockaddr_in6="no" ]
812 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
813 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
816 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
819 #include <sys/types.h>
820 #include <netinet/in.h>
822 [ struct in6_addr s; s.s6_addr[0] = 0; ],
823 [ ac_cv_have_struct_in6_addr="yes" ],
824 [ ac_cv_have_struct_in6_addr="no" ]
827 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
828 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
831 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
834 #include <sys/types.h>
835 #include <sys/socket.h>
838 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
839 [ ac_cv_have_struct_addrinfo="yes" ],
840 [ ac_cv_have_struct_addrinfo="no" ]
843 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
844 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
847 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
849 [ #include <sys/time.h> ],
850 [ struct timeval tv; tv.tv_sec = 1;],
851 [ ac_cv_have_struct_timeval="yes" ],
852 [ ac_cv_have_struct_timeval="no" ]
855 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
856 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
857 have_struct_timeval=1
860 # If we don't have int64_t then we can't compile sftp-server. So don't
861 # even attempt to do it.
862 if test "x$ac_cv_have_int64_t" = "xno" -a \
863 "x$ac_cv_sizeof_long_int" != "x8" -a \
864 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
869 dnl Checks for structure members
870 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
871 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
872 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
873 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
874 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
875 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
876 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
877 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
878 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
879 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
880 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
881 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
882 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
883 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
884 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
885 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
886 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
889 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
890 ac_cv_have_sun_len_in_struct_sockaddr_un, [
893 #include <sys/types.h>
894 #include <sys/socket.h>
896 [ struct sockaddr_un s; s.sun_len = 1; ],
897 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
898 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
901 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
902 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
905 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
906 ac_cv_have_ss_family_in_struct_ss, [
909 #include <sys/types.h>
910 #include <sys/socket.h>
912 [ struct sockaddr_storage s; s.ss_family = 1; ],
913 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
914 [ ac_cv_have_ss_family_in_struct_ss="no" ],
917 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
918 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
921 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
922 ac_cv_have___ss_family_in_struct_ss, [
925 #include <sys/types.h>
926 #include <sys/socket.h>
928 [ struct sockaddr_storage s; s.__ss_family = 1; ],
929 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
930 [ ac_cv_have___ss_family_in_struct_ss="no" ]
933 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
934 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
937 AC_CACHE_CHECK([for pw_class field in struct passwd],
938 ac_cv_have_pw_class_in_struct_passwd, [
943 [ struct passwd p; p.pw_class = 0; ],
944 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
945 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
948 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
949 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
953 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
955 [ extern char *__progname; printf("%s", __progname); ],
956 [ ac_cv_libc_defines___progname="yes" ],
957 [ ac_cv_libc_defines___progname="no" ]
960 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
961 AC_DEFINE(HAVE___PROGNAME)
965 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
967 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
968 [ ac_cv_libc_defines_sys_errlist="yes" ],
969 [ ac_cv_libc_defines_sys_errlist="no" ]
972 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
973 AC_DEFINE(HAVE_SYS_ERRLIST)
977 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
979 [ extern int sys_nerr; printf("%i", sys_nerr);],
980 [ ac_cv_libc_defines_sys_nerr="yes" ],
981 [ ac_cv_libc_defines_sys_nerr="no" ]
984 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
985 AC_DEFINE(HAVE_SYS_NERR)
989 # Looking for programs, paths and files
991 [ --with-rsh=PATH Specify path to remote shell program ],
993 if test "x$withval" != "$no" ; then
998 AC_PATH_PROG(rsh_path, rsh)
1003 [ --with-xauth=PATH Specify path to xauth program ],
1005 if test "x$withval" != "xno" ; then
1010 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1011 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1012 xauth_path="/usr/openwin/bin/xauth"
1017 if test -z "$xauth_path" ; then
1018 XAUTH_PATH="undefined"
1019 AC_SUBST(XAUTH_PATH)
1021 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1022 XAUTH_PATH=$xauth_path
1023 AC_SUBST(XAUTH_PATH)
1025 if test ! -z "$rsh_path" ; then
1026 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1029 # Check for mail directory (last resort if we cannot get it from headers)
1030 if test ! -z "$MAIL" ; then
1031 maildir=`dirname $MAIL`
1032 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1035 if test -z "$no_dev_ptmx" ; then
1036 AC_CHECK_FILE("/dev/ptmx",
1038 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1043 AC_CHECK_FILE("/dev/ptc",
1045 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1050 # Options from here on. Some of these are preset by platform above
1052 # Check for user-specified random device, otherwise check /dev/urandom
1054 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1056 if test "x$withval" != "xno" ; then
1057 RANDOM_POOL="$withval";
1058 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1062 # Check for random device
1063 AC_CHECK_FILE("/dev/urandom",
1065 RANDOM_POOL="/dev/urandom";
1066 AC_SUBST(RANDOM_POOL)
1067 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1073 # Check for EGD pool file
1074 AC_ARG_WITH(egd-pool,
1075 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1077 if test "x$withval" != "xno" ; then
1078 EGD_SOCKET="$withval";
1079 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1083 # Check for existing socket only if we don't have a random device already
1084 if test -z "$RANDOM_POOL" ; then
1085 AC_MSG_CHECKING(for PRNGD/EGD socket)
1086 # Insert other locations here
1087 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1088 if $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
1089 EGD_SOCKET="$egdsock"
1090 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1094 if test -x "$EGD_SOCKET" ; then
1095 AC_MSG_RESULT($EGD_SOCKET)
1097 AC_MSG_RESULT(not found)
1104 # detect pathnames for entropy gathering commands, if we need them
1105 INSTALL_SSH_PRNG_CMDS=""
1107 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1108 # Use these commands to collect entropy
1109 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1110 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1111 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1112 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1113 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1114 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1115 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1116 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1117 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1118 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1119 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1120 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1121 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1122 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1124 INSTALL_SSH_PRNG_CMDS="yes"
1126 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1130 [ --with-catman=man|cat Install preformatted manpages[no]],
1133 if test x"$withval" != x"yes" ; then
1139 if test -z "$MANTYPE" ; then
1140 MANTYPE='$(TROFFMAN)'
1148 # Check whether user wants Kerberos support
1150 AC_ARG_WITH(kerberos4,
1151 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1153 if test "x$withval" != "xno" ; then
1155 if test "x$withval" != "xyes" ; then
1156 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1157 LDFLAGS="$LDFLAGS -L${withval}/lib"
1158 if test ! -z "$need_dash_r" ; then
1159 LDFLAGS="$LDFLAGS -R${withval}/lib"
1161 if test ! -z "$blibpath" ; then
1162 blibpath="$blibpath:${withval}/lib"
1165 if test -d /usr/include/kerberosIV ; then
1166 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1170 AC_CHECK_HEADERS(krb.h)
1171 AC_CHECK_LIB(krb, main)
1172 if test "$ac_cv_header_krb_h" != yes; then
1173 AC_MSG_WARN([Cannot find krb.h, build may fail])
1175 if test "$ac_cv_lib_krb_main" != yes; then
1176 AC_MSG_WARN([Cannot find libkrb, build may fail])
1180 AC_CHECK_LIB(resolv, dn_expand, , )
1188 # Check whether user wants AFS support
1191 [ --with-afs=PATH Enable AFS support],
1193 if test "x$withval" != "xno" ; then
1195 if test "x$withval" != "xyes" ; then
1196 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1197 LDFLAGS="$LDFLAGS -L${withval}/lib"
1200 if test -z "$KRB4" ; then
1201 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1205 if test ! -z "$AFS_LIBS" ; then
1206 LIBS="$LIBS $AFS_LIBS"
1215 # Check whether user wants S/Key support
1218 [ --with-skey=PATH Enable S/Key support],
1220 if test "x$withval" != "xno" ; then
1222 if test "x$withval" != "xyes" ; then
1223 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1224 LDFLAGS="$LDFLAGS -L${withval}/lib"
1231 AC_CHECK_FUNC(skey_keyinfo,
1234 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1240 # Check whether user wants TCP wrappers support
1242 AC_ARG_WITH(tcp-wrappers,
1243 [ --with-tcp-wrappers Enable tcpwrappers support],
1245 if test "x$withval" != "xno" ; then
1248 AC_MSG_CHECKING(for libwrap)
1252 int deny_severity = 0, allow_severity = 0;
1261 AC_MSG_ERROR([*** libwrap missing])
1268 # Check whether to enable MD5 passwords
1270 AC_ARG_WITH(md5-passwords,
1271 [ --with-md5-passwords Enable use of MD5 passwords],
1273 if test "x$withval" != "xno" ; then
1274 AC_DEFINE(HAVE_MD5_PASSWORDS)
1280 # Whether to disable shadow password support
1282 [ --without-shadow Disable shadow password support],
1284 if test "x$withval" = "xno" ; then
1285 AC_DEFINE(DISABLE_SHADOW)
1291 if test -z "$disable_shadow" ; then
1292 AC_MSG_CHECKING([if the systems has expire shadow information])
1295 #include <sys/types.h>
1298 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1299 [ sp_expire_available=yes ], []
1302 if test "x$sp_expire_available" = "xyes" ; then
1304 AC_DEFINE(HAS_SHADOW_EXPIRE)
1310 # Use ip address instead of hostname in $DISPLAY
1311 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1312 DISPLAY_HACK_MSG="yes"
1313 AC_DEFINE(IPADDR_IN_DISPLAY)
1315 DISPLAY_HACK_MSG="no"
1316 AC_ARG_WITH(ipaddr-display,
1317 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1319 if test "x$withval" != "xno" ; then
1320 AC_DEFINE(IPADDR_IN_DISPLAY)
1321 DISPLAY_HACK_MSG="yes"
1327 # Whether to mess with the default path
1328 SERVER_PATH_MSG="(default)"
1329 AC_ARG_WITH(default-path,
1330 [ --with-default-path=PATH Specify default \$PATH environment for server],
1332 if test "x$withval" != "xno" ; then
1333 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1334 SERVER_PATH_MSG="$withval"
1339 # Whether to force IPv4 by default (needed on broken glibc Linux)
1341 AC_ARG_WITH(ipv4-default,
1342 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1344 if test "x$withval" != "xno" ; then
1345 AC_DEFINE(IPV4_DEFAULT)
1351 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1352 IPV4_IN6_HACK_MSG="no"
1354 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1356 if test "x$withval" != "xno" ; then
1358 AC_DEFINE(IPV4_IN_IPV6)
1359 IPV4_IN6_HACK_MSG="yes"
1364 if test "x$inet6_default_4in6" = "xyes"; then
1365 AC_MSG_RESULT([yes (default)])
1366 AC_DEFINE(IPV4_IN_IPV6)
1367 IPV4_IN6_HACK_MSG="yes"
1369 AC_MSG_RESULT([no (default)])
1374 AC_MSG_CHECKING(whether to install ssh as suid root)
1375 AC_ARG_ENABLE(suid-ssh,
1376 [ --enable-suid-ssh Install ssh as suid root (default)
1377 --disable-suid-ssh Install ssh without suid bit],
1378 [ case "$enableval" in
1383 *) AC_MSG_RESULT(yes)
1393 # Where to place sshd.pid
1395 AC_ARG_WITH(pid-dir,
1396 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1398 if test "x$withval" != "xno" ; then
1404 # make sure the directory exists
1405 if test ! -d $piddir ; then
1406 piddir=`eval echo ${sysconfdir}`
1408 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1412 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1415 dnl allow user to disable some login recording features
1416 AC_ARG_ENABLE(lastlog,
1417 [ --disable-lastlog disable use of lastlog even if detected [no]],
1418 [ AC_DEFINE(DISABLE_LASTLOG) ]
1421 [ --disable-utmp disable use of utmp even if detected [no]],
1422 [ AC_DEFINE(DISABLE_UTMP) ]
1424 AC_ARG_ENABLE(utmpx,
1425 [ --disable-utmpx disable use of utmpx even if detected [no]],
1426 [ AC_DEFINE(DISABLE_UTMPX) ]
1429 [ --disable-wtmp disable use of wtmp even if detected [no]],
1430 [ AC_DEFINE(DISABLE_WTMP) ]
1432 AC_ARG_ENABLE(wtmpx,
1433 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1434 [ AC_DEFINE(DISABLE_WTMPX) ]
1436 AC_ARG_ENABLE(libutil,
1437 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1438 [ AC_DEFINE(DISABLE_LOGIN) ]
1440 AC_ARG_ENABLE(pututline,
1441 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1442 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1444 AC_ARG_ENABLE(pututxline,
1445 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1446 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1448 AC_ARG_WITH(lastlog,
1449 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1451 if test "x$withval" = "xno" ; then
1452 AC_DEFINE(DISABLE_LASTLOG)
1454 conf_lastlog_location=$withval
1459 dnl lastlog, [uw]tmpx? detection
1460 dnl NOTE: set the paths in the platform section to avoid the
1461 dnl need for command-line parameters
1462 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1464 dnl lastlog detection
1465 dnl NOTE: the code itself will detect if lastlog is a directory
1466 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1468 #include <sys/types.h>
1470 #ifdef HAVE_LASTLOG_H
1471 # include <lastlog.h>
1477 [ char *lastlog = LASTLOG_FILE; ],
1478 [ AC_MSG_RESULT(yes) ],
1481 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1483 #include <sys/types.h>
1485 #ifdef HAVE_LASTLOG_H
1486 # include <lastlog.h>
1492 [ char *lastlog = _PATH_LASTLOG; ],
1493 [ AC_MSG_RESULT(yes) ],
1496 system_lastlog_path=no
1501 if test -z "$conf_lastlog_location"; then
1502 if test x"$system_lastlog_path" = x"no" ; then
1503 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1504 if (test -d "$f" || test -f "$f") ; then
1505 conf_lastlog_location=$f
1508 if test -z "$conf_lastlog_location"; then
1509 AC_MSG_WARN([** Cannot find lastlog **])
1510 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1515 if test -n "$conf_lastlog_location"; then
1516 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1520 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1522 #include <sys/types.h>
1528 [ char *utmp = UTMP_FILE; ],
1529 [ AC_MSG_RESULT(yes) ],
1531 system_utmp_path=no ]
1533 if test -z "$conf_utmp_location"; then
1534 if test x"$system_utmp_path" = x"no" ; then
1535 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1536 if test -f $f ; then
1537 conf_utmp_location=$f
1540 if test -z "$conf_utmp_location"; then
1541 AC_DEFINE(DISABLE_UTMP)
1545 if test -n "$conf_utmp_location"; then
1546 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1550 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1552 #include <sys/types.h>
1558 [ char *wtmp = WTMP_FILE; ],
1559 [ AC_MSG_RESULT(yes) ],
1561 system_wtmp_path=no ]
1563 if test -z "$conf_wtmp_location"; then
1564 if test x"$system_wtmp_path" = x"no" ; then
1565 for f in /usr/adm/wtmp /var/log/wtmp; do
1566 if test -f $f ; then
1567 conf_wtmp_location=$f
1570 if test -z "$conf_wtmp_location"; then
1571 AC_DEFINE(DISABLE_WTMP)
1575 if test -n "$conf_wtmp_location"; then
1576 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1580 dnl utmpx detection - I don't know any system so perverse as to require
1581 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1583 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1585 #include <sys/types.h>
1594 [ char *utmpx = UTMPX_FILE; ],
1595 [ AC_MSG_RESULT(yes) ],
1597 system_utmpx_path=no ]
1599 if test -z "$conf_utmpx_location"; then
1600 if test x"$system_utmpx_path" = x"no" ; then
1601 AC_DEFINE(DISABLE_UTMPX)
1604 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1608 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1610 #include <sys/types.h>
1619 [ char *wtmpx = WTMPX_FILE; ],
1620 [ AC_MSG_RESULT(yes) ],
1622 system_wtmpx_path=no ]
1624 if test -z "$conf_wtmpx_location"; then
1625 if test x"$system_wtmpx_path" = x"no" ; then
1626 AC_DEFINE(DISABLE_WTMPX)
1629 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1633 # Change default command timeout for builtin PRNG
1635 AC_ARG_WITH(entropy-timeout,
1636 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1638 if test "x$withval" != "xno" ; then
1639 entropy_timeout=$withval
1643 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1646 if test ! -z "$blibpath" ; then
1647 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1648 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1653 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1655 # Print summary of options
1657 if test x$MANTYPE = x'$(CATMAN)' ; then
1662 if test ! -z "$RANDOM_POOL" ; then
1663 RAND_MSG="Device ($RANDOM_POOL)"
1665 if test ! -z "$EGD_SOCKET" ; then
1666 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1668 RAND_MSG="Builtin (timeout $entropy_timeout)"
1673 # Someone please show me a better way :)
1674 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1675 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1676 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1677 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1678 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1679 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1680 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1683 echo "OpenSSH configured has been configured with the following options."
1684 echo " User binaries: $B"
1685 echo " System binaries: $C"
1686 echo " Configuration files: $D"
1687 echo " Askpass program: $E"
1688 echo " Manual pages: $F"
1689 echo " PID file: $G"
1690 echo " Random number collection: $RAND_MSG"
1691 echo " Manpage format: $MAN_MSG"
1692 echo " PAM support: ${PAM_MSG}"
1693 echo " KerberosIV support: $KRB4_MSG"
1694 echo " AFS support: $AFS_MSG"
1695 echo " S/KEY support: $SKEY_MSG"
1696 echo " TCP Wrappers support: $TCPW_MSG"
1697 echo " MD5 password support: $MD5_MSG"
1698 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1699 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1700 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1704 echo " Host: ${host}"
1705 echo " Compiler: ${CC}"
1706 echo " Compiler flags: ${CFLAGS}"
1707 echo "Preprocessor flags: ${CPPFLAGS}"
1708 echo " Linker flags: ${LDFLAGS}"
1709 echo " Libraries: ${LIBS}"
1713 if test "x$PAM_MSG" = "xyes" ; then
1714 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1715 echo "otherwise password authentication may fail. Example PAM control files"
1716 echo "can be found in the contrib/ subdirectory"
1720 if test ! -z "$BUILTIN_RNG" ; then
1721 echo "WARNING: you are using the builtin random number collection service."
1722 echo "Please read WARNING.RNG and request that your OS vendor includes"
1723 echo "/dev/random in future versions of their OS."
1727 if test ! -z "$NO_SFTP"; then
1728 echo "sftp-server will be disabled. Your compiler does not support"
1729 echo "64bit integers."