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 AC_DEFINE(IP_TOS_IS_BROKEN)
81 if test -z "$GCC"; then
84 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
87 AC_DEFINE(DISABLE_SHADOW)
88 AC_DEFINE(DISABLE_UTMP)
89 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
95 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
97 AC_DEFINE(PAM_SUN_CODEBASE)
99 AC_DEFINE(DISABLE_SHADOW)
100 AC_DEFINE(DISABLE_UTMP)
101 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
107 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
109 PATH="$PATH:/usr/etc"
113 AC_DEFINE(BROKEN_INET_NTOA)
116 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
118 PATH="$PATH:/usr/etc"
120 AC_DEFINE(WITH_IRIX_ARRAY)
121 AC_DEFINE(WITH_IRIX_PROJECT)
122 AC_DEFINE(WITH_IRIX_AUDIT)
123 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
126 AC_DEFINE(BROKEN_INET_NTOA)
131 check_for_libcrypt_later=1
132 AC_DEFINE(DONT_TRY_OTHER_AF)
133 AC_DEFINE(PAM_TTY_KLUDGE)
134 inet6_default_4in6=yes
136 mips-sony-bsd|mips-sony-newsos4)
137 AC_DEFINE(HAVE_NEWS4)
139 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
140 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
147 conf_lastlog_location="/usr/adm/lastlog"
148 conf_utmp_location=/etc/utmp
149 conf_wtmp_location=/usr/adm/wtmp
152 AC_DEFINE(BROKEN_REALPATH)
154 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
158 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
159 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
161 AC_DEFINE(PAM_SUN_CODEBASE)
162 # hardwire lastlog location (can't detect it on some versions)
163 conf_lastlog_location="/var/adm/lastlog"
164 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
165 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
166 if test "$sol2ver" -ge 8; then
168 AC_DEFINE(DISABLE_UTMP)
169 AC_DEFINE(DISABLE_WTMP)
175 CPPFLAGS="$CPPFLAGS -DSUNOS4"
176 AC_CHECK_FUNCS(getpwanam)
177 AC_DEFINE(PAM_SUN_CODEBASE)
178 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
179 conf_utmp_location=/etc/utmp
180 conf_wtmp_location=/var/adm/wtmp
181 conf_lastlog_location=/var/adm/lastlog
187 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
188 LDFLAGS="$LDFLAGS -L/usr/local/lib"
191 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
194 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
195 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
197 IPADDR_IN_DISPLAY=yes
199 AC_DEFINE(IP_TOS_IS_BROKEN)
201 LIBS="$LIBS -lgen -lnsl -lucb"
204 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
205 LDFLAGS="$LDFLAGS -L/usr/local/lib"
212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
213 LDFLAGS="$LDFLAGS -L/usr/local/lib"
220 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
221 LDFLAGS="$LDFLAGS -L/usr/local/lib"
224 LIBS="$LIBS -lgen -lsocket"
227 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
228 LDFLAGS="$LDFLAGS -L/usr/local/lib"
230 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
232 rsh_path="/usr/bin/rcmd"
235 AC_DEFINE(BROKEN_SYS_TERMIO_H)
237 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
238 AC_DEFINE(DISABLE_SHADOW)
239 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
240 AC_CHECK_FUNCS(getluid setluid)
243 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
244 LDFLAGS="$LDFLAGS -L/usr/local/lib"
245 LIBS="$LIBS -lprot -lx -ltinfo -lm"
249 rsh_path="/usr/bin/rcmd"
251 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
252 AC_DEFINE(DISABLE_SHADOW)
253 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
254 AC_CHECK_FUNCS(getluid setluid)
257 if test ! -z "USE_SIA" ; then
258 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
259 if test -f /etc/sia/matrix.conf; then
261 AC_DEFINE(HAVE_OSF_SIA)
262 AC_DEFINE(DISABLE_LOGIN)
263 LIBS="$LIBS -lsecurity -ldb -lm -laud"
271 # Allow user to specify flags
273 [ --with-cflags Specify additional flags to pass to compiler],
275 if test "x$withval" != "xno" ; then
276 CFLAGS="$CFLAGS $withval"
280 AC_ARG_WITH(cppflags,
281 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
283 if test "x$withval" != "xno"; then
284 CPPFLAGS="$CPPFLAGS $withval"
289 [ --with-ldflags Specify additional flags to pass to linker],
291 if test "x$withval" != "xno" ; then
292 LDFLAGS="$LDFLAGS $withval"
297 [ --with-libs Specify additional libraries to link with],
299 if test "x$withval" != "xno" ; then
300 LIBS="$LIBS $withval"
306 [ --with-pcre Override built in regex library with pcre],
309 AC_CHECK_LIB(pcre, pcre_info,
311 AC_DEFINE(HAVE_LIBPCRE)
312 LIBS="$LIBS -lpcreposix -lpcre"
315 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
320 # Checks for libraries.
321 if test -z "$no_libnsl" ; then
322 AC_CHECK_LIB(nsl, yp_match, , )
324 if test -z "$no_libsocket" ; then
325 AC_CHECK_LIB(socket, main, , )
328 dnl SCO OS3 needs this for libwrap
329 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
331 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
332 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
333 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
335 # We don't want to check if we did an pcre override.
336 if test -z "$no_comp_check" ; then
337 AC_CHECK_FUNC(regcomp,
338 [ AC_DEFINE(HAVE_REGCOMP)],
340 AC_CHECK_LIB(pcre, pcre_info,
342 AC_DEFINE(HAVE_LIBPCRE)
343 LIBS="$LIBS -lpcreposix -lpcre"
346 AC_MSG_ERROR([*** No regex library found.])
353 AC_CHECK_FUNC(strcasecmp,
354 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
356 AC_CHECK_FUNC(utimes,
357 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
360 # Checks for header files.
361 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)
363 # Check whether user wants Kerberos support
365 AC_ARG_WITH(kerberos4,
366 [ --with-kerberos4=PATH Enable Kerberos 4 support],
368 if test "x$withval" != "xno" ; then
370 if test "x$withval" != "xyes" ; then
371 CPPFLAGS="$CPPFLAGS -I${withval}/include"
372 LDFLAGS="$LDFLAGS -L${withval}/lib"
373 if test ! -z "$need_dash_r" ; then
374 LDFLAGS="$LDFLAGS -R${withval}/lib"
376 if test ! -z "$blibpath" ; then
377 blibpath="$blibpath:${withval}/lib"
380 if test -d /usr/include/kerberosIV ; then
381 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
385 AC_CHECK_HEADERS(krb.h)
386 AC_CHECK_LIB(krb, main)
387 if test "$ac_cv_header_krb_h" != yes; then
388 AC_MSG_WARN([Cannot find krb.h, build may fail])
390 if test "$ac_cv_lib_krb_main" != yes; then
391 AC_MSG_WARN([Cannot find libkrb, build may fail])
395 AC_CHECK_LIB(resolv, dn_expand, , )
403 # Check whether user wants AFS support
406 [ --with-afs=PATH Enable AFS support],
408 if test "x$withval" != "xno" ; then
410 if test "x$withval" != "xyes" ; then
411 CPPFLAGS="$CPPFLAGS -I${withval}/include"
412 LDFLAGS="$LDFLAGS -L${withval}/lib"
415 if test -z "$KRB4" ; then
416 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
420 if test ! -z "$AFS_LIBS" ; then
421 LIBS="$LIBS $AFS_LIBS"
430 # Check whether user wants S/Key support
433 [ --with-skey=PATH Enable S/Key support],
435 if test "x$withval" != "xno" ; then
437 if test "x$withval" != "xyes" ; then
438 CPPFLAGS="$CPPFLAGS -I${withval}/include"
439 LDFLAGS="$LDFLAGS -L${withval}/lib"
446 AC_CHECK_FUNC(skey_keyinfo,
449 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
455 # Check whether user wants TCP wrappers support
457 AC_ARG_WITH(tcp-wrappers,
458 [ --with-tcp-wrappers Enable tcpwrappers support],
460 if test "x$withval" != "xno" ; then
463 AC_MSG_CHECKING(for libwrap)
467 int deny_severity = 0, allow_severity = 0;
476 AC_MSG_ERROR([*** libwrap missing])
483 dnl Checks for library functions.
484 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown 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)
485 dnl Checks for time functions
486 AC_CHECK_FUNCS(gettimeofday time)
487 dnl Checks for libutil functions
488 AC_CHECK_HEADERS(libutil.h)
489 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
490 dnl Checks for utmp functions
491 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
492 AC_CHECK_FUNCS(utmpname)
493 dnl Checks for utmpx functions
494 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
495 AC_CHECK_FUNCS(setutxent utmpxname)
497 AC_CHECK_FUNC(getuserattr,
498 [AC_DEFINE(HAVE_GETUSERATTR)],
499 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
503 [AC_DEFINE(HAVE_LOGIN)],
504 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
507 AC_CHECK_FUNC(daemon,
508 [AC_DEFINE(HAVE_DAEMON)],
509 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
512 AC_CHECK_FUNC(getpagesize,
513 [AC_DEFINE(HAVE_GETPAGESIZE)],
514 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
517 # Check for broken snprintf
518 if test "x$ac_cv_func_snprintf" = "xyes" ; then
519 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
523 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
525 [AC_MSG_RESULT(yes)],
528 AC_DEFINE(BROKEN_SNPRINTF)
529 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
541 [ --with-pam Enable PAM support ],
543 if test "x$withval" != "xno" ; then
544 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
545 AC_MSG_ERROR([PAM headers not found])
548 AC_CHECK_LIB(dl, dlopen, , )
549 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
550 AC_CHECK_FUNCS(pam_getenvlist)
560 # Check for older PAM
561 if test "x$PAM_MSG" = "xyes" ; then
562 # Check PAM strerror arguments (old PAM)
563 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
567 #include <security/pam_appl.h>
569 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
572 AC_DEFINE(HAVE_OLD_PAM)
574 PAM_MSG="yes (old library)"
579 # The big search for OpenSSL
581 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
583 if test "x$withval" != "xno" ; then
590 saved_LDFLAGS="$LDFLAGS"
591 saved_CPPFLAGS="$CPPFLAGS"
592 if test "x$prefix" != "xNONE" ; then
593 tryssldir="$tryssldir $prefix"
595 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
597 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
598 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
599 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
600 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
601 if test ! -z "$need_dash_r" ; then
602 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
605 LDFLAGS="$saved_LDFLAGS"
608 LIBS="$saved_LIBS -lcrypto"
610 # Basic test to check for compatible version and correct linking
611 # *does not* test for RSA - that comes later.
615 #include <openssl/rand.h>
619 memset(a, 0, sizeof(a));
620 RAND_add(a, sizeof(a), sizeof(a));
621 return(RAND_status() <= 0);
630 if test ! -z "$found_crypto" ; then
635 if test -z "$found_crypto" ; then
636 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
638 if test -z "$ssldir" ; then
642 ac_cv_openssldir=$ssldir
645 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
646 AC_DEFINE(HAVE_OPENSSL)
647 dnl Need to recover ssldir - test above runs in subshell
648 ssldir=$ac_cv_openssldir
650 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
651 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
652 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
653 if test ! -z "$need_dash_r" ; then
654 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
656 if test ! -z "$blibpath" ; then
657 blibpath="$blibpath:$ssldir:$ssldir/lib"
661 LIBS="$saved_LIBS -lcrypto"
663 # Now test RSA support
665 AC_MSG_CHECKING([for RSA support])
666 for WANTS_RSAREF in "" 1 ; do
667 if test -z "$WANTS_RSAREF" ; then
670 LIBS="$saved_LIBS -lRSAglue -lrsaref"
674 #include <openssl/rand.h>
675 #include <openssl/rsa.h>
676 #include <openssl/bn.h>
677 #include <openssl/sha.h>
680 int num; RSA *key; static unsigned char p_in[] = "blahblah";
681 unsigned char c[256], p[256];
682 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
683 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
684 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
685 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
694 if test ! -z "$no_rsa" ; then
695 AC_MSG_RESULT(disabled)
698 if test -z "$rsa_works" ; then
699 AC_MSG_WARN([*** No RSA support found *** ])
702 if test -z "$WANTS_RSAREF" ; then
706 RSA_MSG="yes (using RSAref)"
707 AC_MSG_RESULT(using RSAref)
708 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
713 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
714 # version in OpenSSL. Skip this for PAM
715 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
716 AC_CHECK_LIB(crypt, crypt, , )
719 # Cheap hack to ensure NEWS-OS libraries are arranged right.
720 if test ! -z "$SONY" ; then
721 LIBS="$LIBS -liberty";
724 # Checks for data types
725 AC_CHECK_SIZEOF(char, 1)
726 AC_CHECK_SIZEOF(short int, 2)
727 AC_CHECK_SIZEOF(int, 4)
728 AC_CHECK_SIZEOF(long int, 4)
729 AC_CHECK_SIZEOF(long long int, 8)
731 # More checks for data types
732 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
734 [ #include <sys/types.h> ],
736 [ ac_cv_have_u_int="yes" ],
737 [ ac_cv_have_u_int="no" ]
740 if test "x$ac_cv_have_u_int" = "xyes" ; then
741 AC_DEFINE(HAVE_U_INT)
745 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
747 [ #include <sys/types.h> ],
748 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
749 [ ac_cv_have_intxx_t="yes" ],
750 [ ac_cv_have_intxx_t="no" ]
753 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
754 AC_DEFINE(HAVE_INTXX_T)
758 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
760 [ #include <sys/types.h> ],
761 [ int64_t a; a = 1;],
762 [ ac_cv_have_int64_t="yes" ],
763 [ ac_cv_have_int64_t="no" ]
766 if test "x$ac_cv_have_int64_t" = "xyes" ; then
767 AC_DEFINE(HAVE_INT64_T)
771 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
773 [ #include <sys/types.h> ],
774 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
775 [ ac_cv_have_u_intxx_t="yes" ],
776 [ ac_cv_have_u_intxx_t="no" ]
779 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
780 AC_DEFINE(HAVE_U_INTXX_T)
784 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
786 [ #include <sys/types.h> ],
787 [ u_int64_t a; a = 1;],
788 [ ac_cv_have_u_int64_t="yes" ],
789 [ ac_cv_have_u_int64_t="no" ]
792 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
793 AC_DEFINE(HAVE_U_INT64_T)
797 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
798 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
800 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
803 #include <sys/bitypes.h>
806 int8_t a; int16_t b; int32_t c;
807 u_int8_t e; u_int16_t f; u_int32_t g;
808 a = b = c = e = f = g = 1;
811 AC_DEFINE(HAVE_U_INTXX_T)
812 AC_DEFINE(HAVE_INTXX_T)
819 if test -z "$have_u_intxx_t" ; then
820 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
823 #include <sys/types.h>
825 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
826 [ ac_cv_have_uintxx_t="yes" ],
827 [ ac_cv_have_uintxx_t="no" ]
830 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
831 AC_DEFINE(HAVE_UINTXX_T)
835 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
838 #include <sys/types.h>
839 #include <sys/socket.h>
841 [socklen_t foo; foo = 1235;],
842 [ ac_cv_have_socklen_t="yes" ],
843 [ ac_cv_have_socklen_t="no" ]
846 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
847 AC_DEFINE(HAVE_SOCKLEN_T)
850 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
853 #include <sys/types.h>
855 [ size_t foo; foo = 1235; ],
856 [ ac_cv_have_size_t="yes" ],
857 [ ac_cv_have_size_t="no" ]
860 if test "x$ac_cv_have_size_t" = "xyes" ; then
861 AC_DEFINE(HAVE_SIZE_T)
864 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
867 #include <sys/types.h>
869 [ ssize_t foo; foo = 1235; ],
870 [ ac_cv_have_ssize_t="yes" ],
871 [ ac_cv_have_ssize_t="no" ]
874 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
875 AC_DEFINE(HAVE_SSIZE_T)
878 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
883 [ clock_t foo; foo = 1235; ],
884 [ ac_cv_have_clock_t="yes" ],
885 [ ac_cv_have_clock_t="no" ]
888 if test "x$ac_cv_have_clock_t" = "xyes" ; then
889 AC_DEFINE(HAVE_CLOCK_T)
892 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
895 #include <sys/types.h>
896 #include <sys/socket.h>
898 [ sa_family_t foo; foo = 1235; ],
899 [ ac_cv_have_sa_family_t="yes" ],
902 #include <sys/types.h>
903 #include <sys/socket.h>
904 #include <netinet/in.h>
906 [ sa_family_t foo; foo = 1235; ],
907 [ ac_cv_have_sa_family_t="yes" ],
909 [ ac_cv_have_sa_family_t="no" ]
913 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
914 AC_DEFINE(HAVE_SA_FAMILY_T)
917 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
920 #include <sys/types.h>
922 [ pid_t foo; foo = 1235; ],
923 [ ac_cv_have_pid_t="yes" ],
924 [ ac_cv_have_pid_t="no" ]
927 if test "x$ac_cv_have_pid_t" = "xyes" ; then
928 AC_DEFINE(HAVE_PID_T)
931 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
934 #include <sys/types.h>
936 [ mode_t foo; foo = 1235; ],
937 [ ac_cv_have_mode_t="yes" ],
938 [ ac_cv_have_mode_t="no" ]
941 if test "x$ac_cv_have_mode_t" = "xyes" ; then
942 AC_DEFINE(HAVE_MODE_T)
946 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
949 #include <sys/types.h>
950 #include <sys/socket.h>
952 [ struct sockaddr_storage s; ],
953 [ ac_cv_have_struct_sockaddr_storage="yes" ],
954 [ ac_cv_have_struct_sockaddr_storage="no" ]
957 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
958 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
961 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
964 #include <sys/types.h>
965 #include <netinet/in.h>
967 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
968 [ ac_cv_have_struct_sockaddr_in6="yes" ],
969 [ ac_cv_have_struct_sockaddr_in6="no" ]
972 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
973 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
976 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
979 #include <sys/types.h>
980 #include <netinet/in.h>
982 [ struct in6_addr s; s.s6_addr[0] = 0; ],
983 [ ac_cv_have_struct_in6_addr="yes" ],
984 [ ac_cv_have_struct_in6_addr="no" ]
987 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
988 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
991 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
994 #include <sys/types.h>
995 #include <sys/socket.h>
998 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
999 [ ac_cv_have_struct_addrinfo="yes" ],
1000 [ ac_cv_have_struct_addrinfo="no" ]
1003 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1004 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1007 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1009 [ #include <sys/time.h> ],
1010 [ struct timeval tv; tv.tv_sec = 1;],
1011 [ ac_cv_have_struct_timeval="yes" ],
1012 [ ac_cv_have_struct_timeval="no" ]
1015 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1016 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1017 have_struct_timeval=1
1020 # If we don't have int64_t then we can't compile sftp-server. So don't
1021 # even attempt to do it.
1022 if test "x$ac_cv_have_int64_t" = "xno" -a \
1023 "x$ac_cv_sizeof_long_int" != "x8" -a \
1024 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1029 dnl Checks for structure members
1030 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1031 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1032 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1033 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1034 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1035 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1036 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1037 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1038 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1039 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1040 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1041 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1042 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1043 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1044 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1045 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1046 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1047 AC_STRUCT_ST_BLKSIZE
1049 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1050 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1053 #include <sys/types.h>
1054 #include <sys/socket.h>
1056 [ struct sockaddr_un s; s.sun_len = 1; ],
1057 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1058 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1061 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1062 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1065 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1066 ac_cv_have_ss_family_in_struct_ss, [
1069 #include <sys/types.h>
1070 #include <sys/socket.h>
1072 [ struct sockaddr_storage s; s.ss_family = 1; ],
1073 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1074 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1077 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1078 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1081 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1082 ac_cv_have___ss_family_in_struct_ss, [
1085 #include <sys/types.h>
1086 #include <sys/socket.h>
1088 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1089 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1090 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1093 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1094 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1097 AC_CACHE_CHECK([for pw_class field in struct passwd],
1098 ac_cv_have_pw_class_in_struct_passwd, [
1103 [ struct passwd p; p.pw_class = 0; ],
1104 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1105 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1108 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1109 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1113 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1115 [ extern char *__progname; printf("%s", __progname); ],
1116 [ ac_cv_libc_defines___progname="yes" ],
1117 [ ac_cv_libc_defines___progname="no" ]
1120 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1121 AC_DEFINE(HAVE___PROGNAME)
1125 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1127 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1128 [ ac_cv_libc_defines_sys_errlist="yes" ],
1129 [ ac_cv_libc_defines_sys_errlist="no" ]
1132 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1133 AC_DEFINE(HAVE_SYS_ERRLIST)
1137 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1139 [ extern int sys_nerr; printf("%i", sys_nerr);],
1140 [ ac_cv_libc_defines_sys_nerr="yes" ],
1141 [ ac_cv_libc_defines_sys_nerr="no" ]
1144 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1145 AC_DEFINE(HAVE_SYS_NERR)
1149 # Looking for programs, paths and files
1151 [ --with-rsh=PATH Specify path to remote shell program ],
1153 if test "x$withval" != "$no" ; then
1158 AC_PATH_PROG(rsh_path, rsh)
1163 [ --with-xauth=PATH Specify path to xauth program ],
1165 if test "x$withval" != "xno" ; then
1170 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1171 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1172 xauth_path="/usr/openwin/bin/xauth"
1177 if test -z "$xauth_path" ; then
1178 XAUTH_PATH="undefined"
1179 AC_SUBST(XAUTH_PATH)
1181 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1182 XAUTH_PATH=$xauth_path
1183 AC_SUBST(XAUTH_PATH)
1185 if test ! -z "$rsh_path" ; then
1186 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1189 # Check for mail directory (last resort if we cannot get it from headers)
1190 if test ! -z "$MAIL" ; then
1191 maildir=`dirname $MAIL`
1192 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1195 if test -z "$no_dev_ptmx" ; then
1196 AC_CHECK_FILE("/dev/ptmx",
1198 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1203 AC_CHECK_FILE("/dev/ptc",
1205 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1210 # Options from here on. Some of these are preset by platform above
1212 # Check for user-specified random device, otherwise check /dev/urandom
1214 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1216 if test "x$withval" != "xno" ; then
1217 RANDOM_POOL="$withval";
1218 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1222 # Check for random device
1223 AC_CHECK_FILE("/dev/urandom",
1225 RANDOM_POOL="/dev/urandom";
1226 AC_SUBST(RANDOM_POOL)
1227 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1233 # Check for EGD pool file
1234 AC_ARG_WITH(egd-pool,
1235 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1237 if test "x$withval" != "xno" ; then
1238 EGD_SOCKET="$withval";
1239 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1243 # Check for existing socket only if we don't have a random device already
1244 if test -z "$RANDOM_POOL" ; then
1245 AC_MSG_CHECKING(for PRNGD/EGD socket)
1246 # Insert other locations here
1247 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1248 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
1249 EGD_SOCKET="$egdsock"
1250 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1254 if test -x "$EGD_SOCKET" ; then
1255 AC_MSG_RESULT($EGD_SOCKET)
1257 AC_MSG_RESULT(not found)
1264 # detect pathnames for entropy gathering commands, if we need them
1265 INSTALL_SSH_PRNG_CMDS=""
1267 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1268 # Use these commands to collect entropy
1269 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1270 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1271 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1272 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1273 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1274 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1275 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1276 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1277 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1278 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1279 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1280 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1281 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1282 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1284 INSTALL_SSH_PRNG_CMDS="yes"
1286 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1290 [ --with-catman=man|cat Install preformatted manpages[no]],
1293 if test x"$withval" != x"yes" ; then
1299 if test -z "$MANTYPE" ; then
1300 MANTYPE='$(TROFFMAN)'
1308 # Check whether to enable MD5 passwords
1310 AC_ARG_WITH(md5-passwords,
1311 [ --with-md5-passwords Enable use of MD5 passwords],
1313 if test "x$withval" != "xno" ; then
1314 AC_DEFINE(HAVE_MD5_PASSWORDS)
1320 # Whether to disable shadow password support
1322 [ --without-shadow Disable shadow password support],
1324 if test "x$withval" = "xno" ; then
1325 AC_DEFINE(DISABLE_SHADOW)
1331 if test -z "$disable_shadow" ; then
1332 AC_MSG_CHECKING([if the systems has expire shadow information])
1335 #include <sys/types.h>
1338 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1339 [ sp_expire_available=yes ], []
1342 if test "x$sp_expire_available" = "xyes" ; then
1344 AC_DEFINE(HAS_SHADOW_EXPIRE)
1350 # Use ip address instead of hostname in $DISPLAY
1351 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1352 DISPLAY_HACK_MSG="yes"
1353 AC_DEFINE(IPADDR_IN_DISPLAY)
1355 DISPLAY_HACK_MSG="no"
1356 AC_ARG_WITH(ipaddr-display,
1357 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1359 if test "x$withval" != "xno" ; then
1360 AC_DEFINE(IPADDR_IN_DISPLAY)
1361 DISPLAY_HACK_MSG="yes"
1367 # Whether to mess with the default path
1368 SERVER_PATH_MSG="(default)"
1369 AC_ARG_WITH(default-path,
1370 [ --with-default-path=PATH Specify default \$PATH environment for server],
1372 if test "x$withval" != "xno" ; then
1373 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1374 SERVER_PATH_MSG="$withval"
1379 # Whether to force IPv4 by default (needed on broken glibc Linux)
1381 AC_ARG_WITH(ipv4-default,
1382 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1384 if test "x$withval" != "xno" ; then
1385 AC_DEFINE(IPV4_DEFAULT)
1391 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1392 IPV4_IN6_HACK_MSG="no"
1394 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1396 if test "x$withval" != "xno" ; then
1398 AC_DEFINE(IPV4_IN_IPV6)
1399 IPV4_IN6_HACK_MSG="yes"
1404 if test "x$inet6_default_4in6" = "xyes"; then
1405 AC_MSG_RESULT([yes (default)])
1406 AC_DEFINE(IPV4_IN_IPV6)
1407 IPV4_IN6_HACK_MSG="yes"
1409 AC_MSG_RESULT([no (default)])
1414 # Whether to enable BSD auth support
1415 AC_ARG_WITH(bsd-auth,
1416 [ --with-bsd-auth Enable BSD auth support],
1418 if test "x$withval" != "xno" ; then
1425 AC_MSG_CHECKING(whether to install ssh as suid root)
1426 AC_ARG_ENABLE(suid-ssh,
1427 [ --enable-suid-ssh Install ssh as suid root (default)
1428 --disable-suid-ssh Install ssh without suid bit],
1429 [ case "$enableval" in
1434 *) AC_MSG_RESULT(yes)
1444 # Where to place sshd.pid
1446 AC_ARG_WITH(pid-dir,
1447 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1449 if test "x$withval" != "xno" ; then
1455 # make sure the directory exists
1456 if test ! -d $piddir ; then
1457 piddir=`eval echo ${sysconfdir}`
1459 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1463 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1466 dnl allow user to disable some login recording features
1467 AC_ARG_ENABLE(lastlog,
1468 [ --disable-lastlog disable use of lastlog even if detected [no]],
1469 [ AC_DEFINE(DISABLE_LASTLOG) ]
1472 [ --disable-utmp disable use of utmp even if detected [no]],
1473 [ AC_DEFINE(DISABLE_UTMP) ]
1475 AC_ARG_ENABLE(utmpx,
1476 [ --disable-utmpx disable use of utmpx even if detected [no]],
1477 [ AC_DEFINE(DISABLE_UTMPX) ]
1480 [ --disable-wtmp disable use of wtmp even if detected [no]],
1481 [ AC_DEFINE(DISABLE_WTMP) ]
1483 AC_ARG_ENABLE(wtmpx,
1484 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1485 [ AC_DEFINE(DISABLE_WTMPX) ]
1487 AC_ARG_ENABLE(libutil,
1488 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1489 [ AC_DEFINE(DISABLE_LOGIN) ]
1491 AC_ARG_ENABLE(pututline,
1492 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1493 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1495 AC_ARG_ENABLE(pututxline,
1496 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1497 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1499 AC_ARG_WITH(lastlog,
1500 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1502 if test "x$withval" = "xno" ; then
1503 AC_DEFINE(DISABLE_LASTLOG)
1505 conf_lastlog_location=$withval
1510 dnl lastlog, [uw]tmpx? detection
1511 dnl NOTE: set the paths in the platform section to avoid the
1512 dnl need for command-line parameters
1513 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1515 dnl lastlog detection
1516 dnl NOTE: the code itself will detect if lastlog is a directory
1517 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1519 #include <sys/types.h>
1521 #ifdef HAVE_LASTLOG_H
1522 # include <lastlog.h>
1528 [ char *lastlog = LASTLOG_FILE; ],
1529 [ AC_MSG_RESULT(yes) ],
1532 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1534 #include <sys/types.h>
1536 #ifdef HAVE_LASTLOG_H
1537 # include <lastlog.h>
1543 [ char *lastlog = _PATH_LASTLOG; ],
1544 [ AC_MSG_RESULT(yes) ],
1547 system_lastlog_path=no
1552 if test -z "$conf_lastlog_location"; then
1553 if test x"$system_lastlog_path" = x"no" ; then
1554 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1555 if (test -d "$f" || test -f "$f") ; then
1556 conf_lastlog_location=$f
1559 if test -z "$conf_lastlog_location"; then
1560 AC_MSG_WARN([** Cannot find lastlog **])
1561 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1566 if test -n "$conf_lastlog_location"; then
1567 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1571 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1573 #include <sys/types.h>
1579 [ char *utmp = UTMP_FILE; ],
1580 [ AC_MSG_RESULT(yes) ],
1582 system_utmp_path=no ]
1584 if test -z "$conf_utmp_location"; then
1585 if test x"$system_utmp_path" = x"no" ; then
1586 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1587 if test -f $f ; then
1588 conf_utmp_location=$f
1591 if test -z "$conf_utmp_location"; then
1592 AC_DEFINE(DISABLE_UTMP)
1596 if test -n "$conf_utmp_location"; then
1597 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1601 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1603 #include <sys/types.h>
1609 [ char *wtmp = WTMP_FILE; ],
1610 [ AC_MSG_RESULT(yes) ],
1612 system_wtmp_path=no ]
1614 if test -z "$conf_wtmp_location"; then
1615 if test x"$system_wtmp_path" = x"no" ; then
1616 for f in /usr/adm/wtmp /var/log/wtmp; do
1617 if test -f $f ; then
1618 conf_wtmp_location=$f
1621 if test -z "$conf_wtmp_location"; then
1622 AC_DEFINE(DISABLE_WTMP)
1626 if test -n "$conf_wtmp_location"; then
1627 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1631 dnl utmpx detection - I don't know any system so perverse as to require
1632 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1634 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1636 #include <sys/types.h>
1645 [ char *utmpx = UTMPX_FILE; ],
1646 [ AC_MSG_RESULT(yes) ],
1648 system_utmpx_path=no ]
1650 if test -z "$conf_utmpx_location"; then
1651 if test x"$system_utmpx_path" = x"no" ; then
1652 AC_DEFINE(DISABLE_UTMPX)
1655 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1659 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1661 #include <sys/types.h>
1670 [ char *wtmpx = WTMPX_FILE; ],
1671 [ AC_MSG_RESULT(yes) ],
1673 system_wtmpx_path=no ]
1675 if test -z "$conf_wtmpx_location"; then
1676 if test x"$system_wtmpx_path" = x"no" ; then
1677 AC_DEFINE(DISABLE_WTMPX)
1680 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1684 # Change default command timeout for builtin PRNG
1686 AC_ARG_WITH(entropy-timeout,
1687 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1689 if test "x$withval" != "xno" ; then
1690 entropy_timeout=$withval
1694 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1697 if test ! -z "$blibpath" ; then
1698 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1699 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1704 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1706 # Print summary of options
1708 if test x$MANTYPE = x'$(CATMAN)' ; then
1713 if test ! -z "$RANDOM_POOL" ; then
1714 RAND_MSG="Device ($RANDOM_POOL)"
1716 if test ! -z "$EGD_SOCKET" ; then
1717 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1719 RAND_MSG="Builtin (timeout $entropy_timeout)"
1724 # Someone please show me a better way :)
1725 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1726 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1727 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1728 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1729 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1730 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1731 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1734 echo "OpenSSH configured has been configured with the following options."
1735 echo " User binaries: $B"
1736 echo " System binaries: $C"
1737 echo " Configuration files: $D"
1738 echo " Askpass program: $E"
1739 echo " Manual pages: $F"
1740 echo " PID file: $G"
1741 echo " Random number collection: $RAND_MSG"
1742 echo " Manpage format: $MAN_MSG"
1743 echo " PAM support: ${PAM_MSG}"
1744 echo " KerberosIV support: $KRB4_MSG"
1745 echo " AFS support: $AFS_MSG"
1746 echo " S/KEY support: $SKEY_MSG"
1747 echo " TCP Wrappers support: $TCPW_MSG"
1748 echo " MD5 password support: $MD5_MSG"
1749 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1750 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1751 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1753 if test ! -z "$bsd_auth"; then
1754 echo " BSD Auth support: yes"
1759 echo " Host: ${host}"
1760 echo " Compiler: ${CC}"
1761 echo " Compiler flags: ${CFLAGS}"
1762 echo "Preprocessor flags: ${CPPFLAGS}"
1763 echo " Linker flags: ${LDFLAGS}"
1764 echo " Libraries: ${LIBS}"
1768 if test "x$PAM_MSG" = "xyes" ; then
1769 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1770 echo "otherwise password authentication may fail. Example PAM control files"
1771 echo "can be found in the contrib/ subdirectory"
1775 if test ! -z "$BUILTIN_RNG" ; then
1776 echo "WARNING: you are using the builtin random number collection service."
1777 echo "Please read WARNING.RNG and request that your OS vendor includes"
1778 echo "/dev/random in future versions of their OS."
1782 if test ! -z "$NO_SFTP"; then
1783 echo "sftp-server will be disabled. Your compiler does not support"
1784 echo "64bit integers."