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_DEFINE(BROKEN_SAVED_UIDS)
261 AC_CHECK_FUNCS(getluid setluid)
264 if test ! -z "USE_SIA" ; then
265 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
266 if test -f /etc/sia/matrix.conf; then
268 AC_DEFINE(HAVE_OSF_SIA)
269 AC_DEFINE(DISABLE_LOGIN)
270 LIBS="$LIBS -lsecurity -ldb -lm -laud"
278 # Allow user to specify flags
280 [ --with-cflags Specify additional flags to pass to compiler],
282 if test "x$withval" != "xno" ; then
283 CFLAGS="$CFLAGS $withval"
287 AC_ARG_WITH(cppflags,
288 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
290 if test "x$withval" != "xno"; then
291 CPPFLAGS="$CPPFLAGS $withval"
296 [ --with-ldflags Specify additional flags to pass to linker],
298 if test "x$withval" != "xno" ; then
299 LDFLAGS="$LDFLAGS $withval"
304 [ --with-libs Specify additional libraries to link with],
306 if test "x$withval" != "xno" ; then
307 LIBS="$LIBS $withval"
313 [ --with-pcre Override built in regex library with pcre],
316 AC_CHECK_LIB(pcre, pcre_info,
318 AC_DEFINE(HAVE_LIBPCRE)
319 LIBS="$LIBS -lpcreposix -lpcre"
322 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
327 # Checks for libraries.
328 if test -z "$no_libnsl" ; then
329 AC_CHECK_LIB(nsl, yp_match, , )
331 if test -z "$no_libsocket" ; then
332 AC_CHECK_LIB(socket, main, , )
335 dnl SCO OS3 needs this for libwrap
336 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
338 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
339 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
340 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
342 # We don't want to check if we did an pcre override.
343 if test -z "$no_comp_check" ; then
344 AC_CHECK_FUNC(regcomp,
345 [ AC_DEFINE(HAVE_REGCOMP)],
347 AC_CHECK_LIB(pcre, pcre_info,
349 AC_DEFINE(HAVE_LIBPCRE)
350 LIBS="$LIBS -lpcreposix -lpcre"
353 AC_MSG_ERROR([*** No regex library found.])
360 AC_CHECK_FUNC(strcasecmp,
361 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
363 AC_CHECK_FUNC(utimes,
364 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
369 # Checks for header files.
370 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)
372 # Check whether user wants Kerberos support
374 AC_ARG_WITH(kerberos4,
375 [ --with-kerberos4=PATH Enable Kerberos 4 support],
377 if test "x$withval" != "xno" ; then
379 if test "x$withval" != "xyes" ; then
380 CPPFLAGS="$CPPFLAGS -I${withval}/include"
381 LDFLAGS="$LDFLAGS -L${withval}/lib"
382 if test ! -z "$need_dash_r" ; then
383 LDFLAGS="$LDFLAGS -R${withval}/lib"
385 if test ! -z "$blibpath" ; then
386 blibpath="$blibpath:${withval}/lib"
389 if test -d /usr/include/kerberosIV ; then
390 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
394 AC_CHECK_HEADERS(krb.h)
395 AC_CHECK_LIB(krb, main)
396 if test "$ac_cv_header_krb_h" != yes; then
397 AC_MSG_WARN([Cannot find krb.h, build may fail])
399 if test "$ac_cv_lib_krb_main" != yes; then
400 AC_MSG_WARN([Cannot find libkrb, build may fail])
404 AC_CHECK_LIB(resolv, dn_expand, , )
412 # Check whether user wants AFS support
415 [ --with-afs=PATH Enable AFS support],
417 if test "x$withval" != "xno" ; then
419 if test "x$withval" != "xyes" ; then
420 CPPFLAGS="$CPPFLAGS -I${withval}/include"
421 LDFLAGS="$LDFLAGS -L${withval}/lib"
424 if test -z "$KRB4" ; then
425 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
429 if test ! -z "$AFS_LIBS" ; then
430 LIBS="$LIBS $AFS_LIBS"
439 # Check whether user wants S/Key support
442 [ --with-skey=PATH Enable S/Key support],
444 if test "x$withval" != "xno" ; then
446 if test "x$withval" != "xyes" ; then
447 CPPFLAGS="$CPPFLAGS -I${withval}/include"
448 LDFLAGS="$LDFLAGS -L${withval}/lib"
455 AC_CHECK_FUNC(skey_keyinfo,
458 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
464 # Check whether user wants TCP wrappers support
466 AC_ARG_WITH(tcp-wrappers,
467 [ --with-tcp-wrappers Enable tcpwrappers support],
469 if test "x$withval" != "xno" ; then
472 AC_MSG_CHECKING(for libwrap)
476 int deny_severity = 0, allow_severity = 0;
485 AC_MSG_ERROR([*** libwrap missing])
492 dnl Checks for library functions.
493 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)
494 dnl Checks for time functions
495 AC_CHECK_FUNCS(gettimeofday time)
496 dnl Checks for libutil functions
497 AC_CHECK_HEADERS(libutil.h)
498 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
499 dnl Checks for utmp functions
500 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
501 AC_CHECK_FUNCS(utmpname)
502 dnl Checks for utmpx functions
503 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
504 AC_CHECK_FUNCS(setutxent utmpxname)
506 AC_CHECK_FUNC(getuserattr,
507 [AC_DEFINE(HAVE_GETUSERATTR)],
508 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
512 [AC_DEFINE(HAVE_LOGIN)],
513 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
516 AC_CHECK_FUNC(daemon,
517 [AC_DEFINE(HAVE_DAEMON)],
518 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
521 AC_CHECK_FUNC(getpagesize,
522 [AC_DEFINE(HAVE_GETPAGESIZE)],
523 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
526 # Check for broken snprintf
527 if test "x$ac_cv_func_snprintf" = "xyes" ; then
528 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
532 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
534 [AC_MSG_RESULT(yes)],
537 AC_DEFINE(BROKEN_SNPRINTF)
538 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
548 [ --with-pam Enable PAM support ],
550 if test "x$withval" != "xno" ; then
551 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
552 AC_MSG_ERROR([PAM headers not found])
555 AC_CHECK_LIB(dl, dlopen, , )
556 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
557 AC_CHECK_FUNCS(pam_getenvlist)
567 # Check for older PAM
568 if test "x$PAM_MSG" = "xyes" ; then
569 # Check PAM strerror arguments (old PAM)
570 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
574 #include <security/pam_appl.h>
576 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
579 AC_DEFINE(HAVE_OLD_PAM)
581 PAM_MSG="yes (old library)"
586 # The big search for OpenSSL
588 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
590 if test "x$withval" != "xno" ; then
597 saved_LDFLAGS="$LDFLAGS"
598 saved_CPPFLAGS="$CPPFLAGS"
599 if test "x$prefix" != "xNONE" ; then
600 tryssldir="$tryssldir $prefix"
602 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
603 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
604 CPPFLAGS="$saved_CPPFLAGS"
605 LDFLAGS="$saved_LDFLAGS"
606 LIBS="$saved_LIBS -lcrypto"
608 # Skip directories if they don't exist
609 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
612 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
613 # Try to use $ssldir/lib if it exists, otherwise
615 if test -d "$ssldir/lib" ; then
616 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
617 if test ! -z "$need_dash_r" ; then
618 LDFLAGS="$LDFLAGS -R$ssldir/lib"
621 LDFLAGS="$saved_LDFLAGS -L$ssldir"
622 if test ! -z "$need_dash_r" ; then
623 LDFLAGS="$LDFLAGS -R$ssldir"
626 # Try to use $ssldir/include if it exists, otherwise
628 if test -d "$ssldir/include" ; then
629 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
631 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
635 # Basic test to check for compatible version and correct linking
636 # *does not* test for RSA - that comes later.
640 #include <openssl/rand.h>
644 memset(a, 0, sizeof(a));
645 RAND_add(a, sizeof(a), sizeof(a));
646 return(RAND_status() <= 0);
655 if test ! -z "$found_crypto" ; then
660 if test -z "$found_crypto" ; then
661 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
663 if test -z "$ssldir" ; then
667 ac_cv_openssldir=$ssldir
670 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
671 AC_DEFINE(HAVE_OPENSSL)
672 dnl Need to recover ssldir - test above runs in subshell
673 ssldir=$ac_cv_openssldir
674 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
675 # Try to use $ssldir/lib if it exists, otherwise
677 if test -d "$ssldir/lib" ; then
678 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
679 if test ! -z "$need_dash_r" ; then
680 LDFLAGS="$LDFLAGS -R$ssldir/lib"
683 LDFLAGS="$saved_LDFLAGS -L$ssldir"
684 if test ! -z "$need_dash_r" ; then
685 LDFLAGS="$LDFLAGS -R$ssldir"
688 # Try to use $ssldir/include if it exists, otherwise
690 if test -d "$ssldir/include" ; then
691 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
693 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
697 LIBS="$saved_LIBS -lcrypto"
699 # Now test RSA support
701 AC_MSG_CHECKING([for RSA support])
702 for WANTS_RSAREF in "" 1 ; do
703 if test -z "$WANTS_RSAREF" ; then
706 LIBS="$saved_LIBS -lRSAglue -lrsaref"
710 #include <openssl/rand.h>
711 #include <openssl/rsa.h>
712 #include <openssl/bn.h>
713 #include <openssl/sha.h>
716 int num; RSA *key; static unsigned char p_in[] = "blahblah";
717 unsigned char c[256], p[256];
718 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
719 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
720 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
721 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
730 if test ! -z "$no_rsa" ; then
731 AC_MSG_RESULT(disabled)
734 if test -z "$rsa_works" ; then
735 AC_MSG_WARN([*** No RSA support found *** ])
738 if test -z "$WANTS_RSAREF" ; then
742 RSA_MSG="yes (using RSAref)"
743 AC_MSG_RESULT(using RSAref)
744 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
749 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
750 # version in OpenSSL. Skip this for PAM
751 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
752 AC_CHECK_LIB(crypt, crypt, , )
755 # Cheap hack to ensure NEWS-OS libraries are arranged right.
756 if test ! -z "$SONY" ; then
757 LIBS="$LIBS -liberty";
760 # Checks for data types
761 AC_CHECK_SIZEOF(char, 1)
762 AC_CHECK_SIZEOF(short int, 2)
763 AC_CHECK_SIZEOF(int, 4)
764 AC_CHECK_SIZEOF(long int, 4)
765 AC_CHECK_SIZEOF(long long int, 8)
767 # More checks for data types
768 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
770 [ #include <sys/types.h> ],
772 [ ac_cv_have_u_int="yes" ],
773 [ ac_cv_have_u_int="no" ]
776 if test "x$ac_cv_have_u_int" = "xyes" ; then
777 AC_DEFINE(HAVE_U_INT)
781 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
783 [ #include <sys/types.h> ],
784 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
785 [ ac_cv_have_intxx_t="yes" ],
786 [ ac_cv_have_intxx_t="no" ]
789 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
790 AC_DEFINE(HAVE_INTXX_T)
794 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
796 [ #include <sys/types.h> ],
797 [ int64_t a; a = 1;],
798 [ ac_cv_have_int64_t="yes" ],
799 [ ac_cv_have_int64_t="no" ]
802 if test "x$ac_cv_have_int64_t" = "xyes" ; then
803 AC_DEFINE(HAVE_INT64_T)
807 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
809 [ #include <sys/types.h> ],
810 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
811 [ ac_cv_have_u_intxx_t="yes" ],
812 [ ac_cv_have_u_intxx_t="no" ]
815 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
816 AC_DEFINE(HAVE_U_INTXX_T)
820 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
822 [ #include <sys/types.h> ],
823 [ u_int64_t a; a = 1;],
824 [ ac_cv_have_u_int64_t="yes" ],
825 [ ac_cv_have_u_int64_t="no" ]
828 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
829 AC_DEFINE(HAVE_U_INT64_T)
833 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
834 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
836 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
839 #include <sys/bitypes.h>
842 int8_t a; int16_t b; int32_t c;
843 u_int8_t e; u_int16_t f; u_int32_t g;
844 a = b = c = e = f = g = 1;
847 AC_DEFINE(HAVE_U_INTXX_T)
848 AC_DEFINE(HAVE_INTXX_T)
855 if test -z "$have_u_intxx_t" ; then
856 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
859 #include <sys/types.h>
861 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
862 [ ac_cv_have_uintxx_t="yes" ],
863 [ ac_cv_have_uintxx_t="no" ]
866 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
867 AC_DEFINE(HAVE_UINTXX_T)
871 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
874 #include <sys/types.h>
875 #include <sys/socket.h>
877 [socklen_t foo; foo = 1235;],
878 [ ac_cv_have_socklen_t="yes" ],
879 [ ac_cv_have_socklen_t="no" ]
882 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
883 AC_DEFINE(HAVE_SOCKLEN_T)
886 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
889 #include <sys/types.h>
891 [ size_t foo; foo = 1235; ],
892 [ ac_cv_have_size_t="yes" ],
893 [ ac_cv_have_size_t="no" ]
896 if test "x$ac_cv_have_size_t" = "xyes" ; then
897 AC_DEFINE(HAVE_SIZE_T)
900 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
903 #include <sys/types.h>
905 [ ssize_t foo; foo = 1235; ],
906 [ ac_cv_have_ssize_t="yes" ],
907 [ ac_cv_have_ssize_t="no" ]
910 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
911 AC_DEFINE(HAVE_SSIZE_T)
914 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
919 [ clock_t foo; foo = 1235; ],
920 [ ac_cv_have_clock_t="yes" ],
921 [ ac_cv_have_clock_t="no" ]
924 if test "x$ac_cv_have_clock_t" = "xyes" ; then
925 AC_DEFINE(HAVE_CLOCK_T)
928 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
931 #include <sys/types.h>
932 #include <sys/socket.h>
934 [ sa_family_t foo; foo = 1235; ],
935 [ ac_cv_have_sa_family_t="yes" ],
938 #include <sys/types.h>
939 #include <sys/socket.h>
940 #include <netinet/in.h>
942 [ sa_family_t foo; foo = 1235; ],
943 [ ac_cv_have_sa_family_t="yes" ],
945 [ ac_cv_have_sa_family_t="no" ]
949 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
950 AC_DEFINE(HAVE_SA_FAMILY_T)
953 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
956 #include <sys/types.h>
958 [ pid_t foo; foo = 1235; ],
959 [ ac_cv_have_pid_t="yes" ],
960 [ ac_cv_have_pid_t="no" ]
963 if test "x$ac_cv_have_pid_t" = "xyes" ; then
964 AC_DEFINE(HAVE_PID_T)
967 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
970 #include <sys/types.h>
972 [ mode_t foo; foo = 1235; ],
973 [ ac_cv_have_mode_t="yes" ],
974 [ ac_cv_have_mode_t="no" ]
977 if test "x$ac_cv_have_mode_t" = "xyes" ; then
978 AC_DEFINE(HAVE_MODE_T)
982 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
985 #include <sys/types.h>
986 #include <sys/socket.h>
988 [ struct sockaddr_storage s; ],
989 [ ac_cv_have_struct_sockaddr_storage="yes" ],
990 [ ac_cv_have_struct_sockaddr_storage="no" ]
993 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
994 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
997 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1000 #include <sys/types.h>
1001 #include <netinet/in.h>
1003 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1004 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1005 [ ac_cv_have_struct_sockaddr_in6="no" ]
1008 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1009 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1012 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1015 #include <sys/types.h>
1016 #include <netinet/in.h>
1018 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1019 [ ac_cv_have_struct_in6_addr="yes" ],
1020 [ ac_cv_have_struct_in6_addr="no" ]
1023 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1024 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1027 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1030 #include <sys/types.h>
1031 #include <sys/socket.h>
1034 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1035 [ ac_cv_have_struct_addrinfo="yes" ],
1036 [ ac_cv_have_struct_addrinfo="no" ]
1039 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1040 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1043 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1045 [ #include <sys/time.h> ],
1046 [ struct timeval tv; tv.tv_sec = 1;],
1047 [ ac_cv_have_struct_timeval="yes" ],
1048 [ ac_cv_have_struct_timeval="no" ]
1051 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1052 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1053 have_struct_timeval=1
1056 # If we don't have int64_t then we can't compile sftp-server. So don't
1057 # even attempt to do it.
1058 if test "x$ac_cv_have_int64_t" = "xno" -a \
1059 "x$ac_cv_sizeof_long_int" != "x8" -a \
1060 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1065 dnl Checks for structure members
1066 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1067 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1068 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1069 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1070 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1071 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1072 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1073 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1074 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1075 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1076 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1077 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1078 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1079 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1080 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1081 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1082 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1083 AC_STRUCT_ST_BLKSIZE
1085 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1086 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1089 #include <sys/types.h>
1090 #include <sys/socket.h>
1092 [ struct sockaddr_un s; s.sun_len = 1; ],
1093 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1094 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1097 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1098 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1101 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1102 ac_cv_have_ss_family_in_struct_ss, [
1105 #include <sys/types.h>
1106 #include <sys/socket.h>
1108 [ struct sockaddr_storage s; s.ss_family = 1; ],
1109 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1110 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1113 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1114 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1117 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1118 ac_cv_have___ss_family_in_struct_ss, [
1121 #include <sys/types.h>
1122 #include <sys/socket.h>
1124 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1125 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1126 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1129 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1130 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1133 AC_CACHE_CHECK([for pw_class field in struct passwd],
1134 ac_cv_have_pw_class_in_struct_passwd, [
1139 [ struct passwd p; p.pw_class = 0; ],
1140 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1141 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1144 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1145 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1149 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1151 [ extern char *__progname; printf("%s", __progname); ],
1152 [ ac_cv_libc_defines___progname="yes" ],
1153 [ ac_cv_libc_defines___progname="no" ]
1156 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1157 AC_DEFINE(HAVE___PROGNAME)
1161 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1163 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1164 [ ac_cv_libc_defines_sys_errlist="yes" ],
1165 [ ac_cv_libc_defines_sys_errlist="no" ]
1168 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1169 AC_DEFINE(HAVE_SYS_ERRLIST)
1173 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1175 [ extern int sys_nerr; printf("%i", sys_nerr);],
1176 [ ac_cv_libc_defines_sys_nerr="yes" ],
1177 [ ac_cv_libc_defines_sys_nerr="no" ]
1180 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1181 AC_DEFINE(HAVE_SYS_NERR)
1185 # Looking for programs, paths and files
1187 [ --with-rsh=PATH Specify path to remote shell program ],
1189 if test "x$withval" != "$no" ; then
1194 AC_PATH_PROG(rsh_path, rsh)
1199 [ --with-xauth=PATH Specify path to xauth program ],
1201 if test "x$withval" != "xno" ; then
1206 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1207 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1208 xauth_path="/usr/openwin/bin/xauth"
1213 if test -z "$xauth_path" ; then
1214 XAUTH_PATH="undefined"
1215 AC_SUBST(XAUTH_PATH)
1217 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1218 XAUTH_PATH=$xauth_path
1219 AC_SUBST(XAUTH_PATH)
1221 if test ! -z "$rsh_path" ; then
1222 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1225 # Check for mail directory (last resort if we cannot get it from headers)
1226 if test ! -z "$MAIL" ; then
1227 maildir=`dirname $MAIL`
1228 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1231 if test -z "$no_dev_ptmx" ; then
1232 AC_CHECK_FILE("/dev/ptmx",
1234 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1239 AC_CHECK_FILE("/dev/ptc",
1241 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1246 # Options from here on. Some of these are preset by platform above
1248 # Check for user-specified random device, otherwise check /dev/urandom
1250 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1252 if test "x$withval" != "xno" ; then
1253 RANDOM_POOL="$withval";
1254 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1258 # Check for random device
1259 AC_CHECK_FILE("/dev/urandom",
1261 RANDOM_POOL="/dev/urandom";
1262 AC_SUBST(RANDOM_POOL)
1263 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1269 # Check for EGD pool file
1270 AC_ARG_WITH(egd-pool,
1271 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1273 if test "x$withval" != "xno" ; then
1274 EGD_SOCKET="$withval";
1275 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1279 # Check for existing socket only if we don't have a random device already
1280 if test -z "$RANDOM_POOL" ; then
1281 AC_MSG_CHECKING(for PRNGD/EGD socket)
1282 # Insert other locations here
1283 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1284 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
1285 EGD_SOCKET="$egdsock"
1286 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1290 if test -x "$EGD_SOCKET" ; then
1291 AC_MSG_RESULT($EGD_SOCKET)
1293 AC_MSG_RESULT(not found)
1300 # detect pathnames for entropy gathering commands, if we need them
1301 INSTALL_SSH_PRNG_CMDS=""
1303 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1304 # Use these commands to collect entropy
1305 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1306 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1307 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1308 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1309 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1310 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1311 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1312 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1313 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1314 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1315 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1316 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1317 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1318 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1320 INSTALL_SSH_PRNG_CMDS="yes"
1322 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1326 [ --with-catman=man|cat Install preformatted manpages[no]],
1329 if test x"$withval" != x"yes" ; then
1335 if test -z "$MANTYPE" ; then
1336 MANTYPE='$(TROFFMAN)'
1344 # Check whether to enable MD5 passwords
1346 AC_ARG_WITH(md5-passwords,
1347 [ --with-md5-passwords Enable use of MD5 passwords],
1349 if test "x$withval" != "xno" ; then
1350 AC_DEFINE(HAVE_MD5_PASSWORDS)
1356 # Whether to disable shadow password support
1358 [ --without-shadow Disable shadow password support],
1360 if test "x$withval" = "xno" ; then
1361 AC_DEFINE(DISABLE_SHADOW)
1367 if test -z "$disable_shadow" ; then
1368 AC_MSG_CHECKING([if the systems has expire shadow information])
1371 #include <sys/types.h>
1374 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1375 [ sp_expire_available=yes ], []
1378 if test "x$sp_expire_available" = "xyes" ; then
1380 AC_DEFINE(HAS_SHADOW_EXPIRE)
1386 # Use ip address instead of hostname in $DISPLAY
1387 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1388 DISPLAY_HACK_MSG="yes"
1389 AC_DEFINE(IPADDR_IN_DISPLAY)
1391 DISPLAY_HACK_MSG="no"
1392 AC_ARG_WITH(ipaddr-display,
1393 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1395 if test "x$withval" != "xno" ; then
1396 AC_DEFINE(IPADDR_IN_DISPLAY)
1397 DISPLAY_HACK_MSG="yes"
1403 # Whether to mess with the default path
1404 SERVER_PATH_MSG="(default)"
1405 AC_ARG_WITH(default-path,
1406 [ --with-default-path=PATH Specify default \$PATH environment for server],
1408 if test "x$withval" != "xno" ; then
1409 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1410 SERVER_PATH_MSG="$withval"
1415 # Whether to force IPv4 by default (needed on broken glibc Linux)
1417 AC_ARG_WITH(ipv4-default,
1418 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1420 if test "x$withval" != "xno" ; then
1421 AC_DEFINE(IPV4_DEFAULT)
1427 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1428 IPV4_IN6_HACK_MSG="no"
1430 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1432 if test "x$withval" != "xno" ; then
1434 AC_DEFINE(IPV4_IN_IPV6)
1435 IPV4_IN6_HACK_MSG="yes"
1440 if test "x$inet6_default_4in6" = "xyes"; then
1441 AC_MSG_RESULT([yes (default)])
1442 AC_DEFINE(IPV4_IN_IPV6)
1443 IPV4_IN6_HACK_MSG="yes"
1445 AC_MSG_RESULT([no (default)])
1450 # Whether to enable BSD auth support
1451 AC_ARG_WITH(bsd-auth,
1452 [ --with-bsd-auth Enable BSD auth support],
1454 if test "x$withval" != "xno" ; then
1461 AC_MSG_CHECKING(whether to install ssh as suid root)
1462 AC_ARG_ENABLE(suid-ssh,
1463 [ --enable-suid-ssh Install ssh as suid root (default)
1464 --disable-suid-ssh Install ssh without suid bit],
1465 [ case "$enableval" in
1470 *) AC_MSG_RESULT(yes)
1480 # Where to place sshd.pid
1482 AC_ARG_WITH(pid-dir,
1483 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1485 if test "x$withval" != "xno" ; then
1491 # make sure the directory exists
1492 if test ! -d $piddir ; then
1493 piddir=`eval echo ${sysconfdir}`
1495 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1499 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1502 dnl allow user to disable some login recording features
1503 AC_ARG_ENABLE(lastlog,
1504 [ --disable-lastlog disable use of lastlog even if detected [no]],
1505 [ AC_DEFINE(DISABLE_LASTLOG) ]
1508 [ --disable-utmp disable use of utmp even if detected [no]],
1509 [ AC_DEFINE(DISABLE_UTMP) ]
1511 AC_ARG_ENABLE(utmpx,
1512 [ --disable-utmpx disable use of utmpx even if detected [no]],
1513 [ AC_DEFINE(DISABLE_UTMPX) ]
1516 [ --disable-wtmp disable use of wtmp even if detected [no]],
1517 [ AC_DEFINE(DISABLE_WTMP) ]
1519 AC_ARG_ENABLE(wtmpx,
1520 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1521 [ AC_DEFINE(DISABLE_WTMPX) ]
1523 AC_ARG_ENABLE(libutil,
1524 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1525 [ AC_DEFINE(DISABLE_LOGIN) ]
1527 AC_ARG_ENABLE(pututline,
1528 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1529 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1531 AC_ARG_ENABLE(pututxline,
1532 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1533 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1535 AC_ARG_WITH(lastlog,
1536 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1538 if test "x$withval" = "xno" ; then
1539 AC_DEFINE(DISABLE_LASTLOG)
1541 conf_lastlog_location=$withval
1546 dnl lastlog, [uw]tmpx? detection
1547 dnl NOTE: set the paths in the platform section to avoid the
1548 dnl need for command-line parameters
1549 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1551 dnl lastlog detection
1552 dnl NOTE: the code itself will detect if lastlog is a directory
1553 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1555 #include <sys/types.h>
1557 #ifdef HAVE_LASTLOG_H
1558 # include <lastlog.h>
1564 [ char *lastlog = LASTLOG_FILE; ],
1565 [ AC_MSG_RESULT(yes) ],
1568 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1570 #include <sys/types.h>
1572 #ifdef HAVE_LASTLOG_H
1573 # include <lastlog.h>
1579 [ char *lastlog = _PATH_LASTLOG; ],
1580 [ AC_MSG_RESULT(yes) ],
1583 system_lastlog_path=no
1588 if test -z "$conf_lastlog_location"; then
1589 if test x"$system_lastlog_path" = x"no" ; then
1590 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1591 if (test -d "$f" || test -f "$f") ; then
1592 conf_lastlog_location=$f
1595 if test -z "$conf_lastlog_location"; then
1596 AC_MSG_WARN([** Cannot find lastlog **])
1597 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1602 if test -n "$conf_lastlog_location"; then
1603 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1607 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1609 #include <sys/types.h>
1615 [ char *utmp = UTMP_FILE; ],
1616 [ AC_MSG_RESULT(yes) ],
1618 system_utmp_path=no ]
1620 if test -z "$conf_utmp_location"; then
1621 if test x"$system_utmp_path" = x"no" ; then
1622 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1623 if test -f $f ; then
1624 conf_utmp_location=$f
1627 if test -z "$conf_utmp_location"; then
1628 AC_DEFINE(DISABLE_UTMP)
1632 if test -n "$conf_utmp_location"; then
1633 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1637 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1639 #include <sys/types.h>
1645 [ char *wtmp = WTMP_FILE; ],
1646 [ AC_MSG_RESULT(yes) ],
1648 system_wtmp_path=no ]
1650 if test -z "$conf_wtmp_location"; then
1651 if test x"$system_wtmp_path" = x"no" ; then
1652 for f in /usr/adm/wtmp /var/log/wtmp; do
1653 if test -f $f ; then
1654 conf_wtmp_location=$f
1657 if test -z "$conf_wtmp_location"; then
1658 AC_DEFINE(DISABLE_WTMP)
1662 if test -n "$conf_wtmp_location"; then
1663 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1667 dnl utmpx detection - I don't know any system so perverse as to require
1668 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1670 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1672 #include <sys/types.h>
1681 [ char *utmpx = UTMPX_FILE; ],
1682 [ AC_MSG_RESULT(yes) ],
1684 system_utmpx_path=no ]
1686 if test -z "$conf_utmpx_location"; then
1687 if test x"$system_utmpx_path" = x"no" ; then
1688 AC_DEFINE(DISABLE_UTMPX)
1691 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1695 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1697 #include <sys/types.h>
1706 [ char *wtmpx = WTMPX_FILE; ],
1707 [ AC_MSG_RESULT(yes) ],
1709 system_wtmpx_path=no ]
1711 if test -z "$conf_wtmpx_location"; then
1712 if test x"$system_wtmpx_path" = x"no" ; then
1713 AC_DEFINE(DISABLE_WTMPX)
1716 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1720 # Change default command timeout for builtin PRNG
1722 AC_ARG_WITH(entropy-timeout,
1723 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1725 if test "x$withval" != "xno" ; then
1726 entropy_timeout=$withval
1730 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1733 if test ! -z "$blibpath" ; then
1734 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1735 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1740 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1742 # Print summary of options
1744 if test x$MANTYPE = x'$(CATMAN)' ; then
1749 if test ! -z "$RANDOM_POOL" ; then
1750 RAND_MSG="Device ($RANDOM_POOL)"
1752 if test ! -z "$EGD_SOCKET" ; then
1753 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1755 RAND_MSG="Builtin (timeout $entropy_timeout)"
1760 # Someone please show me a better way :)
1761 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1762 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1763 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1764 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1765 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1766 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1767 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1770 echo "OpenSSH configured has been configured with the following options."
1771 echo " User binaries: $B"
1772 echo " System binaries: $C"
1773 echo " Configuration files: $D"
1774 echo " Askpass program: $E"
1775 echo " Manual pages: $F"
1776 echo " PID file: $G"
1777 echo " Random number collection: $RAND_MSG"
1778 echo " Manpage format: $MAN_MSG"
1779 echo " PAM support: ${PAM_MSG}"
1780 echo " KerberosIV support: $KRB4_MSG"
1781 echo " AFS support: $AFS_MSG"
1782 echo " S/KEY support: $SKEY_MSG"
1783 echo " TCP Wrappers support: $TCPW_MSG"
1784 echo " MD5 password support: $MD5_MSG"
1785 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1786 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1787 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1789 if test ! -z "$bsd_auth"; then
1790 echo " BSD Auth support: yes"
1795 echo " Host: ${host}"
1796 echo " Compiler: ${CC}"
1797 echo " Compiler flags: ${CFLAGS}"
1798 echo "Preprocessor flags: ${CPPFLAGS}"
1799 echo " Linker flags: ${LDFLAGS}"
1800 echo " Libraries: ${LIBS}"
1804 if test "x$PAM_MSG" = "xyes" ; then
1805 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1806 echo "otherwise password authentication may fail. Example PAM control files"
1807 echo "can be found in the contrib/ subdirectory"
1811 if test ! -z "$BUILTIN_RNG" ; then
1812 echo "WARNING: you are using the builtin random number collection service."
1813 echo "Please read WARNING.RNG and request that your OS vendor includes"
1814 echo "/dev/random in future versions of their OS."
1818 if test ! -z "$NO_SFTP"; then
1819 echo "sftp-server will be disabled. Your compiler does not support"
1820 echo "64bit integers."