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)
74 AC_DEFINE(NO_X11_UNIX_SOCKETS)
79 AC_DEFINE(IP_TOS_IS_BROKEN)
82 if test -z "$GCC"; then
85 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
88 AC_DEFINE(DISABLE_SHADOW)
89 AC_DEFINE(DISABLE_UTMP)
90 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
96 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
98 AC_DEFINE(PAM_SUN_CODEBASE)
100 AC_DEFINE(DISABLE_SHADOW)
101 AC_DEFINE(DISABLE_UTMP)
102 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
108 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
110 PATH="$PATH:/usr/etc"
114 AC_DEFINE(BROKEN_INET_NTOA)
117 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
119 PATH="$PATH:/usr/etc"
121 AC_DEFINE(WITH_IRIX_ARRAY)
122 AC_DEFINE(WITH_IRIX_PROJECT)
123 AC_DEFINE(WITH_IRIX_AUDIT)
124 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
127 AC_DEFINE(BROKEN_INET_NTOA)
132 check_for_libcrypt_later=1
133 AC_DEFINE(DONT_TRY_OTHER_AF)
134 AC_DEFINE(PAM_TTY_KLUDGE)
135 inet6_default_4in6=yes
137 mips-sony-bsd|mips-sony-newsos4)
138 AC_DEFINE(HAVE_NEWS4)
140 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
141 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
148 conf_lastlog_location="/usr/adm/lastlog"
149 conf_utmp_location=/etc/utmp
150 conf_wtmp_location=/usr/adm/wtmp
153 AC_DEFINE(BROKEN_REALPATH)
155 AC_DEFINE(SAVED_IDS_WORK_WITH_SETEUID)
156 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
160 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
161 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
163 AC_DEFINE(PAM_SUN_CODEBASE)
164 # hardwire lastlog location (can't detect it on some versions)
165 conf_lastlog_location="/var/adm/lastlog"
166 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
167 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
168 if test "$sol2ver" -ge 8; then
170 AC_DEFINE(DISABLE_UTMP)
171 AC_DEFINE(DISABLE_WTMP)
177 CPPFLAGS="$CPPFLAGS -DSUNOS4"
178 AC_CHECK_FUNCS(getpwanam)
179 AC_DEFINE(PAM_SUN_CODEBASE)
180 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
181 conf_utmp_location=/etc/utmp
182 conf_wtmp_location=/var/adm/wtmp
183 conf_lastlog_location=/var/adm/lastlog
189 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
190 LDFLAGS="$LDFLAGS -L/usr/local/lib"
193 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
196 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
197 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
199 IPADDR_IN_DISPLAY=yes
201 AC_DEFINE(IP_TOS_IS_BROKEN)
203 LIBS="$LIBS -lgen -lnsl -lucb"
206 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
207 LDFLAGS="$LDFLAGS -L/usr/local/lib"
214 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
222 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
223 LDFLAGS="$LDFLAGS -L/usr/local/lib"
226 LIBS="$LIBS -lgen -lsocket"
229 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
230 LDFLAGS="$LDFLAGS -L/usr/local/lib"
232 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
234 rsh_path="/usr/bin/rcmd"
237 AC_DEFINE(BROKEN_SYS_TERMIO_H)
239 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
240 AC_DEFINE(DISABLE_SHADOW)
241 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
242 AC_DEFINE(SAVED_IDS_WORK_WITH_SETEUID)
243 AC_CHECK_FUNCS(getluid setluid)
246 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
247 LDFLAGS="$LDFLAGS -L/usr/local/lib"
248 LIBS="$LIBS -lprot -lx -ltinfo -lm"
252 rsh_path="/usr/bin/rcmd"
254 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
255 AC_DEFINE(DISABLE_SHADOW)
256 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
257 AC_DEFINE(SAVED_IDS_WORK_WITH_SETEUID)
258 AC_CHECK_FUNCS(getluid setluid)
261 if test ! -z "USE_SIA" ; then
262 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
263 if test -f /etc/sia/matrix.conf; then
265 AC_DEFINE(HAVE_OSF_SIA)
266 AC_DEFINE(DISABLE_LOGIN)
267 LIBS="$LIBS -lsecurity -ldb -lm -laud"
275 # Allow user to specify flags
277 [ --with-cflags Specify additional flags to pass to compiler],
279 if test "x$withval" != "xno" ; then
280 CFLAGS="$CFLAGS $withval"
284 AC_ARG_WITH(cppflags,
285 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
287 if test "x$withval" != "xno"; then
288 CPPFLAGS="$CPPFLAGS $withval"
293 [ --with-ldflags Specify additional flags to pass to linker],
295 if test "x$withval" != "xno" ; then
296 LDFLAGS="$LDFLAGS $withval"
301 [ --with-libs Specify additional libraries to link with],
303 if test "x$withval" != "xno" ; then
304 LIBS="$LIBS $withval"
310 [ --with-pcre Override built in regex library with pcre],
313 AC_CHECK_LIB(pcre, pcre_info,
315 AC_DEFINE(HAVE_LIBPCRE)
316 LIBS="$LIBS -lpcreposix -lpcre"
319 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
324 # Checks for libraries.
325 if test -z "$no_libnsl" ; then
326 AC_CHECK_LIB(nsl, yp_match, , )
328 if test -z "$no_libsocket" ; then
329 AC_CHECK_LIB(socket, main, , )
332 dnl SCO OS3 needs this for libwrap
333 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
335 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
336 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
337 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
339 # We don't want to check if we did an pcre override.
340 if test -z "$no_comp_check" ; then
341 AC_CHECK_FUNC(regcomp,
342 [ AC_DEFINE(HAVE_REGCOMP)],
344 AC_CHECK_LIB(pcre, pcre_info,
346 AC_DEFINE(HAVE_LIBPCRE)
347 LIBS="$LIBS -lpcreposix -lpcre"
350 AC_MSG_ERROR([*** No regex library found.])
357 AC_CHECK_FUNC(strcasecmp,
358 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
360 AC_CHECK_FUNC(utimes,
361 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
366 # Checks for header files.
367 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)
369 # Check whether user wants Kerberos support
371 AC_ARG_WITH(kerberos4,
372 [ --with-kerberos4=PATH Enable Kerberos 4 support],
374 if test "x$withval" != "xno" ; then
376 if test "x$withval" != "xyes" ; then
377 CPPFLAGS="$CPPFLAGS -I${withval}/include"
378 LDFLAGS="$LDFLAGS -L${withval}/lib"
379 if test ! -z "$need_dash_r" ; then
380 LDFLAGS="$LDFLAGS -R${withval}/lib"
382 if test ! -z "$blibpath" ; then
383 blibpath="$blibpath:${withval}/lib"
386 if test -d /usr/include/kerberosIV ; then
387 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
391 AC_CHECK_HEADERS(krb.h)
392 AC_CHECK_LIB(krb, main)
393 if test "$ac_cv_header_krb_h" != yes; then
394 AC_MSG_WARN([Cannot find krb.h, build may fail])
396 if test "$ac_cv_lib_krb_main" != yes; then
397 AC_MSG_WARN([Cannot find libkrb, build may fail])
401 AC_CHECK_LIB(resolv, dn_expand, , )
409 # Check whether user wants AFS support
412 [ --with-afs=PATH Enable AFS support],
414 if test "x$withval" != "xno" ; then
416 if test "x$withval" != "xyes" ; then
417 CPPFLAGS="$CPPFLAGS -I${withval}/include"
418 LDFLAGS="$LDFLAGS -L${withval}/lib"
421 if test -z "$KRB4" ; then
422 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
426 if test ! -z "$AFS_LIBS" ; then
427 LIBS="$LIBS $AFS_LIBS"
436 # Check whether user wants S/Key support
439 [ --with-skey=PATH Enable S/Key support],
441 if test "x$withval" != "xno" ; then
443 if test "x$withval" != "xyes" ; then
444 CPPFLAGS="$CPPFLAGS -I${withval}/include"
445 LDFLAGS="$LDFLAGS -L${withval}/lib"
452 AC_CHECK_FUNC(skey_keyinfo,
455 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
461 # Check whether user wants TCP wrappers support
463 AC_ARG_WITH(tcp-wrappers,
464 [ --with-tcp-wrappers Enable tcpwrappers support],
466 if test "x$withval" != "xno" ; then
469 AC_MSG_CHECKING(for libwrap)
473 int deny_severity = 0, allow_severity = 0;
482 AC_MSG_ERROR([*** libwrap missing])
489 dnl Checks for library functions.
490 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)
491 dnl Checks for time functions
492 AC_CHECK_FUNCS(gettimeofday time)
493 dnl Checks for libutil functions
494 AC_CHECK_HEADERS(libutil.h)
495 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
496 dnl Checks for utmp functions
497 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
498 AC_CHECK_FUNCS(utmpname)
499 dnl Checks for utmpx functions
500 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
501 AC_CHECK_FUNCS(setutxent utmpxname)
503 AC_CHECK_FUNC(getuserattr,
504 [AC_DEFINE(HAVE_GETUSERATTR)],
505 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
509 [AC_DEFINE(HAVE_LOGIN)],
510 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
513 AC_CHECK_FUNC(daemon,
514 [AC_DEFINE(HAVE_DAEMON)],
515 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
518 AC_CHECK_FUNC(getpagesize,
519 [AC_DEFINE(HAVE_GETPAGESIZE)],
520 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
523 # Check for broken snprintf
524 if test "x$ac_cv_func_snprintf" = "xyes" ; then
525 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
529 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
531 [AC_MSG_RESULT(yes)],
534 AC_DEFINE(BROKEN_SNPRINTF)
535 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
545 [ --with-pam Enable PAM support ],
547 if test "x$withval" != "xno" ; then
548 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
549 AC_MSG_ERROR([PAM headers not found])
552 AC_CHECK_LIB(dl, dlopen, , )
553 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
554 AC_CHECK_FUNCS(pam_getenvlist)
564 # Check for older PAM
565 if test "x$PAM_MSG" = "xyes" ; then
566 # Check PAM strerror arguments (old PAM)
567 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
571 #include <security/pam_appl.h>
573 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
576 AC_DEFINE(HAVE_OLD_PAM)
578 PAM_MSG="yes (old library)"
583 # The big search for OpenSSL
585 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
587 if test "x$withval" != "xno" ; then
594 saved_LDFLAGS="$LDFLAGS"
595 saved_CPPFLAGS="$CPPFLAGS"
596 if test "x$prefix" != "xNONE" ; then
597 tryssldir="$tryssldir $prefix"
599 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
600 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
601 CPPFLAGS="$saved_CPPFLAGS"
602 LDFLAGS="$saved_LDFLAGS"
603 LIBS="$saved_LIBS -lcrypto"
605 # Skip directories if they don't exist
606 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
609 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
610 # Try to use $ssldir/lib if it exists, otherwise
612 if test -d "$ssldir/lib" ; then
613 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
614 if test ! -z "$need_dash_r" ; then
615 LDFLAGS="$LDFLAGS -R$ssldir/lib"
618 LDFLAGS="$saved_LDFLAGS -L$ssldir"
619 if test ! -z "$need_dash_r" ; then
620 LDFLAGS="$LDFLAGS -R$ssldir"
623 # Try to use $ssldir/include if it exists, otherwise
625 if test -d "$ssldir/include" ; then
626 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
628 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
632 # Basic test to check for compatible version and correct linking
633 # *does not* test for RSA - that comes later.
637 #include <openssl/rand.h>
641 memset(a, 0, sizeof(a));
642 RAND_add(a, sizeof(a), sizeof(a));
643 return(RAND_status() <= 0);
652 if test ! -z "$found_crypto" ; then
657 if test -z "$found_crypto" ; then
658 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
660 if test -z "$ssldir" ; then
664 ac_cv_openssldir=$ssldir
667 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
668 AC_DEFINE(HAVE_OPENSSL)
669 dnl Need to recover ssldir - test above runs in subshell
670 ssldir=$ac_cv_openssldir
671 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
672 # Try to use $ssldir/lib if it exists, otherwise
674 if test -d "$ssldir/lib" ; then
675 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
676 if test ! -z "$need_dash_r" ; then
677 LDFLAGS="$LDFLAGS -R$ssldir/lib"
680 LDFLAGS="$saved_LDFLAGS -L$ssldir"
681 if test ! -z "$need_dash_r" ; then
682 LDFLAGS="$LDFLAGS -R$ssldir"
685 # Try to use $ssldir/include if it exists, otherwise
687 if test -d "$ssldir/include" ; then
688 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
690 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
694 LIBS="$saved_LIBS -lcrypto"
696 # Now test RSA support
698 AC_MSG_CHECKING([for RSA support])
699 for WANTS_RSAREF in "" 1 ; do
700 if test -z "$WANTS_RSAREF" ; then
703 LIBS="$saved_LIBS -lRSAglue -lrsaref"
707 #include <openssl/rand.h>
708 #include <openssl/rsa.h>
709 #include <openssl/bn.h>
710 #include <openssl/sha.h>
713 int num; RSA *key; static unsigned char p_in[] = "blahblah";
714 unsigned char c[256], p[256];
715 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
716 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
717 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
718 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
727 if test ! -z "$no_rsa" ; then
728 AC_MSG_RESULT(disabled)
731 if test -z "$rsa_works" ; then
732 AC_MSG_WARN([*** No RSA support found *** ])
735 if test -z "$WANTS_RSAREF" ; then
739 RSA_MSG="yes (using RSAref)"
740 AC_MSG_RESULT(using RSAref)
741 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
746 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
747 # version in OpenSSL. Skip this for PAM
748 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
749 AC_CHECK_LIB(crypt, crypt, , )
752 # Cheap hack to ensure NEWS-OS libraries are arranged right.
753 if test ! -z "$SONY" ; then
754 LIBS="$LIBS -liberty";
757 # Checks for data types
758 AC_CHECK_SIZEOF(char, 1)
759 AC_CHECK_SIZEOF(short int, 2)
760 AC_CHECK_SIZEOF(int, 4)
761 AC_CHECK_SIZEOF(long int, 4)
762 AC_CHECK_SIZEOF(long long int, 8)
764 # More checks for data types
765 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
767 [ #include <sys/types.h> ],
769 [ ac_cv_have_u_int="yes" ],
770 [ ac_cv_have_u_int="no" ]
773 if test "x$ac_cv_have_u_int" = "xyes" ; then
774 AC_DEFINE(HAVE_U_INT)
778 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
780 [ #include <sys/types.h> ],
781 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
782 [ ac_cv_have_intxx_t="yes" ],
783 [ ac_cv_have_intxx_t="no" ]
786 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
787 AC_DEFINE(HAVE_INTXX_T)
791 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
793 [ #include <sys/types.h> ],
794 [ int64_t a; a = 1;],
795 [ ac_cv_have_int64_t="yes" ],
796 [ ac_cv_have_int64_t="no" ]
799 if test "x$ac_cv_have_int64_t" = "xyes" ; then
800 AC_DEFINE(HAVE_INT64_T)
804 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
806 [ #include <sys/types.h> ],
807 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
808 [ ac_cv_have_u_intxx_t="yes" ],
809 [ ac_cv_have_u_intxx_t="no" ]
812 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
813 AC_DEFINE(HAVE_U_INTXX_T)
817 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
819 [ #include <sys/types.h> ],
820 [ u_int64_t a; a = 1;],
821 [ ac_cv_have_u_int64_t="yes" ],
822 [ ac_cv_have_u_int64_t="no" ]
825 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
826 AC_DEFINE(HAVE_U_INT64_T)
830 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
831 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
833 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
836 #include <sys/bitypes.h>
839 int8_t a; int16_t b; int32_t c;
840 u_int8_t e; u_int16_t f; u_int32_t g;
841 a = b = c = e = f = g = 1;
844 AC_DEFINE(HAVE_U_INTXX_T)
845 AC_DEFINE(HAVE_INTXX_T)
852 if test -z "$have_u_intxx_t" ; then
853 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
856 #include <sys/types.h>
858 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
859 [ ac_cv_have_uintxx_t="yes" ],
860 [ ac_cv_have_uintxx_t="no" ]
863 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
864 AC_DEFINE(HAVE_UINTXX_T)
868 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
871 #include <sys/types.h>
872 #include <sys/socket.h>
874 [socklen_t foo; foo = 1235;],
875 [ ac_cv_have_socklen_t="yes" ],
876 [ ac_cv_have_socklen_t="no" ]
879 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
880 AC_DEFINE(HAVE_SOCKLEN_T)
883 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
886 #include <sys/types.h>
888 [ size_t foo; foo = 1235; ],
889 [ ac_cv_have_size_t="yes" ],
890 [ ac_cv_have_size_t="no" ]
893 if test "x$ac_cv_have_size_t" = "xyes" ; then
894 AC_DEFINE(HAVE_SIZE_T)
897 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
900 #include <sys/types.h>
902 [ ssize_t foo; foo = 1235; ],
903 [ ac_cv_have_ssize_t="yes" ],
904 [ ac_cv_have_ssize_t="no" ]
907 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
908 AC_DEFINE(HAVE_SSIZE_T)
911 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
916 [ clock_t foo; foo = 1235; ],
917 [ ac_cv_have_clock_t="yes" ],
918 [ ac_cv_have_clock_t="no" ]
921 if test "x$ac_cv_have_clock_t" = "xyes" ; then
922 AC_DEFINE(HAVE_CLOCK_T)
925 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
928 #include <sys/types.h>
929 #include <sys/socket.h>
931 [ sa_family_t foo; foo = 1235; ],
932 [ ac_cv_have_sa_family_t="yes" ],
935 #include <sys/types.h>
936 #include <sys/socket.h>
937 #include <netinet/in.h>
939 [ sa_family_t foo; foo = 1235; ],
940 [ ac_cv_have_sa_family_t="yes" ],
942 [ ac_cv_have_sa_family_t="no" ]
946 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
947 AC_DEFINE(HAVE_SA_FAMILY_T)
950 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
953 #include <sys/types.h>
955 [ pid_t foo; foo = 1235; ],
956 [ ac_cv_have_pid_t="yes" ],
957 [ ac_cv_have_pid_t="no" ]
960 if test "x$ac_cv_have_pid_t" = "xyes" ; then
961 AC_DEFINE(HAVE_PID_T)
964 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
967 #include <sys/types.h>
969 [ mode_t foo; foo = 1235; ],
970 [ ac_cv_have_mode_t="yes" ],
971 [ ac_cv_have_mode_t="no" ]
974 if test "x$ac_cv_have_mode_t" = "xyes" ; then
975 AC_DEFINE(HAVE_MODE_T)
979 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
982 #include <sys/types.h>
983 #include <sys/socket.h>
985 [ struct sockaddr_storage s; ],
986 [ ac_cv_have_struct_sockaddr_storage="yes" ],
987 [ ac_cv_have_struct_sockaddr_storage="no" ]
990 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
991 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
994 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
997 #include <sys/types.h>
998 #include <netinet/in.h>
1000 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1001 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1002 [ ac_cv_have_struct_sockaddr_in6="no" ]
1005 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1006 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1009 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1012 #include <sys/types.h>
1013 #include <netinet/in.h>
1015 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1016 [ ac_cv_have_struct_in6_addr="yes" ],
1017 [ ac_cv_have_struct_in6_addr="no" ]
1020 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1021 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1024 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1027 #include <sys/types.h>
1028 #include <sys/socket.h>
1031 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1032 [ ac_cv_have_struct_addrinfo="yes" ],
1033 [ ac_cv_have_struct_addrinfo="no" ]
1036 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1037 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1040 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1042 [ #include <sys/time.h> ],
1043 [ struct timeval tv; tv.tv_sec = 1;],
1044 [ ac_cv_have_struct_timeval="yes" ],
1045 [ ac_cv_have_struct_timeval="no" ]
1048 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1049 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1050 have_struct_timeval=1
1053 # If we don't have int64_t then we can't compile sftp-server. So don't
1054 # even attempt to do it.
1055 if test "x$ac_cv_have_int64_t" = "xno" -a \
1056 "x$ac_cv_sizeof_long_int" != "x8" -a \
1057 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1062 dnl Checks for structure members
1063 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1064 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1065 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1066 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1067 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1068 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1069 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1070 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1071 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1072 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1073 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1074 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1075 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1076 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1077 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1078 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1079 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1080 AC_STRUCT_ST_BLKSIZE
1082 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1083 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1086 #include <sys/types.h>
1087 #include <sys/socket.h>
1089 [ struct sockaddr_un s; s.sun_len = 1; ],
1090 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1091 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1094 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1095 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1098 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1099 ac_cv_have_ss_family_in_struct_ss, [
1102 #include <sys/types.h>
1103 #include <sys/socket.h>
1105 [ struct sockaddr_storage s; s.ss_family = 1; ],
1106 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1107 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1110 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1111 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1114 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1115 ac_cv_have___ss_family_in_struct_ss, [
1118 #include <sys/types.h>
1119 #include <sys/socket.h>
1121 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1122 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1123 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1126 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1127 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1130 AC_CACHE_CHECK([for pw_class field in struct passwd],
1131 ac_cv_have_pw_class_in_struct_passwd, [
1136 [ struct passwd p; p.pw_class = 0; ],
1137 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1138 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1141 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1142 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1146 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1148 [ extern char *__progname; printf("%s", __progname); ],
1149 [ ac_cv_libc_defines___progname="yes" ],
1150 [ ac_cv_libc_defines___progname="no" ]
1153 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1154 AC_DEFINE(HAVE___PROGNAME)
1158 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1160 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1161 [ ac_cv_libc_defines_sys_errlist="yes" ],
1162 [ ac_cv_libc_defines_sys_errlist="no" ]
1165 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1166 AC_DEFINE(HAVE_SYS_ERRLIST)
1170 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1172 [ extern int sys_nerr; printf("%i", sys_nerr);],
1173 [ ac_cv_libc_defines_sys_nerr="yes" ],
1174 [ ac_cv_libc_defines_sys_nerr="no" ]
1177 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1178 AC_DEFINE(HAVE_SYS_NERR)
1182 # Looking for programs, paths and files
1184 [ --with-rsh=PATH Specify path to remote shell program ],
1186 if test "x$withval" != "$no" ; then
1191 AC_PATH_PROG(rsh_path, rsh)
1196 [ --with-xauth=PATH Specify path to xauth program ],
1198 if test "x$withval" != "xno" ; then
1203 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1204 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1205 xauth_path="/usr/openwin/bin/xauth"
1210 if test -z "$xauth_path" ; then
1211 XAUTH_PATH="undefined"
1212 AC_SUBST(XAUTH_PATH)
1214 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1215 XAUTH_PATH=$xauth_path
1216 AC_SUBST(XAUTH_PATH)
1218 if test ! -z "$rsh_path" ; then
1219 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1222 # Check for mail directory (last resort if we cannot get it from headers)
1223 if test ! -z "$MAIL" ; then
1224 maildir=`dirname $MAIL`
1225 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1228 if test -z "$no_dev_ptmx" ; then
1229 AC_CHECK_FILE("/dev/ptmx",
1231 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1236 AC_CHECK_FILE("/dev/ptc",
1238 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1243 # Options from here on. Some of these are preset by platform above
1245 # Check for user-specified random device, otherwise check /dev/urandom
1247 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1249 if test "x$withval" != "xno" ; then
1250 RANDOM_POOL="$withval";
1251 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1255 # Check for random device
1256 AC_CHECK_FILE("/dev/urandom",
1258 RANDOM_POOL="/dev/urandom";
1259 AC_SUBST(RANDOM_POOL)
1260 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1266 # Check for EGD pool file
1267 AC_ARG_WITH(egd-pool,
1268 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1270 if test "x$withval" != "xno" ; then
1271 EGD_SOCKET="$withval";
1272 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1276 # Check for existing socket only if we don't have a random device already
1277 if test -z "$RANDOM_POOL" ; then
1278 AC_MSG_CHECKING(for PRNGD/EGD socket)
1279 # Insert other locations here
1280 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1281 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
1282 EGD_SOCKET="$egdsock"
1283 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1287 if test -x "$EGD_SOCKET" ; then
1288 AC_MSG_RESULT($EGD_SOCKET)
1290 AC_MSG_RESULT(not found)
1297 # detect pathnames for entropy gathering commands, if we need them
1298 INSTALL_SSH_PRNG_CMDS=""
1300 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1301 # Use these commands to collect entropy
1302 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1303 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1304 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1305 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1306 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1307 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1308 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1309 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1310 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1311 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1312 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1313 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1314 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1315 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1317 INSTALL_SSH_PRNG_CMDS="yes"
1319 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1323 [ --with-catman=man|cat Install preformatted manpages[no]],
1326 if test x"$withval" != x"yes" ; then
1332 if test -z "$MANTYPE" ; then
1333 MANTYPE='$(TROFFMAN)'
1341 # Check whether to enable MD5 passwords
1343 AC_ARG_WITH(md5-passwords,
1344 [ --with-md5-passwords Enable use of MD5 passwords],
1346 if test "x$withval" != "xno" ; then
1347 AC_DEFINE(HAVE_MD5_PASSWORDS)
1353 # Whether to disable shadow password support
1355 [ --without-shadow Disable shadow password support],
1357 if test "x$withval" = "xno" ; then
1358 AC_DEFINE(DISABLE_SHADOW)
1364 if test -z "$disable_shadow" ; then
1365 AC_MSG_CHECKING([if the systems has expire shadow information])
1368 #include <sys/types.h>
1371 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1372 [ sp_expire_available=yes ], []
1375 if test "x$sp_expire_available" = "xyes" ; then
1377 AC_DEFINE(HAS_SHADOW_EXPIRE)
1383 # Use ip address instead of hostname in $DISPLAY
1384 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1385 DISPLAY_HACK_MSG="yes"
1386 AC_DEFINE(IPADDR_IN_DISPLAY)
1388 DISPLAY_HACK_MSG="no"
1389 AC_ARG_WITH(ipaddr-display,
1390 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1392 if test "x$withval" != "xno" ; then
1393 AC_DEFINE(IPADDR_IN_DISPLAY)
1394 DISPLAY_HACK_MSG="yes"
1400 # Whether to mess with the default path
1401 SERVER_PATH_MSG="(default)"
1402 AC_ARG_WITH(default-path,
1403 [ --with-default-path=PATH Specify default \$PATH environment for server],
1405 if test "x$withval" != "xno" ; then
1406 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1407 SERVER_PATH_MSG="$withval"
1412 # Whether to force IPv4 by default (needed on broken glibc Linux)
1414 AC_ARG_WITH(ipv4-default,
1415 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1417 if test "x$withval" != "xno" ; then
1418 AC_DEFINE(IPV4_DEFAULT)
1424 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1425 IPV4_IN6_HACK_MSG="no"
1427 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1429 if test "x$withval" != "xno" ; then
1431 AC_DEFINE(IPV4_IN_IPV6)
1432 IPV4_IN6_HACK_MSG="yes"
1437 if test "x$inet6_default_4in6" = "xyes"; then
1438 AC_MSG_RESULT([yes (default)])
1439 AC_DEFINE(IPV4_IN_IPV6)
1440 IPV4_IN6_HACK_MSG="yes"
1442 AC_MSG_RESULT([no (default)])
1447 # Whether to enable BSD auth support
1448 AC_ARG_WITH(bsd-auth,
1449 [ --with-bsd-auth Enable BSD auth support],
1451 if test "x$withval" != "xno" ; then
1458 AC_MSG_CHECKING(whether to install ssh as suid root)
1459 AC_ARG_ENABLE(suid-ssh,
1460 [ --enable-suid-ssh Install ssh as suid root (default)
1461 --disable-suid-ssh Install ssh without suid bit],
1462 [ case "$enableval" in
1467 *) AC_MSG_RESULT(yes)
1477 # Where to place sshd.pid
1479 AC_ARG_WITH(pid-dir,
1480 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1482 if test "x$withval" != "xno" ; then
1488 # make sure the directory exists
1489 if test ! -d $piddir ; then
1490 piddir=`eval echo ${sysconfdir}`
1492 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1496 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1499 dnl allow user to disable some login recording features
1500 AC_ARG_ENABLE(lastlog,
1501 [ --disable-lastlog disable use of lastlog even if detected [no]],
1502 [ AC_DEFINE(DISABLE_LASTLOG) ]
1505 [ --disable-utmp disable use of utmp even if detected [no]],
1506 [ AC_DEFINE(DISABLE_UTMP) ]
1508 AC_ARG_ENABLE(utmpx,
1509 [ --disable-utmpx disable use of utmpx even if detected [no]],
1510 [ AC_DEFINE(DISABLE_UTMPX) ]
1513 [ --disable-wtmp disable use of wtmp even if detected [no]],
1514 [ AC_DEFINE(DISABLE_WTMP) ]
1516 AC_ARG_ENABLE(wtmpx,
1517 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1518 [ AC_DEFINE(DISABLE_WTMPX) ]
1520 AC_ARG_ENABLE(libutil,
1521 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1522 [ AC_DEFINE(DISABLE_LOGIN) ]
1524 AC_ARG_ENABLE(pututline,
1525 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1526 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1528 AC_ARG_ENABLE(pututxline,
1529 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1530 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1532 AC_ARG_WITH(lastlog,
1533 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1535 if test "x$withval" = "xno" ; then
1536 AC_DEFINE(DISABLE_LASTLOG)
1538 conf_lastlog_location=$withval
1543 dnl lastlog, [uw]tmpx? detection
1544 dnl NOTE: set the paths in the platform section to avoid the
1545 dnl need for command-line parameters
1546 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1548 dnl lastlog detection
1549 dnl NOTE: the code itself will detect if lastlog is a directory
1550 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1552 #include <sys/types.h>
1554 #ifdef HAVE_LASTLOG_H
1555 # include <lastlog.h>
1561 [ char *lastlog = LASTLOG_FILE; ],
1562 [ AC_MSG_RESULT(yes) ],
1565 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1567 #include <sys/types.h>
1569 #ifdef HAVE_LASTLOG_H
1570 # include <lastlog.h>
1576 [ char *lastlog = _PATH_LASTLOG; ],
1577 [ AC_MSG_RESULT(yes) ],
1580 system_lastlog_path=no
1585 if test -z "$conf_lastlog_location"; then
1586 if test x"$system_lastlog_path" = x"no" ; then
1587 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1588 if (test -d "$f" || test -f "$f") ; then
1589 conf_lastlog_location=$f
1592 if test -z "$conf_lastlog_location"; then
1593 AC_MSG_WARN([** Cannot find lastlog **])
1594 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1599 if test -n "$conf_lastlog_location"; then
1600 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1604 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1606 #include <sys/types.h>
1612 [ char *utmp = UTMP_FILE; ],
1613 [ AC_MSG_RESULT(yes) ],
1615 system_utmp_path=no ]
1617 if test -z "$conf_utmp_location"; then
1618 if test x"$system_utmp_path" = x"no" ; then
1619 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1620 if test -f $f ; then
1621 conf_utmp_location=$f
1624 if test -z "$conf_utmp_location"; then
1625 AC_DEFINE(DISABLE_UTMP)
1629 if test -n "$conf_utmp_location"; then
1630 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1634 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1636 #include <sys/types.h>
1642 [ char *wtmp = WTMP_FILE; ],
1643 [ AC_MSG_RESULT(yes) ],
1645 system_wtmp_path=no ]
1647 if test -z "$conf_wtmp_location"; then
1648 if test x"$system_wtmp_path" = x"no" ; then
1649 for f in /usr/adm/wtmp /var/log/wtmp; do
1650 if test -f $f ; then
1651 conf_wtmp_location=$f
1654 if test -z "$conf_wtmp_location"; then
1655 AC_DEFINE(DISABLE_WTMP)
1659 if test -n "$conf_wtmp_location"; then
1660 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1664 dnl utmpx detection - I don't know any system so perverse as to require
1665 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1667 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1669 #include <sys/types.h>
1678 [ char *utmpx = UTMPX_FILE; ],
1679 [ AC_MSG_RESULT(yes) ],
1681 system_utmpx_path=no ]
1683 if test -z "$conf_utmpx_location"; then
1684 if test x"$system_utmpx_path" = x"no" ; then
1685 AC_DEFINE(DISABLE_UTMPX)
1688 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1692 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1694 #include <sys/types.h>
1703 [ char *wtmpx = WTMPX_FILE; ],
1704 [ AC_MSG_RESULT(yes) ],
1706 system_wtmpx_path=no ]
1708 if test -z "$conf_wtmpx_location"; then
1709 if test x"$system_wtmpx_path" = x"no" ; then
1710 AC_DEFINE(DISABLE_WTMPX)
1713 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1717 # Change default command timeout for builtin PRNG
1719 AC_ARG_WITH(entropy-timeout,
1720 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1722 if test "x$withval" != "xno" ; then
1723 entropy_timeout=$withval
1727 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1730 if test ! -z "$blibpath" ; then
1731 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1732 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1737 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1739 # Print summary of options
1741 if test x$MANTYPE = x'$(CATMAN)' ; then
1746 if test ! -z "$RANDOM_POOL" ; then
1747 RAND_MSG="Device ($RANDOM_POOL)"
1749 if test ! -z "$EGD_SOCKET" ; then
1750 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1752 RAND_MSG="Builtin (timeout $entropy_timeout)"
1757 # Someone please show me a better way :)
1758 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1759 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1760 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1761 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1762 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1763 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1764 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1767 echo "OpenSSH configured has been configured with the following options."
1768 echo " User binaries: $B"
1769 echo " System binaries: $C"
1770 echo " Configuration files: $D"
1771 echo " Askpass program: $E"
1772 echo " Manual pages: $F"
1773 echo " PID file: $G"
1774 echo " Random number collection: $RAND_MSG"
1775 echo " Manpage format: $MAN_MSG"
1776 echo " PAM support: ${PAM_MSG}"
1777 echo " KerberosIV support: $KRB4_MSG"
1778 echo " AFS support: $AFS_MSG"
1779 echo " S/KEY support: $SKEY_MSG"
1780 echo " TCP Wrappers support: $TCPW_MSG"
1781 echo " MD5 password support: $MD5_MSG"
1782 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1783 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1784 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1786 if test ! -z "$bsd_auth"; then
1787 echo " BSD Auth support: yes"
1792 echo " Host: ${host}"
1793 echo " Compiler: ${CC}"
1794 echo " Compiler flags: ${CFLAGS}"
1795 echo "Preprocessor flags: ${CPPFLAGS}"
1796 echo " Linker flags: ${LDFLAGS}"
1797 echo " Libraries: ${LIBS}"
1801 if test "x$PAM_MSG" = "xyes" ; then
1802 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1803 echo "otherwise password authentication may fail. Example PAM control files"
1804 echo "can be found in the contrib/ subdirectory"
1808 if test ! -z "$BUILTIN_RNG" ; then
1809 echo "WARNING: you are using the builtin random number collection service."
1810 echo "Please read WARNING.RNG and request that your OS vendor includes"
1811 echo "/dev/random in future versions of their OS."
1815 if test ! -z "$NO_SFTP"; then
1816 echo "sftp-server will be disabled. Your compiler does not support"
1817 echo "64bit integers."