5 AC_CONFIG_HEADER(config.h)
14 AC_PATH_PROG(PERL, perl)
16 AC_PATH_PROG(ENT, ent)
18 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
19 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
20 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
21 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
23 if test -z "$AR" ; then
24 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
27 # Use LOGIN_PROGRAM from environment if possible
28 if test ! -z "$LOGIN_PROGRAM" ; then
29 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
32 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
33 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
38 if test -z "$LD" ; then
45 if test "$GCC" = "yes"; then
46 CFLAGS="$CFLAGS -Wall"
49 # Check for some target-specific stuff
53 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
54 LDFLAGS="$LDFLAGS -L/usr/local/lib"
55 if (test "$LD" != "gcc" && test -z "$blibpath"); then
56 blibpath="/usr/lib:/lib:/usr/local/lib"
58 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
59 AC_DEFINE(BROKEN_GETADDRINFO)
62 dnl AIX handles lastlog as part of its login message
63 AC_DEFINE(DISABLE_LASTLOG)
68 LIBS="$LIBS -lregex /usr/lib/textmode.o"
69 AC_DEFINE(HAVE_CYGWIN)
70 AC_DEFINE(DISABLE_SHADOW)
71 AC_DEFINE(IPV4_DEFAULT)
72 AC_DEFINE(IP_TOS_IS_BROKEN)
73 AC_DEFINE(BROKEN_VHANGUP)
78 AC_DEFINE(IP_TOS_IS_BROKEN)
81 if test -z "$GCC"; then
84 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
87 AC_DEFINE(DISABLE_SHADOW)
88 AC_DEFINE(DISABLE_UTMP)
89 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
95 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
97 AC_DEFINE(PAM_SUN_CODEBASE)
99 AC_DEFINE(DISABLE_SHADOW)
100 AC_DEFINE(DISABLE_UTMP)
101 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
107 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
109 PATH="$PATH:/usr/etc"
113 AC_DEFINE(BROKEN_INET_NTOA)
116 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
118 PATH="$PATH:/usr/etc"
120 AC_DEFINE(WITH_IRIX_ARRAY)
121 AC_DEFINE(WITH_IRIX_PROJECT)
122 AC_DEFINE(WITH_IRIX_AUDIT)
123 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
126 AC_DEFINE(BROKEN_INET_NTOA)
131 check_for_libcrypt_later=1
132 AC_DEFINE(DONT_TRY_OTHER_AF)
133 AC_DEFINE(PAM_TTY_KLUDGE)
134 inet6_default_4in6=yes
136 mips-sony-bsd|mips-sony-newsos4)
137 AC_DEFINE(HAVE_NEWS4)
139 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
140 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
147 conf_lastlog_location="/usr/adm/lastlog"
148 conf_utmp_location=/etc/utmp
149 conf_wtmp_location=/usr/adm/wtmp
152 AC_DEFINE(BROKEN_REALPATH)
154 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
158 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
159 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
161 AC_DEFINE(PAM_SUN_CODEBASE)
162 # hardwire lastlog location (can't detect it on some versions)
163 conf_lastlog_location="/var/adm/lastlog"
164 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
165 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
166 if test "$sol2ver" -ge 8; then
168 AC_DEFINE(DISABLE_UTMP)
169 AC_DEFINE(DISABLE_WTMP)
175 CPPFLAGS="$CPPFLAGS -DSUNOS4"
176 AC_CHECK_FUNCS(getpwanam)
177 AC_DEFINE(PAM_SUN_CODEBASE)
178 conf_utmp_location=/etc/utmp
179 conf_wtmp_location=/var/adm/wtmp
180 conf_lastlog_location=/var/adm/lastlog
186 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
187 LDFLAGS="$LDFLAGS -L/usr/local/lib"
190 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
194 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
196 IPADDR_IN_DISPLAY=yes
198 AC_DEFINE(IP_TOS_IS_BROKEN)
200 LIBS="$LIBS -lgen -lnsl -lucb"
203 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
204 LDFLAGS="$LDFLAGS -L/usr/local/lib"
211 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
212 LDFLAGS="$LDFLAGS -L/usr/local/lib"
219 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
220 LDFLAGS="$LDFLAGS -L/usr/local/lib"
223 LIBS="$LIBS -lgen -lsocket"
226 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
227 LDFLAGS="$LDFLAGS -L/usr/local/lib"
229 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
231 rsh_path="/usr/bin/rcmd"
234 AC_DEFINE(BROKEN_SYS_TERMIO_H)
236 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
237 AC_DEFINE(DISABLE_SHADOW)
238 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
239 AC_CHECK_FUNCS(getluid setluid)
242 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
244 LIBS="$LIBS -lprot -lx -ltinfo -lm"
248 rsh_path="/usr/bin/rcmd"
250 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
251 AC_DEFINE(DISABLE_SHADOW)
252 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
253 AC_CHECK_FUNCS(getluid setluid)
256 if test ! -z "USE_SIA" ; then
257 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
258 if test -f /etc/sia/matrix.conf; then
260 AC_DEFINE(HAVE_OSF_SIA)
261 AC_DEFINE(DISABLE_LOGIN)
262 LIBS="$LIBS -lsecurity -ldb -lm -laud"
270 # Allow user to specify flags
272 [ --with-cflags Specify additional flags to pass to compiler],
274 if test "x$withval" != "xno" ; then
275 CFLAGS="$CFLAGS $withval"
279 AC_ARG_WITH(cppflags,
280 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
282 if test "x$withval" != "xno"; then
283 CPPFLAGS="$CPPFLAGS $withval"
288 [ --with-ldflags Specify additional flags to pass to linker],
290 if test "x$withval" != "xno" ; then
291 LDFLAGS="$LDFLAGS $withval"
296 [ --with-libs Specify additional libraries to link with],
298 if test "x$withval" != "xno" ; then
299 LIBS="$LIBS $withval"
305 [ --with-pcre Override built in regex library with pcre],
308 AC_CHECK_LIB(pcre, pcre_info,
310 AC_DEFINE(HAVE_LIBPCRE)
311 LIBS="$LIBS -lpcreposix -lpcre"
314 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
319 # Checks for libraries.
320 if test -z "$no_libsocket" ; then
321 AC_CHECK_LIB(nsl, yp_match, , )
323 if test -z "$no_libnsl" ; then
324 AC_CHECK_LIB(socket, main, , )
327 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
328 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
329 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
331 # We don't want to check if we did an pcre override.
332 if test -z "$no_comp_check" ; then
333 AC_CHECK_FUNC(regcomp,
334 [ AC_DEFINE(HAVE_REGCOMP)],
336 AC_CHECK_LIB(pcre, pcre_info,
338 AC_DEFINE(HAVE_LIBPCRE)
339 LIBS="$LIBS -lpcreposix -lpcre"
342 AC_MSG_ERROR([*** No regex library found.])
349 AC_CHECK_FUNC(strcasecmp,
350 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
352 AC_CHECK_FUNC(utimes,
353 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
356 # Checks for header files.
357 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)
359 # Check whether user wants Kerberos support
361 AC_ARG_WITH(kerberos4,
362 [ --with-kerberos4=PATH Enable Kerberos 4 support],
364 if test "x$withval" != "xno" ; then
366 if test "x$withval" != "xyes" ; then
367 CPPFLAGS="$CPPFLAGS -I${withval}/include"
368 LDFLAGS="$LDFLAGS -L${withval}/lib"
369 if test ! -z "$need_dash_r" ; then
370 LDFLAGS="$LDFLAGS -R${withval}/lib"
372 if test ! -z "$blibpath" ; then
373 blibpath="$blibpath:${withval}/lib"
376 if test -d /usr/include/kerberosIV ; then
377 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
381 AC_CHECK_HEADERS(krb.h)
382 AC_CHECK_LIB(krb, main)
383 if test "$ac_cv_header_krb_h" != yes; then
384 AC_MSG_WARN([Cannot find krb.h, build may fail])
386 if test "$ac_cv_lib_krb_main" != yes; then
387 AC_MSG_WARN([Cannot find libkrb, build may fail])
391 AC_CHECK_LIB(resolv, dn_expand, , )
399 # Check whether user wants AFS support
402 [ --with-afs=PATH Enable AFS support],
404 if test "x$withval" != "xno" ; then
406 if test "x$withval" != "xyes" ; then
407 CPPFLAGS="$CPPFLAGS -I${withval}/include"
408 LDFLAGS="$LDFLAGS -L${withval}/lib"
411 if test -z "$KRB4" ; then
412 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
416 if test ! -z "$AFS_LIBS" ; then
417 LIBS="$LIBS $AFS_LIBS"
426 # Check whether user wants S/Key support
429 [ --with-skey=PATH Enable S/Key support],
431 if test "x$withval" != "xno" ; then
433 if test "x$withval" != "xyes" ; then
434 CPPFLAGS="$CPPFLAGS -I${withval}/include"
435 LDFLAGS="$LDFLAGS -L${withval}/lib"
442 AC_CHECK_FUNC(skey_keyinfo,
445 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
451 # Check whether user wants TCP wrappers support
453 AC_ARG_WITH(tcp-wrappers,
454 [ --with-tcp-wrappers Enable tcpwrappers support],
456 if test "x$withval" != "xno" ; then
459 AC_MSG_CHECKING(for libwrap)
463 int deny_severity = 0, allow_severity = 0;
472 AC_MSG_ERROR([*** libwrap missing])
479 dnl Checks for library functions.
480 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)
481 dnl Checks for time functions
482 AC_CHECK_FUNCS(gettimeofday time)
483 dnl Checks for libutil functions
484 AC_CHECK_HEADERS(libutil.h)
485 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
486 dnl Checks for utmp functions
487 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
488 AC_CHECK_FUNCS(utmpname)
489 dnl Checks for utmpx functions
490 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
491 AC_CHECK_FUNCS(setutxent utmpxname)
493 AC_CHECK_FUNC(getuserattr,
494 [AC_DEFINE(HAVE_GETUSERATTR)],
495 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
499 [AC_DEFINE(HAVE_LOGIN)],
500 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
503 AC_CHECK_FUNC(daemon,
504 [AC_DEFINE(HAVE_DAEMON)],
505 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
508 AC_CHECK_FUNC(getpagesize,
509 [AC_DEFINE(HAVE_GETPAGESIZE)],
510 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
513 # Check for broken snprintf
514 if test "x$ac_cv_func_snprintf" = "xyes" ; then
515 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
519 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
521 [AC_MSG_RESULT(yes)],
524 AC_DEFINE(BROKEN_SNPRINTF)
525 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
537 [ --with-pam Enable PAM support ],
539 if test "x$withval" != "xno" ; then
540 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
541 AC_MSG_ERROR([PAM headers not found])
544 AC_CHECK_LIB(dl, dlopen, , )
545 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
546 AC_CHECK_FUNCS(pam_getenvlist)
556 # Check for older PAM
557 if test "x$PAM_MSG" = "xyes" ; then
558 # Check PAM strerror arguments (old PAM)
559 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
563 #include <security/pam_appl.h>
565 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
568 AC_DEFINE(HAVE_OLD_PAM)
570 PAM_MSG="yes (old library)"
575 # The big search for OpenSSL
577 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
579 if test "x$withval" != "xno" ; then
586 saved_LDFLAGS="$LDFLAGS"
587 saved_CPPFLAGS="$CPPFLAGS"
588 if test "x$prefix" != "xNONE" ; then
589 tryssldir="$tryssldir $prefix"
591 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
593 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
594 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
595 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
596 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
597 if test ! -z "$need_dash_r" ; then
598 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
601 LDFLAGS="$saved_LDFLAGS"
604 LIBS="$saved_LIBS -lcrypto"
606 # Basic test to check for compatible version and correct linking
607 # *does not* test for RSA - that comes later.
611 #include <openssl/rand.h>
615 memset(a, 0, sizeof(a));
616 RAND_add(a, sizeof(a), sizeof(a));
617 return(RAND_status() <= 0);
626 if test ! -z "$found_crypto" ; then
631 if test -z "$found_crypto" ; then
632 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
634 if test -z "$ssldir" ; then
638 ac_cv_openssldir=$ssldir
641 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
642 AC_DEFINE(HAVE_OPENSSL)
643 dnl Need to recover ssldir - test above runs in subshell
644 ssldir=$ac_cv_openssldir
646 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
647 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
648 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
649 if test ! -z "$need_dash_r" ; then
650 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
652 if test ! -z "$blibpath" ; then
653 blibpath="$blibpath:$ssldir:$ssldir/lib"
657 LIBS="$saved_LIBS -lcrypto"
659 # Now test RSA support
661 AC_MSG_CHECKING([for RSA support])
662 for WANTS_RSAREF in "" 1 ; do
663 if test -z "$WANTS_RSAREF" ; then
666 LIBS="$saved_LIBS -lRSAglue -lrsaref"
670 #include <openssl/rand.h>
671 #include <openssl/rsa.h>
672 #include <openssl/bn.h>
673 #include <openssl/sha.h>
676 int num; RSA *key; static unsigned char p_in[] = "blahblah";
677 unsigned char c[256], p[256];
678 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
679 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
680 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
681 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
690 if test ! -z "$no_rsa" ; then
691 AC_MSG_RESULT(disabled)
694 if test -z "$rsa_works" ; then
695 AC_MSG_WARN([*** No RSA support found *** ])
698 if test -z "$WANTS_RSAREF" ; then
702 RSA_MSG="yes (using RSAref)"
703 AC_MSG_RESULT(using RSAref)
704 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
709 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
710 # version in OpenSSL. Skip this for PAM
711 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
712 AC_CHECK_LIB(crypt, crypt, , )
715 # Cheap hack to ensure NEWS-OS libraries are arranged right.
716 if test ! -z "$SONY" ; then
717 LIBS="$LIBS -liberty";
720 # Checks for data types
721 AC_CHECK_SIZEOF(char, 1)
722 AC_CHECK_SIZEOF(short int, 2)
723 AC_CHECK_SIZEOF(int, 4)
724 AC_CHECK_SIZEOF(long int, 4)
725 AC_CHECK_SIZEOF(long long int, 8)
727 # More checks for data types
728 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
730 [ #include <sys/types.h> ],
732 [ ac_cv_have_u_int="yes" ],
733 [ ac_cv_have_u_int="no" ]
736 if test "x$ac_cv_have_u_int" = "xyes" ; then
737 AC_DEFINE(HAVE_U_INT)
741 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
743 [ #include <sys/types.h> ],
744 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
745 [ ac_cv_have_intxx_t="yes" ],
746 [ ac_cv_have_intxx_t="no" ]
749 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
750 AC_DEFINE(HAVE_INTXX_T)
754 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
756 [ #include <sys/types.h> ],
757 [ int64_t a; a = 1;],
758 [ ac_cv_have_int64_t="yes" ],
759 [ ac_cv_have_int64_t="no" ]
762 if test "x$ac_cv_have_int64_t" = "xyes" ; then
763 AC_DEFINE(HAVE_INT64_T)
767 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
769 [ #include <sys/types.h> ],
770 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
771 [ ac_cv_have_u_intxx_t="yes" ],
772 [ ac_cv_have_u_intxx_t="no" ]
775 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
776 AC_DEFINE(HAVE_U_INTXX_T)
780 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
782 [ #include <sys/types.h> ],
783 [ u_int64_t a; a = 1;],
784 [ ac_cv_have_u_int64_t="yes" ],
785 [ ac_cv_have_u_int64_t="no" ]
788 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
789 AC_DEFINE(HAVE_U_INT64_T)
793 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
794 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
796 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
799 #include <sys/bitypes.h>
802 int8_t a; int16_t b; int32_t c;
803 u_int8_t e; u_int16_t f; u_int32_t g;
804 a = b = c = e = f = g = 1;
807 AC_DEFINE(HAVE_U_INTXX_T)
808 AC_DEFINE(HAVE_INTXX_T)
815 if test -z "$have_u_intxx_t" ; then
816 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
819 #include <sys/types.h>
821 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
822 [ ac_cv_have_uintxx_t="yes" ],
823 [ ac_cv_have_uintxx_t="no" ]
826 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
827 AC_DEFINE(HAVE_UINTXX_T)
831 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
834 #include <sys/types.h>
835 #include <sys/socket.h>
837 [socklen_t foo; foo = 1235;],
838 [ ac_cv_have_socklen_t="yes" ],
839 [ ac_cv_have_socklen_t="no" ]
842 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
843 AC_DEFINE(HAVE_SOCKLEN_T)
846 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
849 #include <sys/types.h>
851 [ size_t foo; foo = 1235; ],
852 [ ac_cv_have_size_t="yes" ],
853 [ ac_cv_have_size_t="no" ]
856 if test "x$ac_cv_have_size_t" = "xyes" ; then
857 AC_DEFINE(HAVE_SIZE_T)
860 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
863 #include <sys/types.h>
865 [ ssize_t foo; foo = 1235; ],
866 [ ac_cv_have_ssize_t="yes" ],
867 [ ac_cv_have_ssize_t="no" ]
870 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
871 AC_DEFINE(HAVE_SSIZE_T)
874 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
879 [ clock_t foo; foo = 1235; ],
880 [ ac_cv_have_clock_t="yes" ],
881 [ ac_cv_have_clock_t="no" ]
884 if test "x$ac_cv_have_clock_t" = "xyes" ; then
885 AC_DEFINE(HAVE_CLOCK_T)
888 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
891 #include <sys/types.h>
892 #include <sys/socket.h>
894 [ sa_family_t foo; foo = 1235; ],
895 [ ac_cv_have_sa_family_t="yes" ],
898 #include <sys/types.h>
899 #include <sys/socket.h>
900 #include <netinet/in.h>
902 [ sa_family_t foo; foo = 1235; ],
903 [ ac_cv_have_sa_family_t="yes" ],
905 [ ac_cv_have_sa_family_t="no" ]
909 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
910 AC_DEFINE(HAVE_SA_FAMILY_T)
913 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
916 #include <sys/types.h>
918 [ pid_t foo; foo = 1235; ],
919 [ ac_cv_have_pid_t="yes" ],
920 [ ac_cv_have_pid_t="no" ]
923 if test "x$ac_cv_have_pid_t" = "xyes" ; then
924 AC_DEFINE(HAVE_PID_T)
927 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
930 #include <sys/types.h>
932 [ mode_t foo; foo = 1235; ],
933 [ ac_cv_have_mode_t="yes" ],
934 [ ac_cv_have_mode_t="no" ]
937 if test "x$ac_cv_have_mode_t" = "xyes" ; then
938 AC_DEFINE(HAVE_MODE_T)
942 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
945 #include <sys/types.h>
946 #include <sys/socket.h>
948 [ struct sockaddr_storage s; ],
949 [ ac_cv_have_struct_sockaddr_storage="yes" ],
950 [ ac_cv_have_struct_sockaddr_storage="no" ]
953 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
954 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
957 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
960 #include <sys/types.h>
961 #include <netinet/in.h>
963 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
964 [ ac_cv_have_struct_sockaddr_in6="yes" ],
965 [ ac_cv_have_struct_sockaddr_in6="no" ]
968 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
969 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
972 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
975 #include <sys/types.h>
976 #include <netinet/in.h>
978 [ struct in6_addr s; s.s6_addr[0] = 0; ],
979 [ ac_cv_have_struct_in6_addr="yes" ],
980 [ ac_cv_have_struct_in6_addr="no" ]
983 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
984 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
987 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
990 #include <sys/types.h>
991 #include <sys/socket.h>
994 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
995 [ ac_cv_have_struct_addrinfo="yes" ],
996 [ ac_cv_have_struct_addrinfo="no" ]
999 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1000 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1003 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1005 [ #include <sys/time.h> ],
1006 [ struct timeval tv; tv.tv_sec = 1;],
1007 [ ac_cv_have_struct_timeval="yes" ],
1008 [ ac_cv_have_struct_timeval="no" ]
1011 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1012 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1013 have_struct_timeval=1
1016 # If we don't have int64_t then we can't compile sftp-server. So don't
1017 # even attempt to do it.
1018 if test "x$ac_cv_have_int64_t" = "xno" -a \
1019 "x$ac_cv_sizeof_long_int" != "x8" -a \
1020 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1025 dnl Checks for structure members
1026 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1027 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1028 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1029 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1030 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1031 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1032 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1033 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1034 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1035 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1036 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1037 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1038 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1039 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1040 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1041 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1042 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1043 AC_STRUCT_ST_BLKSIZE
1045 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1046 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1049 #include <sys/types.h>
1050 #include <sys/socket.h>
1052 [ struct sockaddr_un s; s.sun_len = 1; ],
1053 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1054 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1057 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1058 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1061 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1062 ac_cv_have_ss_family_in_struct_ss, [
1065 #include <sys/types.h>
1066 #include <sys/socket.h>
1068 [ struct sockaddr_storage s; s.ss_family = 1; ],
1069 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1070 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1073 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1074 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1077 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1078 ac_cv_have___ss_family_in_struct_ss, [
1081 #include <sys/types.h>
1082 #include <sys/socket.h>
1084 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1085 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1086 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1089 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1090 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1093 AC_CACHE_CHECK([for pw_class field in struct passwd],
1094 ac_cv_have_pw_class_in_struct_passwd, [
1099 [ struct passwd p; p.pw_class = 0; ],
1100 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1101 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1104 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1105 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1109 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1111 [ extern char *__progname; printf("%s", __progname); ],
1112 [ ac_cv_libc_defines___progname="yes" ],
1113 [ ac_cv_libc_defines___progname="no" ]
1116 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1117 AC_DEFINE(HAVE___PROGNAME)
1121 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1123 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1124 [ ac_cv_libc_defines_sys_errlist="yes" ],
1125 [ ac_cv_libc_defines_sys_errlist="no" ]
1128 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1129 AC_DEFINE(HAVE_SYS_ERRLIST)
1133 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1135 [ extern int sys_nerr; printf("%i", sys_nerr);],
1136 [ ac_cv_libc_defines_sys_nerr="yes" ],
1137 [ ac_cv_libc_defines_sys_nerr="no" ]
1140 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1141 AC_DEFINE(HAVE_SYS_NERR)
1145 # Looking for programs, paths and files
1147 [ --with-rsh=PATH Specify path to remote shell program ],
1149 if test "x$withval" != "$no" ; then
1154 AC_PATH_PROG(rsh_path, rsh)
1159 [ --with-xauth=PATH Specify path to xauth program ],
1161 if test "x$withval" != "xno" ; then
1166 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1167 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1168 xauth_path="/usr/openwin/bin/xauth"
1173 if test -z "$xauth_path" ; then
1174 XAUTH_PATH="undefined"
1175 AC_SUBST(XAUTH_PATH)
1177 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1178 XAUTH_PATH=$xauth_path
1179 AC_SUBST(XAUTH_PATH)
1181 if test ! -z "$rsh_path" ; then
1182 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1185 # Check for mail directory (last resort if we cannot get it from headers)
1186 if test ! -z "$MAIL" ; then
1187 maildir=`dirname $MAIL`
1188 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1191 if test -z "$no_dev_ptmx" ; then
1192 AC_CHECK_FILE("/dev/ptmx",
1194 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1199 AC_CHECK_FILE("/dev/ptc",
1201 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1206 # Options from here on. Some of these are preset by platform above
1208 # Check for user-specified random device, otherwise check /dev/urandom
1210 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1212 if test "x$withval" != "xno" ; then
1213 RANDOM_POOL="$withval";
1214 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1218 # Check for random device
1219 AC_CHECK_FILE("/dev/urandom",
1221 RANDOM_POOL="/dev/urandom";
1222 AC_SUBST(RANDOM_POOL)
1223 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1229 # Check for EGD pool file
1230 AC_ARG_WITH(egd-pool,
1231 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1233 if test "x$withval" != "xno" ; then
1234 EGD_SOCKET="$withval";
1235 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1239 # Check for existing socket only if we don't have a random device already
1240 if test -z "$RANDOM_POOL" ; then
1241 AC_MSG_CHECKING(for PRNGD/EGD socket)
1242 # Insert other locations here
1243 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1244 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
1245 EGD_SOCKET="$egdsock"
1246 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1250 if test -x "$EGD_SOCKET" ; then
1251 AC_MSG_RESULT($EGD_SOCKET)
1253 AC_MSG_RESULT(not found)
1260 # detect pathnames for entropy gathering commands, if we need them
1261 INSTALL_SSH_PRNG_CMDS=""
1263 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1264 # Use these commands to collect entropy
1265 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1266 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1267 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1268 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1269 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1270 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1271 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1272 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1273 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1274 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1275 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1276 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1277 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1278 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1280 INSTALL_SSH_PRNG_CMDS="yes"
1282 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1286 [ --with-catman=man|cat Install preformatted manpages[no]],
1289 if test x"$withval" != x"yes" ; then
1295 if test -z "$MANTYPE" ; then
1296 MANTYPE='$(TROFFMAN)'
1304 # Check whether to enable MD5 passwords
1306 AC_ARG_WITH(md5-passwords,
1307 [ --with-md5-passwords Enable use of MD5 passwords],
1309 if test "x$withval" != "xno" ; then
1310 AC_DEFINE(HAVE_MD5_PASSWORDS)
1316 # Whether to disable shadow password support
1318 [ --without-shadow Disable shadow password support],
1320 if test "x$withval" = "xno" ; then
1321 AC_DEFINE(DISABLE_SHADOW)
1327 if test -z "$disable_shadow" ; then
1328 AC_MSG_CHECKING([if the systems has expire shadow information])
1331 #include <sys/types.h>
1334 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1335 [ sp_expire_available=yes ], []
1338 if test "x$sp_expire_available" = "xyes" ; then
1340 AC_DEFINE(HAS_SHADOW_EXPIRE)
1346 # Use ip address instead of hostname in $DISPLAY
1347 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1348 DISPLAY_HACK_MSG="yes"
1349 AC_DEFINE(IPADDR_IN_DISPLAY)
1351 DISPLAY_HACK_MSG="no"
1352 AC_ARG_WITH(ipaddr-display,
1353 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1355 if test "x$withval" != "xno" ; then
1356 AC_DEFINE(IPADDR_IN_DISPLAY)
1357 DISPLAY_HACK_MSG="yes"
1363 # Whether to mess with the default path
1364 SERVER_PATH_MSG="(default)"
1365 AC_ARG_WITH(default-path,
1366 [ --with-default-path=PATH Specify default \$PATH environment for server],
1368 if test "x$withval" != "xno" ; then
1369 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1370 SERVER_PATH_MSG="$withval"
1375 # Whether to force IPv4 by default (needed on broken glibc Linux)
1377 AC_ARG_WITH(ipv4-default,
1378 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1380 if test "x$withval" != "xno" ; then
1381 AC_DEFINE(IPV4_DEFAULT)
1387 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1388 IPV4_IN6_HACK_MSG="no"
1390 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1392 if test "x$withval" != "xno" ; then
1394 AC_DEFINE(IPV4_IN_IPV6)
1395 IPV4_IN6_HACK_MSG="yes"
1400 if test "x$inet6_default_4in6" = "xyes"; then
1401 AC_MSG_RESULT([yes (default)])
1402 AC_DEFINE(IPV4_IN_IPV6)
1403 IPV4_IN6_HACK_MSG="yes"
1405 AC_MSG_RESULT([no (default)])
1410 AC_MSG_CHECKING(whether to install ssh as suid root)
1411 AC_ARG_ENABLE(suid-ssh,
1412 [ --enable-suid-ssh Install ssh as suid root (default)
1413 --disable-suid-ssh Install ssh without suid bit],
1414 [ case "$enableval" in
1419 *) AC_MSG_RESULT(yes)
1429 # Where to place sshd.pid
1431 AC_ARG_WITH(pid-dir,
1432 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1434 if test "x$withval" != "xno" ; then
1440 # make sure the directory exists
1441 if test ! -d $piddir ; then
1442 piddir=`eval echo ${sysconfdir}`
1444 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1448 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1451 dnl allow user to disable some login recording features
1452 AC_ARG_ENABLE(lastlog,
1453 [ --disable-lastlog disable use of lastlog even if detected [no]],
1454 [ AC_DEFINE(DISABLE_LASTLOG) ]
1457 [ --disable-utmp disable use of utmp even if detected [no]],
1458 [ AC_DEFINE(DISABLE_UTMP) ]
1460 AC_ARG_ENABLE(utmpx,
1461 [ --disable-utmpx disable use of utmpx even if detected [no]],
1462 [ AC_DEFINE(DISABLE_UTMPX) ]
1465 [ --disable-wtmp disable use of wtmp even if detected [no]],
1466 [ AC_DEFINE(DISABLE_WTMP) ]
1468 AC_ARG_ENABLE(wtmpx,
1469 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1470 [ AC_DEFINE(DISABLE_WTMPX) ]
1472 AC_ARG_ENABLE(libutil,
1473 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1474 [ AC_DEFINE(DISABLE_LOGIN) ]
1476 AC_ARG_ENABLE(pututline,
1477 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1478 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1480 AC_ARG_ENABLE(pututxline,
1481 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1482 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1484 AC_ARG_WITH(lastlog,
1485 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1487 if test "x$withval" = "xno" ; then
1488 AC_DEFINE(DISABLE_LASTLOG)
1490 conf_lastlog_location=$withval
1495 dnl lastlog, [uw]tmpx? detection
1496 dnl NOTE: set the paths in the platform section to avoid the
1497 dnl need for command-line parameters
1498 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1500 dnl lastlog detection
1501 dnl NOTE: the code itself will detect if lastlog is a directory
1502 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1504 #include <sys/types.h>
1506 #ifdef HAVE_LASTLOG_H
1507 # include <lastlog.h>
1513 [ char *lastlog = LASTLOG_FILE; ],
1514 [ AC_MSG_RESULT(yes) ],
1517 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1519 #include <sys/types.h>
1521 #ifdef HAVE_LASTLOG_H
1522 # include <lastlog.h>
1528 [ char *lastlog = _PATH_LASTLOG; ],
1529 [ AC_MSG_RESULT(yes) ],
1532 system_lastlog_path=no
1537 if test -z "$conf_lastlog_location"; then
1538 if test x"$system_lastlog_path" = x"no" ; then
1539 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1540 if (test -d "$f" || test -f "$f") ; then
1541 conf_lastlog_location=$f
1544 if test -z "$conf_lastlog_location"; then
1545 AC_MSG_WARN([** Cannot find lastlog **])
1546 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1551 if test -n "$conf_lastlog_location"; then
1552 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1556 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1558 #include <sys/types.h>
1564 [ char *utmp = UTMP_FILE; ],
1565 [ AC_MSG_RESULT(yes) ],
1567 system_utmp_path=no ]
1569 if test -z "$conf_utmp_location"; then
1570 if test x"$system_utmp_path" = x"no" ; then
1571 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1572 if test -f $f ; then
1573 conf_utmp_location=$f
1576 if test -z "$conf_utmp_location"; then
1577 AC_DEFINE(DISABLE_UTMP)
1581 if test -n "$conf_utmp_location"; then
1582 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1586 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1588 #include <sys/types.h>
1594 [ char *wtmp = WTMP_FILE; ],
1595 [ AC_MSG_RESULT(yes) ],
1597 system_wtmp_path=no ]
1599 if test -z "$conf_wtmp_location"; then
1600 if test x"$system_wtmp_path" = x"no" ; then
1601 for f in /usr/adm/wtmp /var/log/wtmp; do
1602 if test -f $f ; then
1603 conf_wtmp_location=$f
1606 if test -z "$conf_wtmp_location"; then
1607 AC_DEFINE(DISABLE_WTMP)
1611 if test -n "$conf_wtmp_location"; then
1612 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1616 dnl utmpx detection - I don't know any system so perverse as to require
1617 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1619 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1621 #include <sys/types.h>
1630 [ char *utmpx = UTMPX_FILE; ],
1631 [ AC_MSG_RESULT(yes) ],
1633 system_utmpx_path=no ]
1635 if test -z "$conf_utmpx_location"; then
1636 if test x"$system_utmpx_path" = x"no" ; then
1637 AC_DEFINE(DISABLE_UTMPX)
1640 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1644 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1646 #include <sys/types.h>
1655 [ char *wtmpx = WTMPX_FILE; ],
1656 [ AC_MSG_RESULT(yes) ],
1658 system_wtmpx_path=no ]
1660 if test -z "$conf_wtmpx_location"; then
1661 if test x"$system_wtmpx_path" = x"no" ; then
1662 AC_DEFINE(DISABLE_WTMPX)
1665 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1669 # Change default command timeout for builtin PRNG
1671 AC_ARG_WITH(entropy-timeout,
1672 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1674 if test "x$withval" != "xno" ; then
1675 entropy_timeout=$withval
1679 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1682 if test ! -z "$blibpath" ; then
1683 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1684 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1689 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1691 # Print summary of options
1693 if test x$MANTYPE = x'$(CATMAN)' ; then
1698 if test ! -z "$RANDOM_POOL" ; then
1699 RAND_MSG="Device ($RANDOM_POOL)"
1701 if test ! -z "$EGD_SOCKET" ; then
1702 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1704 RAND_MSG="Builtin (timeout $entropy_timeout)"
1709 # Someone please show me a better way :)
1710 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1711 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1712 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1713 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1714 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1715 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1716 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1719 echo "OpenSSH configured has been configured with the following options."
1720 echo " User binaries: $B"
1721 echo " System binaries: $C"
1722 echo " Configuration files: $D"
1723 echo " Askpass program: $E"
1724 echo " Manual pages: $F"
1725 echo " PID file: $G"
1726 echo " Random number collection: $RAND_MSG"
1727 echo " Manpage format: $MAN_MSG"
1728 echo " PAM support: ${PAM_MSG}"
1729 echo " KerberosIV support: $KRB4_MSG"
1730 echo " AFS support: $AFS_MSG"
1731 echo " S/KEY support: $SKEY_MSG"
1732 echo " TCP Wrappers support: $TCPW_MSG"
1733 echo " MD5 password support: $MD5_MSG"
1734 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1735 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1736 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1740 echo " Host: ${host}"
1741 echo " Compiler: ${CC}"
1742 echo " Compiler flags: ${CFLAGS}"
1743 echo "Preprocessor flags: ${CPPFLAGS}"
1744 echo " Linker flags: ${LDFLAGS}"
1745 echo " Libraries: ${LIBS}"
1749 if test "x$PAM_MSG" = "xyes" ; then
1750 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1751 echo "otherwise password authentication may fail. Example PAM control files"
1752 echo "can be found in the contrib/ subdirectory"
1756 if test ! -z "$BUILTIN_RNG" ; then
1757 echo "WARNING: you are using the builtin random number collection service."
1758 echo "Please read WARNING.RNG and request that your OS vendor includes"
1759 echo "/dev/random in future versions of their OS."
1763 if test ! -z "$NO_SFTP"; then
1764 echo "sftp-server will be disabled. Your compiler does not support"
1765 echo "64bit integers."