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 check_for_libcrypt_later=1
151 conf_lastlog_location="/usr/adm/lastlog"
152 conf_utmp_location=/etc/utmp
153 conf_wtmp_location=/usr/adm/wtmp
156 AC_DEFINE(BROKEN_REALPATH)
158 AC_DEFINE(BROKEN_SAVED_UIDS)
159 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
163 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
164 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
166 AC_DEFINE(PAM_SUN_CODEBASE)
167 # hardwire lastlog location (can't detect it on some versions)
168 conf_lastlog_location="/var/adm/lastlog"
169 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
170 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
171 if test "$sol2ver" -ge 8; then
173 AC_DEFINE(DISABLE_UTMP)
174 AC_DEFINE(DISABLE_WTMP)
180 CPPFLAGS="$CPPFLAGS -DSUNOS4"
181 AC_CHECK_FUNCS(getpwanam)
182 AC_DEFINE(PAM_SUN_CODEBASE)
183 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
184 conf_utmp_location=/etc/utmp
185 conf_wtmp_location=/var/adm/wtmp
186 conf_lastlog_location=/var/adm/lastlog
192 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
193 LDFLAGS="$LDFLAGS -L/usr/local/lib"
196 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
199 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
200 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
202 IPADDR_IN_DISPLAY=yes
204 AC_DEFINE(IP_TOS_IS_BROKEN)
206 LIBS="$LIBS -lgen -lnsl -lucb"
209 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
210 LDFLAGS="$LDFLAGS -L/usr/local/lib"
217 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
218 LDFLAGS="$LDFLAGS -L/usr/local/lib"
225 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
226 LDFLAGS="$LDFLAGS -L/usr/local/lib"
229 LIBS="$LIBS -lgen -lsocket"
232 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
233 LDFLAGS="$LDFLAGS -L/usr/local/lib"
235 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
237 rsh_path="/usr/bin/rcmd"
240 AC_DEFINE(BROKEN_SYS_TERMIO_H)
242 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
243 AC_DEFINE(DISABLE_SHADOW)
244 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
245 AC_DEFINE(BROKEN_SAVED_UIDS)
246 AC_CHECK_FUNCS(getluid setluid)
249 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
250 LDFLAGS="$LDFLAGS -L/usr/local/lib"
251 LIBS="$LIBS -lprot -lx -ltinfo -lm"
255 rsh_path="/usr/bin/rcmd"
257 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
258 AC_DEFINE(DISABLE_SHADOW)
259 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
260 AC_CHECK_FUNCS(getluid setluid)
263 if test ! -z "USE_SIA" ; then
264 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
265 if test -f /etc/sia/matrix.conf; then
267 AC_DEFINE(HAVE_OSF_SIA)
268 AC_DEFINE(DISABLE_LOGIN)
269 LIBS="$LIBS -lsecurity -ldb -lm -laud"
277 # Allow user to specify flags
279 [ --with-cflags Specify additional flags to pass to compiler],
281 if test "x$withval" != "xno" ; then
282 CFLAGS="$CFLAGS $withval"
286 AC_ARG_WITH(cppflags,
287 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
289 if test "x$withval" != "xno"; then
290 CPPFLAGS="$CPPFLAGS $withval"
295 [ --with-ldflags Specify additional flags to pass to linker],
297 if test "x$withval" != "xno" ; then
298 LDFLAGS="$LDFLAGS $withval"
303 [ --with-libs Specify additional libraries to link with],
305 if test "x$withval" != "xno" ; then
306 LIBS="$LIBS $withval"
312 [ --with-pcre Override built in regex library with pcre],
315 AC_CHECK_LIB(pcre, pcre_info,
317 AC_DEFINE(HAVE_LIBPCRE)
318 LIBS="$LIBS -lpcreposix -lpcre"
321 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
326 # Checks for libraries.
327 if test -z "$no_libnsl" ; then
328 AC_CHECK_LIB(nsl, yp_match, , )
330 if test -z "$no_libsocket" ; then
331 AC_CHECK_LIB(socket, main, , )
334 dnl SCO OS3 needs this for libwrap
335 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
337 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
338 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
339 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
341 # We don't want to check if we did an pcre override.
342 if test -z "$no_comp_check" ; then
343 AC_CHECK_FUNC(regcomp,
344 [ AC_DEFINE(HAVE_REGCOMP)],
346 AC_CHECK_LIB(pcre, pcre_info,
348 AC_DEFINE(HAVE_LIBPCRE)
349 LIBS="$LIBS -lpcreposix -lpcre"
352 AC_MSG_ERROR([*** No regex library found.])
359 AC_CHECK_FUNC(strcasecmp,
360 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
362 AC_CHECK_FUNC(utimes,
363 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
368 # Checks for header files.
369 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)
371 # Check whether user wants Kerberos support
373 AC_ARG_WITH(kerberos4,
374 [ --with-kerberos4=PATH Enable Kerberos 4 support],
376 if test "x$withval" != "xno" ; then
378 if test "x$withval" != "xyes" ; then
379 CPPFLAGS="$CPPFLAGS -I${withval}/include"
380 LDFLAGS="$LDFLAGS -L${withval}/lib"
381 if test ! -z "$need_dash_r" ; then
382 LDFLAGS="$LDFLAGS -R${withval}/lib"
384 if test ! -z "$blibpath" ; then
385 blibpath="$blibpath:${withval}/lib"
388 if test -d /usr/include/kerberosIV ; then
389 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
393 AC_CHECK_HEADERS(krb.h)
394 AC_CHECK_LIB(krb, main)
395 if test "$ac_cv_header_krb_h" != yes; then
396 AC_MSG_WARN([Cannot find krb.h, build may fail])
398 if test "$ac_cv_lib_krb_main" != yes; then
399 AC_MSG_WARN([Cannot find libkrb, build may fail])
403 AC_CHECK_LIB(resolv, dn_expand, , )
411 # Check whether user wants AFS support
414 [ --with-afs=PATH Enable AFS support],
416 if test "x$withval" != "xno" ; then
418 if test "x$withval" != "xyes" ; then
419 CPPFLAGS="$CPPFLAGS -I${withval}/include"
420 LDFLAGS="$LDFLAGS -L${withval}/lib"
423 if test -z "$KRB4" ; then
424 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
428 if test ! -z "$AFS_LIBS" ; then
429 LIBS="$LIBS $AFS_LIBS"
438 # Check whether user wants S/Key support
441 [ --with-skey=PATH Enable S/Key support],
443 if test "x$withval" != "xno" ; then
445 if test "x$withval" != "xyes" ; then
446 CPPFLAGS="$CPPFLAGS -I${withval}/include"
447 LDFLAGS="$LDFLAGS -L${withval}/lib"
454 AC_CHECK_FUNC(skey_keyinfo,
457 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
463 # Check whether user wants TCP wrappers support
465 AC_ARG_WITH(tcp-wrappers,
466 [ --with-tcp-wrappers Enable tcpwrappers support],
468 if test "x$withval" != "xno" ; then
471 AC_MSG_CHECKING(for libwrap)
475 int deny_severity = 0, allow_severity = 0;
484 AC_MSG_ERROR([*** libwrap missing])
491 dnl Checks for library functions.
492 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)
493 dnl Checks for time functions
494 AC_CHECK_FUNCS(gettimeofday time)
495 dnl Checks for libutil functions
496 AC_CHECK_HEADERS(libutil.h)
497 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
498 dnl Checks for utmp functions
499 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
500 AC_CHECK_FUNCS(utmpname)
501 dnl Checks for utmpx functions
502 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
503 AC_CHECK_FUNCS(setutxent utmpxname)
505 AC_CHECK_FUNC(getuserattr,
506 [AC_DEFINE(HAVE_GETUSERATTR)],
507 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
511 [AC_DEFINE(HAVE_LOGIN)],
512 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
515 AC_CHECK_FUNC(daemon,
516 [AC_DEFINE(HAVE_DAEMON)],
517 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
520 AC_CHECK_FUNC(getpagesize,
521 [AC_DEFINE(HAVE_GETPAGESIZE)],
522 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
525 # Check for broken snprintf
526 if test "x$ac_cv_func_snprintf" = "xyes" ; then
527 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
531 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
533 [AC_MSG_RESULT(yes)],
536 AC_DEFINE(BROKEN_SNPRINTF)
537 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
547 [ --with-pam Enable PAM support ],
549 if test "x$withval" != "xno" ; then
550 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
551 AC_MSG_ERROR([PAM headers not found])
554 AC_CHECK_LIB(dl, dlopen, , )
555 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
556 AC_CHECK_FUNCS(pam_getenvlist)
566 # Check for older PAM
567 if test "x$PAM_MSG" = "xyes" ; then
568 # Check PAM strerror arguments (old PAM)
569 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
573 #include <security/pam_appl.h>
575 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
578 AC_DEFINE(HAVE_OLD_PAM)
580 PAM_MSG="yes (old library)"
585 # The big search for OpenSSL
587 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
589 if test "x$withval" != "xno" ; then
596 saved_LDFLAGS="$LDFLAGS"
597 saved_CPPFLAGS="$CPPFLAGS"
598 if test "x$prefix" != "xNONE" ; then
599 tryssldir="$tryssldir $prefix"
601 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
602 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
603 CPPFLAGS="$saved_CPPFLAGS"
604 LDFLAGS="$saved_LDFLAGS"
605 LIBS="$saved_LIBS -lcrypto"
607 # Skip directories if they don't exist
608 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
611 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
612 # Try to use $ssldir/lib if it exists, otherwise
614 if test -d "$ssldir/lib" ; then
615 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
616 if test ! -z "$need_dash_r" ; then
617 LDFLAGS="$LDFLAGS -R$ssldir/lib"
620 LDFLAGS="$saved_LDFLAGS -L$ssldir"
621 if test ! -z "$need_dash_r" ; then
622 LDFLAGS="$LDFLAGS -R$ssldir"
625 # Try to use $ssldir/include if it exists, otherwise
627 if test -d "$ssldir/include" ; then
628 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
630 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
634 # Basic test to check for compatible version and correct linking
635 # *does not* test for RSA - that comes later.
639 #include <openssl/rand.h>
643 memset(a, 0, sizeof(a));
644 RAND_add(a, sizeof(a), sizeof(a));
645 return(RAND_status() <= 0);
654 if test ! -z "$found_crypto" ; then
659 if test -z "$found_crypto" ; then
660 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
662 if test -z "$ssldir" ; then
666 ac_cv_openssldir=$ssldir
669 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
670 AC_DEFINE(HAVE_OPENSSL)
671 dnl Need to recover ssldir - test above runs in subshell
672 ssldir=$ac_cv_openssldir
673 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
674 # Try to use $ssldir/lib if it exists, otherwise
676 if test -d "$ssldir/lib" ; then
677 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
678 if test ! -z "$need_dash_r" ; then
679 LDFLAGS="$LDFLAGS -R$ssldir/lib"
682 LDFLAGS="$saved_LDFLAGS -L$ssldir"
683 if test ! -z "$need_dash_r" ; then
684 LDFLAGS="$LDFLAGS -R$ssldir"
687 # Try to use $ssldir/include if it exists, otherwise
689 if test -d "$ssldir/include" ; then
690 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
692 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
696 LIBS="$saved_LIBS -lcrypto"
698 # Now test RSA support
700 AC_MSG_CHECKING([for RSA support])
701 for WANTS_RSAREF in "" 1 ; do
702 if test -z "$WANTS_RSAREF" ; then
705 LIBS="$saved_LIBS -lRSAglue -lrsaref"
709 #include <openssl/rand.h>
710 #include <openssl/rsa.h>
711 #include <openssl/bn.h>
712 #include <openssl/sha.h>
715 int num; RSA *key; static unsigned char p_in[] = "blahblah";
716 unsigned char c[256], p[256];
717 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
718 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
719 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
720 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
729 if test ! -z "$no_rsa" ; then
730 AC_MSG_RESULT(disabled)
733 if test -z "$rsa_works" ; then
734 AC_MSG_WARN([*** No RSA support found *** ])
737 if test -z "$WANTS_RSAREF" ; then
741 RSA_MSG="yes (using RSAref)"
742 AC_MSG_RESULT(using RSAref)
743 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
748 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
749 # version in OpenSSL. Skip this for PAM
750 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
751 AC_CHECK_LIB(crypt, crypt, , )
754 # Cheap hack to ensure NEWS-OS libraries are arranged right.
755 if test ! -z "$SONY" ; then
756 LIBS="$LIBS -liberty";
759 # Checks for data types
760 AC_CHECK_SIZEOF(char, 1)
761 AC_CHECK_SIZEOF(short int, 2)
762 AC_CHECK_SIZEOF(int, 4)
763 AC_CHECK_SIZEOF(long int, 4)
764 AC_CHECK_SIZEOF(long long int, 8)
766 # More checks for data types
767 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
769 [ #include <sys/types.h> ],
771 [ ac_cv_have_u_int="yes" ],
772 [ ac_cv_have_u_int="no" ]
775 if test "x$ac_cv_have_u_int" = "xyes" ; then
776 AC_DEFINE(HAVE_U_INT)
780 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
782 [ #include <sys/types.h> ],
783 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
784 [ ac_cv_have_intxx_t="yes" ],
785 [ ac_cv_have_intxx_t="no" ]
788 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
789 AC_DEFINE(HAVE_INTXX_T)
793 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
795 [ #include <sys/types.h> ],
796 [ int64_t a; a = 1;],
797 [ ac_cv_have_int64_t="yes" ],
798 [ ac_cv_have_int64_t="no" ]
801 if test "x$ac_cv_have_int64_t" = "xyes" ; then
802 AC_DEFINE(HAVE_INT64_T)
806 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
808 [ #include <sys/types.h> ],
809 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
810 [ ac_cv_have_u_intxx_t="yes" ],
811 [ ac_cv_have_u_intxx_t="no" ]
814 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
815 AC_DEFINE(HAVE_U_INTXX_T)
819 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
821 [ #include <sys/types.h> ],
822 [ u_int64_t a; a = 1;],
823 [ ac_cv_have_u_int64_t="yes" ],
824 [ ac_cv_have_u_int64_t="no" ]
827 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
828 AC_DEFINE(HAVE_U_INT64_T)
832 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
833 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
835 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
838 #include <sys/bitypes.h>
841 int8_t a; int16_t b; int32_t c;
842 u_int8_t e; u_int16_t f; u_int32_t g;
843 a = b = c = e = f = g = 1;
846 AC_DEFINE(HAVE_U_INTXX_T)
847 AC_DEFINE(HAVE_INTXX_T)
854 if test -z "$have_u_intxx_t" ; then
855 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
858 #include <sys/types.h>
860 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
861 [ ac_cv_have_uintxx_t="yes" ],
862 [ ac_cv_have_uintxx_t="no" ]
865 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
866 AC_DEFINE(HAVE_UINTXX_T)
870 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
873 #include <sys/types.h>
874 #include <sys/socket.h>
876 [socklen_t foo; foo = 1235;],
877 [ ac_cv_have_socklen_t="yes" ],
878 [ ac_cv_have_socklen_t="no" ]
881 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
882 AC_DEFINE(HAVE_SOCKLEN_T)
885 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
888 #include <sys/types.h>
890 [ size_t foo; foo = 1235; ],
891 [ ac_cv_have_size_t="yes" ],
892 [ ac_cv_have_size_t="no" ]
895 if test "x$ac_cv_have_size_t" = "xyes" ; then
896 AC_DEFINE(HAVE_SIZE_T)
899 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
902 #include <sys/types.h>
904 [ ssize_t foo; foo = 1235; ],
905 [ ac_cv_have_ssize_t="yes" ],
906 [ ac_cv_have_ssize_t="no" ]
909 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
910 AC_DEFINE(HAVE_SSIZE_T)
913 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
918 [ clock_t foo; foo = 1235; ],
919 [ ac_cv_have_clock_t="yes" ],
920 [ ac_cv_have_clock_t="no" ]
923 if test "x$ac_cv_have_clock_t" = "xyes" ; then
924 AC_DEFINE(HAVE_CLOCK_T)
927 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
930 #include <sys/types.h>
931 #include <sys/socket.h>
933 [ sa_family_t foo; foo = 1235; ],
934 [ ac_cv_have_sa_family_t="yes" ],
937 #include <sys/types.h>
938 #include <sys/socket.h>
939 #include <netinet/in.h>
941 [ sa_family_t foo; foo = 1235; ],
942 [ ac_cv_have_sa_family_t="yes" ],
944 [ ac_cv_have_sa_family_t="no" ]
948 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
949 AC_DEFINE(HAVE_SA_FAMILY_T)
952 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
955 #include <sys/types.h>
957 [ pid_t foo; foo = 1235; ],
958 [ ac_cv_have_pid_t="yes" ],
959 [ ac_cv_have_pid_t="no" ]
962 if test "x$ac_cv_have_pid_t" = "xyes" ; then
963 AC_DEFINE(HAVE_PID_T)
966 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
969 #include <sys/types.h>
971 [ mode_t foo; foo = 1235; ],
972 [ ac_cv_have_mode_t="yes" ],
973 [ ac_cv_have_mode_t="no" ]
976 if test "x$ac_cv_have_mode_t" = "xyes" ; then
977 AC_DEFINE(HAVE_MODE_T)
981 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
984 #include <sys/types.h>
985 #include <sys/socket.h>
987 [ struct sockaddr_storage s; ],
988 [ ac_cv_have_struct_sockaddr_storage="yes" ],
989 [ ac_cv_have_struct_sockaddr_storage="no" ]
992 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
993 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
996 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
999 #include <sys/types.h>
1000 #include <netinet/in.h>
1002 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1003 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1004 [ ac_cv_have_struct_sockaddr_in6="no" ]
1007 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1008 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1011 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1014 #include <sys/types.h>
1015 #include <netinet/in.h>
1017 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1018 [ ac_cv_have_struct_in6_addr="yes" ],
1019 [ ac_cv_have_struct_in6_addr="no" ]
1022 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1023 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1026 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1029 #include <sys/types.h>
1030 #include <sys/socket.h>
1033 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1034 [ ac_cv_have_struct_addrinfo="yes" ],
1035 [ ac_cv_have_struct_addrinfo="no" ]
1038 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1039 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1042 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1044 [ #include <sys/time.h> ],
1045 [ struct timeval tv; tv.tv_sec = 1;],
1046 [ ac_cv_have_struct_timeval="yes" ],
1047 [ ac_cv_have_struct_timeval="no" ]
1050 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1051 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1052 have_struct_timeval=1
1055 # If we don't have int64_t then we can't compile sftp-server. So don't
1056 # even attempt to do it.
1057 if test "x$ac_cv_have_int64_t" = "xno" -a \
1058 "x$ac_cv_sizeof_long_int" != "x8" -a \
1059 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1064 dnl Checks for structure members
1065 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1066 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1067 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1068 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1069 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1070 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1071 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1072 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1073 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1074 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1075 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1076 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1077 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1078 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1079 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1080 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1081 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1082 AC_STRUCT_ST_BLKSIZE
1084 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1085 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1088 #include <sys/types.h>
1089 #include <sys/socket.h>
1091 [ struct sockaddr_un s; s.sun_len = 1; ],
1092 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1093 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1096 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1097 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1100 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1101 ac_cv_have_ss_family_in_struct_ss, [
1104 #include <sys/types.h>
1105 #include <sys/socket.h>
1107 [ struct sockaddr_storage s; s.ss_family = 1; ],
1108 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1109 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1112 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1113 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1116 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1117 ac_cv_have___ss_family_in_struct_ss, [
1120 #include <sys/types.h>
1121 #include <sys/socket.h>
1123 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1124 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1125 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1128 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1129 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1132 AC_CACHE_CHECK([for pw_class field in struct passwd],
1133 ac_cv_have_pw_class_in_struct_passwd, [
1138 [ struct passwd p; p.pw_class = 0; ],
1139 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1140 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1143 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1144 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1148 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1150 [ extern char *__progname; printf("%s", __progname); ],
1151 [ ac_cv_libc_defines___progname="yes" ],
1152 [ ac_cv_libc_defines___progname="no" ]
1155 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1156 AC_DEFINE(HAVE___PROGNAME)
1160 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1162 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1163 [ ac_cv_libc_defines_sys_errlist="yes" ],
1164 [ ac_cv_libc_defines_sys_errlist="no" ]
1167 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1168 AC_DEFINE(HAVE_SYS_ERRLIST)
1172 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1174 [ extern int sys_nerr; printf("%i", sys_nerr);],
1175 [ ac_cv_libc_defines_sys_nerr="yes" ],
1176 [ ac_cv_libc_defines_sys_nerr="no" ]
1179 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1180 AC_DEFINE(HAVE_SYS_NERR)
1184 # Looking for programs, paths and files
1186 [ --with-rsh=PATH Specify path to remote shell program ],
1188 if test "x$withval" != "$no" ; then
1193 AC_PATH_PROG(rsh_path, rsh)
1198 [ --with-xauth=PATH Specify path to xauth program ],
1200 if test "x$withval" != "xno" ; then
1205 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1206 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1207 xauth_path="/usr/openwin/bin/xauth"
1212 if test -z "$xauth_path" ; then
1213 XAUTH_PATH="undefined"
1214 AC_SUBST(XAUTH_PATH)
1216 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1217 XAUTH_PATH=$xauth_path
1218 AC_SUBST(XAUTH_PATH)
1220 if test ! -z "$rsh_path" ; then
1221 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1224 # Check for mail directory (last resort if we cannot get it from headers)
1225 if test ! -z "$MAIL" ; then
1226 maildir=`dirname $MAIL`
1227 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1230 if test -z "$no_dev_ptmx" ; then
1231 AC_CHECK_FILE("/dev/ptmx",
1233 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1238 AC_CHECK_FILE("/dev/ptc",
1240 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1245 # Options from here on. Some of these are preset by platform above
1247 # Check for user-specified random device, otherwise check /dev/urandom
1249 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1251 if test "x$withval" != "xno" ; then
1252 RANDOM_POOL="$withval";
1253 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1257 # Check for random device
1258 AC_CHECK_FILE("/dev/urandom",
1260 RANDOM_POOL="/dev/urandom";
1261 AC_SUBST(RANDOM_POOL)
1262 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1268 # Check for EGD pool file
1269 AC_ARG_WITH(egd-pool,
1270 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1272 if test "x$withval" != "xno" ; then
1273 EGD_SOCKET="$withval";
1274 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1278 # Check for existing socket only if we don't have a random device already
1279 if test -z "$RANDOM_POOL" ; then
1280 AC_MSG_CHECKING(for PRNGD/EGD socket)
1281 # Insert other locations here
1282 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1283 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
1284 EGD_SOCKET="$egdsock"
1285 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1289 if test -x "$EGD_SOCKET" ; then
1290 AC_MSG_RESULT($EGD_SOCKET)
1292 AC_MSG_RESULT(not found)
1299 # detect pathnames for entropy gathering commands, if we need them
1300 INSTALL_SSH_PRNG_CMDS=""
1302 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1303 # Use these commands to collect entropy
1304 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1305 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1306 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1307 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1308 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1309 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1310 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1311 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1312 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1313 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1314 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1315 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1316 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1317 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1319 INSTALL_SSH_PRNG_CMDS="yes"
1321 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1325 [ --with-catman=man|cat Install preformatted manpages[no]],
1328 if test x"$withval" != x"yes" ; then
1334 if test -z "$MANTYPE" ; then
1335 MANTYPE='$(TROFFMAN)'
1343 # Check whether to enable MD5 passwords
1345 AC_ARG_WITH(md5-passwords,
1346 [ --with-md5-passwords Enable use of MD5 passwords],
1348 if test "x$withval" != "xno" ; then
1349 AC_DEFINE(HAVE_MD5_PASSWORDS)
1355 # Whether to disable shadow password support
1357 [ --without-shadow Disable shadow password support],
1359 if test "x$withval" = "xno" ; then
1360 AC_DEFINE(DISABLE_SHADOW)
1366 if test -z "$disable_shadow" ; then
1367 AC_MSG_CHECKING([if the systems has expire shadow information])
1370 #include <sys/types.h>
1373 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1374 [ sp_expire_available=yes ], []
1377 if test "x$sp_expire_available" = "xyes" ; then
1379 AC_DEFINE(HAS_SHADOW_EXPIRE)
1385 # Use ip address instead of hostname in $DISPLAY
1386 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1387 DISPLAY_HACK_MSG="yes"
1388 AC_DEFINE(IPADDR_IN_DISPLAY)
1390 DISPLAY_HACK_MSG="no"
1391 AC_ARG_WITH(ipaddr-display,
1392 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1394 if test "x$withval" != "xno" ; then
1395 AC_DEFINE(IPADDR_IN_DISPLAY)
1396 DISPLAY_HACK_MSG="yes"
1402 # Whether to mess with the default path
1403 SERVER_PATH_MSG="(default)"
1404 AC_ARG_WITH(default-path,
1405 [ --with-default-path=PATH Specify default \$PATH environment for server],
1407 if test "x$withval" != "xno" ; then
1408 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1409 SERVER_PATH_MSG="$withval"
1414 # Whether to force IPv4 by default (needed on broken glibc Linux)
1416 AC_ARG_WITH(ipv4-default,
1417 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1419 if test "x$withval" != "xno" ; then
1420 AC_DEFINE(IPV4_DEFAULT)
1426 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1427 IPV4_IN6_HACK_MSG="no"
1429 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1431 if test "x$withval" != "xno" ; then
1433 AC_DEFINE(IPV4_IN_IPV6)
1434 IPV4_IN6_HACK_MSG="yes"
1439 if test "x$inet6_default_4in6" = "xyes"; then
1440 AC_MSG_RESULT([yes (default)])
1441 AC_DEFINE(IPV4_IN_IPV6)
1442 IPV4_IN6_HACK_MSG="yes"
1444 AC_MSG_RESULT([no (default)])
1449 # Whether to enable BSD auth support
1450 AC_ARG_WITH(bsd-auth,
1451 [ --with-bsd-auth Enable BSD auth support],
1453 if test "x$withval" != "xno" ; then
1460 AC_MSG_CHECKING(whether to install ssh as suid root)
1461 AC_ARG_ENABLE(suid-ssh,
1462 [ --enable-suid-ssh Install ssh as suid root (default)
1463 --disable-suid-ssh Install ssh without suid bit],
1464 [ case "$enableval" in
1469 *) AC_MSG_RESULT(yes)
1479 # Where to place sshd.pid
1481 AC_ARG_WITH(pid-dir,
1482 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1484 if test "x$withval" != "xno" ; then
1490 # make sure the directory exists
1491 if test ! -d $piddir ; then
1492 piddir=`eval echo ${sysconfdir}`
1494 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1498 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1501 dnl allow user to disable some login recording features
1502 AC_ARG_ENABLE(lastlog,
1503 [ --disable-lastlog disable use of lastlog even if detected [no]],
1504 [ AC_DEFINE(DISABLE_LASTLOG) ]
1507 [ --disable-utmp disable use of utmp even if detected [no]],
1508 [ AC_DEFINE(DISABLE_UTMP) ]
1510 AC_ARG_ENABLE(utmpx,
1511 [ --disable-utmpx disable use of utmpx even if detected [no]],
1512 [ AC_DEFINE(DISABLE_UTMPX) ]
1515 [ --disable-wtmp disable use of wtmp even if detected [no]],
1516 [ AC_DEFINE(DISABLE_WTMP) ]
1518 AC_ARG_ENABLE(wtmpx,
1519 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1520 [ AC_DEFINE(DISABLE_WTMPX) ]
1522 AC_ARG_ENABLE(libutil,
1523 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1524 [ AC_DEFINE(DISABLE_LOGIN) ]
1526 AC_ARG_ENABLE(pututline,
1527 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1528 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1530 AC_ARG_ENABLE(pututxline,
1531 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1532 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1534 AC_ARG_WITH(lastlog,
1535 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1537 if test "x$withval" = "xno" ; then
1538 AC_DEFINE(DISABLE_LASTLOG)
1540 conf_lastlog_location=$withval
1545 dnl lastlog, [uw]tmpx? detection
1546 dnl NOTE: set the paths in the platform section to avoid the
1547 dnl need for command-line parameters
1548 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1550 dnl lastlog detection
1551 dnl NOTE: the code itself will detect if lastlog is a directory
1552 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1554 #include <sys/types.h>
1556 #ifdef HAVE_LASTLOG_H
1557 # include <lastlog.h>
1563 [ char *lastlog = LASTLOG_FILE; ],
1564 [ AC_MSG_RESULT(yes) ],
1567 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1569 #include <sys/types.h>
1571 #ifdef HAVE_LASTLOG_H
1572 # include <lastlog.h>
1578 [ char *lastlog = _PATH_LASTLOG; ],
1579 [ AC_MSG_RESULT(yes) ],
1582 system_lastlog_path=no
1587 if test -z "$conf_lastlog_location"; then
1588 if test x"$system_lastlog_path" = x"no" ; then
1589 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1590 if (test -d "$f" || test -f "$f") ; then
1591 conf_lastlog_location=$f
1594 if test -z "$conf_lastlog_location"; then
1595 AC_MSG_WARN([** Cannot find lastlog **])
1596 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1601 if test -n "$conf_lastlog_location"; then
1602 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1606 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1608 #include <sys/types.h>
1614 [ char *utmp = UTMP_FILE; ],
1615 [ AC_MSG_RESULT(yes) ],
1617 system_utmp_path=no ]
1619 if test -z "$conf_utmp_location"; then
1620 if test x"$system_utmp_path" = x"no" ; then
1621 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1622 if test -f $f ; then
1623 conf_utmp_location=$f
1626 if test -z "$conf_utmp_location"; then
1627 AC_DEFINE(DISABLE_UTMP)
1631 if test -n "$conf_utmp_location"; then
1632 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1636 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1638 #include <sys/types.h>
1644 [ char *wtmp = WTMP_FILE; ],
1645 [ AC_MSG_RESULT(yes) ],
1647 system_wtmp_path=no ]
1649 if test -z "$conf_wtmp_location"; then
1650 if test x"$system_wtmp_path" = x"no" ; then
1651 for f in /usr/adm/wtmp /var/log/wtmp; do
1652 if test -f $f ; then
1653 conf_wtmp_location=$f
1656 if test -z "$conf_wtmp_location"; then
1657 AC_DEFINE(DISABLE_WTMP)
1661 if test -n "$conf_wtmp_location"; then
1662 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1666 dnl utmpx detection - I don't know any system so perverse as to require
1667 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1669 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1671 #include <sys/types.h>
1680 [ char *utmpx = UTMPX_FILE; ],
1681 [ AC_MSG_RESULT(yes) ],
1683 system_utmpx_path=no ]
1685 if test -z "$conf_utmpx_location"; then
1686 if test x"$system_utmpx_path" = x"no" ; then
1687 AC_DEFINE(DISABLE_UTMPX)
1690 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1694 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1696 #include <sys/types.h>
1705 [ char *wtmpx = WTMPX_FILE; ],
1706 [ AC_MSG_RESULT(yes) ],
1708 system_wtmpx_path=no ]
1710 if test -z "$conf_wtmpx_location"; then
1711 if test x"$system_wtmpx_path" = x"no" ; then
1712 AC_DEFINE(DISABLE_WTMPX)
1715 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1719 # Change default command timeout for builtin PRNG
1721 AC_ARG_WITH(entropy-timeout,
1722 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1724 if test "x$withval" != "xno" ; then
1725 entropy_timeout=$withval
1729 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1732 if test ! -z "$blibpath" ; then
1733 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1734 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1739 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1741 # Print summary of options
1743 if test x$MANTYPE = x'$(CATMAN)' ; then
1748 if test ! -z "$RANDOM_POOL" ; then
1749 RAND_MSG="Device ($RANDOM_POOL)"
1751 if test ! -z "$EGD_SOCKET" ; then
1752 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1754 RAND_MSG="Builtin (timeout $entropy_timeout)"
1759 # Someone please show me a better way :)
1760 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1761 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1762 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1763 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1764 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1765 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1766 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1769 echo "OpenSSH configured has been configured with the following options."
1770 echo " User binaries: $B"
1771 echo " System binaries: $C"
1772 echo " Configuration files: $D"
1773 echo " Askpass program: $E"
1774 echo " Manual pages: $F"
1775 echo " PID file: $G"
1776 echo " Random number collection: $RAND_MSG"
1777 echo " Manpage format: $MAN_MSG"
1778 echo " PAM support: ${PAM_MSG}"
1779 echo " KerberosIV support: $KRB4_MSG"
1780 echo " AFS support: $AFS_MSG"
1781 echo " S/KEY support: $SKEY_MSG"
1782 echo " TCP Wrappers support: $TCPW_MSG"
1783 echo " MD5 password support: $MD5_MSG"
1784 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1785 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1786 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1788 if test ! -z "$bsd_auth"; then
1789 echo " BSD Auth support: yes"
1794 echo " Host: ${host}"
1795 echo " Compiler: ${CC}"
1796 echo " Compiler flags: ${CFLAGS}"
1797 echo "Preprocessor flags: ${CPPFLAGS}"
1798 echo " Linker flags: ${LDFLAGS}"
1799 echo " Libraries: ${LIBS}"
1803 if test "x$PAM_MSG" = "xyes" ; then
1804 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1805 echo "otherwise password authentication may fail. Example PAM control files"
1806 echo "can be found in the contrib/ subdirectory"
1810 if test ! -z "$BUILTIN_RNG" ; then
1811 echo "WARNING: you are using the builtin random number collection service."
1812 echo "Please read WARNING.RNG and request that your OS vendor includes"
1813 echo "/dev/random in future versions of their OS."
1817 if test ! -z "$NO_SFTP"; then
1818 echo "sftp-server will be disabled. Your compiler does not support"
1819 echo "64bit integers."