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)
241 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
242 LDFLAGS="$LDFLAGS -L/usr/local/lib"
243 LIBS="$LIBS -lprot -lx -ltinfo -lm"
247 rsh_path="/usr/bin/rcmd"
249 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
250 AC_DEFINE(DISABLE_SHADOW)
251 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
255 if test ! -z "USE_SIA" ; then
256 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
257 if test -f /etc/sia/matrix.conf; then
259 AC_DEFINE(HAVE_OSF_SIA)
260 AC_DEFINE(DISABLE_LOGIN)
261 LIBS="$LIBS -lsecurity -ldb -lm -laud"
269 # Allow user to specify flags
271 [ --with-cflags Specify additional flags to pass to compiler],
273 if test "x$withval" != "xno" ; then
274 CFLAGS="$CFLAGS $withval"
278 AC_ARG_WITH(cppflags,
279 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
281 if test "x$withval" != "xno"; then
282 CPPFLAGS="$CPPFLAGS $withval"
287 [ --with-ldflags Specify additional flags to pass to linker],
289 if test "x$withval" != "xno" ; then
290 LDFLAGS="$LDFLAGS $withval"
295 [ --with-libs Specify additional libraries to link with],
297 if test "x$withval" != "xno" ; then
298 LIBS="$LIBS $withval"
304 [ --with-pcre Override built in regex library with pcre],
307 AC_CHECK_LIB(pcre, pcre_info,
309 AC_DEFINE(HAVE_LIBPCRE)
310 LIBS="$LIBS -lpcreposix -lpcre"
313 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
318 # Checks for libraries.
319 if test -z "$no_libsocket" ; then
320 AC_CHECK_LIB(nsl, yp_match, , )
322 if test -z "$no_libnsl" ; then
323 AC_CHECK_LIB(socket, main, , )
326 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
327 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
328 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
330 # We don't want to check if we did an pcre override.
331 if test -z "$no_comp_check" ; then
332 AC_CHECK_FUNC(regcomp,
333 [ AC_DEFINE(HAVE_REGCOMP)],
335 AC_CHECK_LIB(pcre, pcre_info,
337 AC_DEFINE(HAVE_LIBPCRE)
338 LIBS="$LIBS -lpcreposix -lpcre"
341 AC_MSG_ERROR([*** No regex library found.])
348 AC_CHECK_FUNC(strcasecmp,
349 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
351 AC_CHECK_FUNC(utimes,
352 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
355 # Checks for header files.
356 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)
358 # Check whether user wants Kerberos support
360 AC_ARG_WITH(kerberos4,
361 [ --with-kerberos4=PATH Enable Kerberos 4 support],
363 if test "x$withval" != "xno" ; then
365 if test "x$withval" != "xyes" ; then
366 CPPFLAGS="$CPPFLAGS -I${withval}/include"
367 LDFLAGS="$LDFLAGS -L${withval}/lib"
368 if test ! -z "$need_dash_r" ; then
369 LDFLAGS="$LDFLAGS -R${withval}/lib"
371 if test ! -z "$blibpath" ; then
372 blibpath="$blibpath:${withval}/lib"
375 if test -d /usr/include/kerberosIV ; then
376 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
380 AC_CHECK_HEADERS(krb.h)
381 AC_CHECK_LIB(krb, main)
382 if test "$ac_cv_header_krb_h" != yes; then
383 AC_MSG_WARN([Cannot find krb.h, build may fail])
385 if test "$ac_cv_lib_krb_main" != yes; then
386 AC_MSG_WARN([Cannot find libkrb, build may fail])
390 AC_CHECK_LIB(resolv, dn_expand, , )
398 # Check whether user wants AFS support
401 [ --with-afs=PATH Enable AFS support],
403 if test "x$withval" != "xno" ; then
405 if test "x$withval" != "xyes" ; then
406 CPPFLAGS="$CPPFLAGS -I${withval}/include"
407 LDFLAGS="$LDFLAGS -L${withval}/lib"
410 if test -z "$KRB4" ; then
411 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
415 if test ! -z "$AFS_LIBS" ; then
416 LIBS="$LIBS $AFS_LIBS"
425 # Check whether user wants S/Key support
428 [ --with-skey=PATH Enable S/Key support],
430 if test "x$withval" != "xno" ; then
432 if test "x$withval" != "xyes" ; then
433 CPPFLAGS="$CPPFLAGS -I${withval}/include"
434 LDFLAGS="$LDFLAGS -L${withval}/lib"
441 AC_CHECK_FUNC(skey_keyinfo,
444 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
450 # Check whether user wants TCP wrappers support
452 AC_ARG_WITH(tcp-wrappers,
453 [ --with-tcp-wrappers Enable tcpwrappers support],
455 if test "x$withval" != "xno" ; then
458 AC_MSG_CHECKING(for libwrap)
462 int deny_severity = 0, allow_severity = 0;
471 AC_MSG_ERROR([*** libwrap missing])
478 dnl Checks for library functions.
479 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)
480 dnl Checks for time functions
481 AC_CHECK_FUNCS(gettimeofday time)
482 dnl Checks for libutil functions
483 AC_CHECK_HEADERS(libutil.h)
484 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
485 dnl Checks for utmp functions
486 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
487 AC_CHECK_FUNCS(utmpname)
488 dnl Checks for utmpx functions
489 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
490 AC_CHECK_FUNCS(setutxent utmpxname)
492 AC_CHECK_FUNC(getuserattr,
493 [AC_DEFINE(HAVE_GETUSERATTR)],
494 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
498 [AC_DEFINE(HAVE_LOGIN)],
499 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
502 AC_CHECK_FUNC(daemon,
503 [AC_DEFINE(HAVE_DAEMON)],
504 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
507 AC_CHECK_FUNC(getpagesize,
508 [AC_DEFINE(HAVE_GETPAGESIZE)],
509 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
512 # Check for broken snprintf
513 if test "x$ac_cv_func_snprintf" = "xyes" ; then
514 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
518 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
520 [AC_MSG_RESULT(yes)],
523 AC_DEFINE(BROKEN_SNPRINTF)
524 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
536 [ --with-pam Enable PAM support ],
538 if test "x$withval" != "xno" ; then
539 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
540 AC_MSG_ERROR([PAM headers not found])
543 AC_CHECK_LIB(dl, dlopen, , )
544 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
545 AC_CHECK_FUNCS(pam_getenvlist)
555 # Check for older PAM
556 if test "x$PAM_MSG" = "xyes" ; then
557 # Check PAM strerror arguments (old PAM)
558 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
562 #include <security/pam_appl.h>
564 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
567 AC_DEFINE(HAVE_OLD_PAM)
569 PAM_MSG="yes (old library)"
574 # The big search for OpenSSL
576 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
578 if test "x$withval" != "xno" ; then
585 saved_LDFLAGS="$LDFLAGS"
586 saved_CPPFLAGS="$CPPFLAGS"
587 if test "x$prefix" != "xNONE" ; then
588 tryssldir="$tryssldir $prefix"
590 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
592 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
593 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
594 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
595 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
596 if test ! -z "$need_dash_r" ; then
597 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
600 LDFLAGS="$saved_LDFLAGS"
603 LIBS="$saved_LIBS -lcrypto"
605 # Basic test to check for compatible version and correct linking
606 # *does not* test for RSA - that comes later.
610 #include <openssl/rand.h>
614 memset(a, 0, sizeof(a));
615 RAND_add(a, sizeof(a), sizeof(a));
616 return(RAND_status() <= 0);
625 if test ! -z "$found_crypto" ; then
630 if test -z "$found_crypto" ; then
631 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
633 if test -z "$ssldir" ; then
637 ac_cv_openssldir=$ssldir
640 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
641 AC_DEFINE(HAVE_OPENSSL)
642 dnl Need to recover ssldir - test above runs in subshell
643 ssldir=$ac_cv_openssldir
645 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
646 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
647 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
648 if test ! -z "$need_dash_r" ; then
649 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
651 if test ! -z "$blibpath" ; then
652 blibpath="$blibpath:$ssldir:$ssldir/lib"
656 LIBS="$saved_LIBS -lcrypto"
658 # Now test RSA support
660 AC_MSG_CHECKING([for RSA support])
661 for WANTS_RSAREF in "" 1 ; do
662 if test -z "$WANTS_RSAREF" ; then
665 LIBS="$saved_LIBS -lRSAglue -lrsaref"
669 #include <openssl/rand.h>
670 #include <openssl/rsa.h>
671 #include <openssl/bn.h>
672 #include <openssl/sha.h>
675 int num; RSA *key; static unsigned char p_in[] = "blahblah";
676 unsigned char c[256], p[256];
677 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
678 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
679 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
680 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
689 if test ! -z "$no_rsa" ; then
690 AC_MSG_RESULT(disabled)
693 if test -z "$rsa_works" ; then
694 AC_MSG_WARN([*** No RSA support found *** ])
697 if test -z "$WANTS_RSAREF" ; then
701 RSA_MSG="yes (using RSAref)"
702 AC_MSG_RESULT(using RSAref)
703 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
708 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
709 # version in OpenSSL. Skip this for PAM
710 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
711 AC_CHECK_LIB(crypt, crypt, , )
714 # Cheap hack to ensure NEWS-OS libraries are arranged right.
715 if test ! -z "$SONY" ; then
716 LIBS="$LIBS -liberty";
719 # Checks for data types
720 AC_CHECK_SIZEOF(char, 1)
721 AC_CHECK_SIZEOF(short int, 2)
722 AC_CHECK_SIZEOF(int, 4)
723 AC_CHECK_SIZEOF(long int, 4)
724 AC_CHECK_SIZEOF(long long int, 8)
726 # More checks for data types
727 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
729 [ #include <sys/types.h> ],
731 [ ac_cv_have_u_int="yes" ],
732 [ ac_cv_have_u_int="no" ]
735 if test "x$ac_cv_have_u_int" = "xyes" ; then
736 AC_DEFINE(HAVE_U_INT)
740 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
742 [ #include <sys/types.h> ],
743 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
744 [ ac_cv_have_intxx_t="yes" ],
745 [ ac_cv_have_intxx_t="no" ]
748 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
749 AC_DEFINE(HAVE_INTXX_T)
753 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
755 [ #include <sys/types.h> ],
756 [ int64_t a; a = 1;],
757 [ ac_cv_have_int64_t="yes" ],
758 [ ac_cv_have_int64_t="no" ]
761 if test "x$ac_cv_have_int64_t" = "xyes" ; then
762 AC_DEFINE(HAVE_INT64_T)
766 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
768 [ #include <sys/types.h> ],
769 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
770 [ ac_cv_have_u_intxx_t="yes" ],
771 [ ac_cv_have_u_intxx_t="no" ]
774 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
775 AC_DEFINE(HAVE_U_INTXX_T)
779 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
781 [ #include <sys/types.h> ],
782 [ u_int64_t a; a = 1;],
783 [ ac_cv_have_u_int64_t="yes" ],
784 [ ac_cv_have_u_int64_t="no" ]
787 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
788 AC_DEFINE(HAVE_U_INT64_T)
792 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
793 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
795 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
798 #include <sys/bitypes.h>
801 int8_t a; int16_t b; int32_t c;
802 u_int8_t e; u_int16_t f; u_int32_t g;
803 a = b = c = e = f = g = 1;
806 AC_DEFINE(HAVE_U_INTXX_T)
807 AC_DEFINE(HAVE_INTXX_T)
814 if test -z "$have_u_intxx_t" ; then
815 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
818 #include <sys/types.h>
820 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
821 [ ac_cv_have_uintxx_t="yes" ],
822 [ ac_cv_have_uintxx_t="no" ]
825 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
826 AC_DEFINE(HAVE_UINTXX_T)
830 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
833 #include <sys/types.h>
834 #include <sys/socket.h>
836 [socklen_t foo; foo = 1235;],
837 [ ac_cv_have_socklen_t="yes" ],
838 [ ac_cv_have_socklen_t="no" ]
841 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
842 AC_DEFINE(HAVE_SOCKLEN_T)
845 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
848 #include <sys/types.h>
850 [ size_t foo; foo = 1235; ],
851 [ ac_cv_have_size_t="yes" ],
852 [ ac_cv_have_size_t="no" ]
855 if test "x$ac_cv_have_size_t" = "xyes" ; then
856 AC_DEFINE(HAVE_SIZE_T)
859 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
862 #include <sys/types.h>
864 [ ssize_t foo; foo = 1235; ],
865 [ ac_cv_have_ssize_t="yes" ],
866 [ ac_cv_have_ssize_t="no" ]
869 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
870 AC_DEFINE(HAVE_SSIZE_T)
873 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
878 [ clock_t foo; foo = 1235; ],
879 [ ac_cv_have_clock_t="yes" ],
880 [ ac_cv_have_clock_t="no" ]
883 if test "x$ac_cv_have_clock_t" = "xyes" ; then
884 AC_DEFINE(HAVE_CLOCK_T)
887 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
890 #include <sys/types.h>
891 #include <sys/socket.h>
893 [ sa_family_t foo; foo = 1235; ],
894 [ ac_cv_have_sa_family_t="yes" ],
897 #include <sys/types.h>
898 #include <sys/socket.h>
899 #include <netinet/in.h>
901 [ sa_family_t foo; foo = 1235; ],
902 [ ac_cv_have_sa_family_t="yes" ],
904 [ ac_cv_have_sa_family_t="no" ]
908 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
909 AC_DEFINE(HAVE_SA_FAMILY_T)
912 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
915 #include <sys/types.h>
917 [ pid_t foo; foo = 1235; ],
918 [ ac_cv_have_pid_t="yes" ],
919 [ ac_cv_have_pid_t="no" ]
922 if test "x$ac_cv_have_pid_t" = "xyes" ; then
923 AC_DEFINE(HAVE_PID_T)
926 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
929 #include <sys/types.h>
931 [ mode_t foo; foo = 1235; ],
932 [ ac_cv_have_mode_t="yes" ],
933 [ ac_cv_have_mode_t="no" ]
936 if test "x$ac_cv_have_mode_t" = "xyes" ; then
937 AC_DEFINE(HAVE_MODE_T)
941 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
944 #include <sys/types.h>
945 #include <sys/socket.h>
947 [ struct sockaddr_storage s; ],
948 [ ac_cv_have_struct_sockaddr_storage="yes" ],
949 [ ac_cv_have_struct_sockaddr_storage="no" ]
952 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
953 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
956 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
959 #include <sys/types.h>
960 #include <netinet/in.h>
962 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
963 [ ac_cv_have_struct_sockaddr_in6="yes" ],
964 [ ac_cv_have_struct_sockaddr_in6="no" ]
967 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
968 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
971 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
974 #include <sys/types.h>
975 #include <netinet/in.h>
977 [ struct in6_addr s; s.s6_addr[0] = 0; ],
978 [ ac_cv_have_struct_in6_addr="yes" ],
979 [ ac_cv_have_struct_in6_addr="no" ]
982 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
983 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
986 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
989 #include <sys/types.h>
990 #include <sys/socket.h>
993 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
994 [ ac_cv_have_struct_addrinfo="yes" ],
995 [ ac_cv_have_struct_addrinfo="no" ]
998 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
999 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1002 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1004 [ #include <sys/time.h> ],
1005 [ struct timeval tv; tv.tv_sec = 1;],
1006 [ ac_cv_have_struct_timeval="yes" ],
1007 [ ac_cv_have_struct_timeval="no" ]
1010 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1011 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1012 have_struct_timeval=1
1015 # If we don't have int64_t then we can't compile sftp-server. So don't
1016 # even attempt to do it.
1017 if test "x$ac_cv_have_int64_t" = "xno" -a \
1018 "x$ac_cv_sizeof_long_int" != "x8" -a \
1019 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1024 dnl Checks for structure members
1025 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1026 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1027 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1028 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1029 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1030 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1031 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1032 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1033 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1034 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1035 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1036 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1037 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1038 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1039 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1040 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1041 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1042 AC_STRUCT_ST_BLKSIZE
1044 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1045 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1048 #include <sys/types.h>
1049 #include <sys/socket.h>
1051 [ struct sockaddr_un s; s.sun_len = 1; ],
1052 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1053 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1056 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1057 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1060 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1061 ac_cv_have_ss_family_in_struct_ss, [
1064 #include <sys/types.h>
1065 #include <sys/socket.h>
1067 [ struct sockaddr_storage s; s.ss_family = 1; ],
1068 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1069 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1072 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1073 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1076 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1077 ac_cv_have___ss_family_in_struct_ss, [
1080 #include <sys/types.h>
1081 #include <sys/socket.h>
1083 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1084 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1085 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1088 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1089 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1092 AC_CACHE_CHECK([for pw_class field in struct passwd],
1093 ac_cv_have_pw_class_in_struct_passwd, [
1098 [ struct passwd p; p.pw_class = 0; ],
1099 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1100 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1103 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1104 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1108 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1110 [ extern char *__progname; printf("%s", __progname); ],
1111 [ ac_cv_libc_defines___progname="yes" ],
1112 [ ac_cv_libc_defines___progname="no" ]
1115 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1116 AC_DEFINE(HAVE___PROGNAME)
1120 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1122 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1123 [ ac_cv_libc_defines_sys_errlist="yes" ],
1124 [ ac_cv_libc_defines_sys_errlist="no" ]
1127 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1128 AC_DEFINE(HAVE_SYS_ERRLIST)
1132 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1134 [ extern int sys_nerr; printf("%i", sys_nerr);],
1135 [ ac_cv_libc_defines_sys_nerr="yes" ],
1136 [ ac_cv_libc_defines_sys_nerr="no" ]
1139 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1140 AC_DEFINE(HAVE_SYS_NERR)
1144 # Looking for programs, paths and files
1146 [ --with-rsh=PATH Specify path to remote shell program ],
1148 if test "x$withval" != "$no" ; then
1153 AC_PATH_PROG(rsh_path, rsh)
1158 [ --with-xauth=PATH Specify path to xauth program ],
1160 if test "x$withval" != "xno" ; then
1165 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1166 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1167 xauth_path="/usr/openwin/bin/xauth"
1172 if test -z "$xauth_path" ; then
1173 XAUTH_PATH="undefined"
1174 AC_SUBST(XAUTH_PATH)
1176 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1177 XAUTH_PATH=$xauth_path
1178 AC_SUBST(XAUTH_PATH)
1180 if test ! -z "$rsh_path" ; then
1181 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1184 # Check for mail directory (last resort if we cannot get it from headers)
1185 if test ! -z "$MAIL" ; then
1186 maildir=`dirname $MAIL`
1187 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1190 if test -z "$no_dev_ptmx" ; then
1191 AC_CHECK_FILE("/dev/ptmx",
1193 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1198 AC_CHECK_FILE("/dev/ptc",
1200 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1205 # Options from here on. Some of these are preset by platform above
1207 # Check for user-specified random device, otherwise check /dev/urandom
1209 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1211 if test "x$withval" != "xno" ; then
1212 RANDOM_POOL="$withval";
1213 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1217 # Check for random device
1218 AC_CHECK_FILE("/dev/urandom",
1220 RANDOM_POOL="/dev/urandom";
1221 AC_SUBST(RANDOM_POOL)
1222 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1228 # Check for EGD pool file
1229 AC_ARG_WITH(egd-pool,
1230 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1232 if test "x$withval" != "xno" ; then
1233 EGD_SOCKET="$withval";
1234 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1238 # Check for existing socket only if we don't have a random device already
1239 if test -z "$RANDOM_POOL" ; then
1240 AC_MSG_CHECKING(for PRNGD/EGD socket)
1241 # Insert other locations here
1242 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1243 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
1244 EGD_SOCKET="$egdsock"
1245 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1249 if test -x "$EGD_SOCKET" ; then
1250 AC_MSG_RESULT($EGD_SOCKET)
1252 AC_MSG_RESULT(not found)
1259 # detect pathnames for entropy gathering commands, if we need them
1260 INSTALL_SSH_PRNG_CMDS=""
1262 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
1263 # Use these commands to collect entropy
1264 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1265 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1266 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1267 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1268 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1269 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1270 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1271 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1272 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1273 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1274 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1275 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1276 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1277 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1279 INSTALL_SSH_PRNG_CMDS="yes"
1281 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1285 [ --with-catman=man|cat Install preformatted manpages[no]],
1288 if test x"$withval" != x"yes" ; then
1294 if test -z "$MANTYPE" ; then
1295 MANTYPE='$(TROFFMAN)'
1303 # Check whether to enable MD5 passwords
1305 AC_ARG_WITH(md5-passwords,
1306 [ --with-md5-passwords Enable use of MD5 passwords],
1308 if test "x$withval" != "xno" ; then
1309 AC_DEFINE(HAVE_MD5_PASSWORDS)
1315 # Whether to disable shadow password support
1317 [ --without-shadow Disable shadow password support],
1319 if test "x$withval" = "xno" ; then
1320 AC_DEFINE(DISABLE_SHADOW)
1326 if test -z "$disable_shadow" ; then
1327 AC_MSG_CHECKING([if the systems has expire shadow information])
1330 #include <sys/types.h>
1333 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1334 [ sp_expire_available=yes ], []
1337 if test "x$sp_expire_available" = "xyes" ; then
1339 AC_DEFINE(HAS_SHADOW_EXPIRE)
1345 # Use ip address instead of hostname in $DISPLAY
1346 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1347 DISPLAY_HACK_MSG="yes"
1348 AC_DEFINE(IPADDR_IN_DISPLAY)
1350 DISPLAY_HACK_MSG="no"
1351 AC_ARG_WITH(ipaddr-display,
1352 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1354 if test "x$withval" != "xno" ; then
1355 AC_DEFINE(IPADDR_IN_DISPLAY)
1356 DISPLAY_HACK_MSG="yes"
1362 # Whether to mess with the default path
1363 SERVER_PATH_MSG="(default)"
1364 AC_ARG_WITH(default-path,
1365 [ --with-default-path=PATH Specify default \$PATH environment for server],
1367 if test "x$withval" != "xno" ; then
1368 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1369 SERVER_PATH_MSG="$withval"
1374 # Whether to force IPv4 by default (needed on broken glibc Linux)
1376 AC_ARG_WITH(ipv4-default,
1377 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1379 if test "x$withval" != "xno" ; then
1380 AC_DEFINE(IPV4_DEFAULT)
1386 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1387 IPV4_IN6_HACK_MSG="no"
1389 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1391 if test "x$withval" != "xno" ; then
1393 AC_DEFINE(IPV4_IN_IPV6)
1394 IPV4_IN6_HACK_MSG="yes"
1399 if test "x$inet6_default_4in6" = "xyes"; then
1400 AC_MSG_RESULT([yes (default)])
1401 AC_DEFINE(IPV4_IN_IPV6)
1402 IPV4_IN6_HACK_MSG="yes"
1404 AC_MSG_RESULT([no (default)])
1409 AC_MSG_CHECKING(whether to install ssh as suid root)
1410 AC_ARG_ENABLE(suid-ssh,
1411 [ --enable-suid-ssh Install ssh as suid root (default)
1412 --disable-suid-ssh Install ssh without suid bit],
1413 [ case "$enableval" in
1418 *) AC_MSG_RESULT(yes)
1428 # Where to place sshd.pid
1430 AC_ARG_WITH(pid-dir,
1431 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1433 if test "x$withval" != "xno" ; then
1439 # make sure the directory exists
1440 if test ! -d $piddir ; then
1441 piddir=`eval echo ${sysconfdir}`
1443 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1447 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1450 dnl allow user to disable some login recording features
1451 AC_ARG_ENABLE(lastlog,
1452 [ --disable-lastlog disable use of lastlog even if detected [no]],
1453 [ AC_DEFINE(DISABLE_LASTLOG) ]
1456 [ --disable-utmp disable use of utmp even if detected [no]],
1457 [ AC_DEFINE(DISABLE_UTMP) ]
1459 AC_ARG_ENABLE(utmpx,
1460 [ --disable-utmpx disable use of utmpx even if detected [no]],
1461 [ AC_DEFINE(DISABLE_UTMPX) ]
1464 [ --disable-wtmp disable use of wtmp even if detected [no]],
1465 [ AC_DEFINE(DISABLE_WTMP) ]
1467 AC_ARG_ENABLE(wtmpx,
1468 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1469 [ AC_DEFINE(DISABLE_WTMPX) ]
1471 AC_ARG_ENABLE(libutil,
1472 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1473 [ AC_DEFINE(DISABLE_LOGIN) ]
1475 AC_ARG_ENABLE(pututline,
1476 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1477 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1479 AC_ARG_ENABLE(pututxline,
1480 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1481 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1483 AC_ARG_WITH(lastlog,
1484 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1486 if test "x$withval" = "xno" ; then
1487 AC_DEFINE(DISABLE_LASTLOG)
1489 conf_lastlog_location=$withval
1494 dnl lastlog, [uw]tmpx? detection
1495 dnl NOTE: set the paths in the platform section to avoid the
1496 dnl need for command-line parameters
1497 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1499 dnl lastlog detection
1500 dnl NOTE: the code itself will detect if lastlog is a directory
1501 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1503 #include <sys/types.h>
1505 #ifdef HAVE_LASTLOG_H
1506 # include <lastlog.h>
1512 [ char *lastlog = LASTLOG_FILE; ],
1513 [ AC_MSG_RESULT(yes) ],
1516 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1518 #include <sys/types.h>
1520 #ifdef HAVE_LASTLOG_H
1521 # include <lastlog.h>
1527 [ char *lastlog = _PATH_LASTLOG; ],
1528 [ AC_MSG_RESULT(yes) ],
1531 system_lastlog_path=no
1536 if test -z "$conf_lastlog_location"; then
1537 if test x"$system_lastlog_path" = x"no" ; then
1538 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1539 if (test -d "$f" || test -f "$f") ; then
1540 conf_lastlog_location=$f
1543 if test -z "$conf_lastlog_location"; then
1544 AC_MSG_WARN([** Cannot find lastlog **])
1545 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1550 if test -n "$conf_lastlog_location"; then
1551 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1555 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1557 #include <sys/types.h>
1563 [ char *utmp = UTMP_FILE; ],
1564 [ AC_MSG_RESULT(yes) ],
1566 system_utmp_path=no ]
1568 if test -z "$conf_utmp_location"; then
1569 if test x"$system_utmp_path" = x"no" ; then
1570 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1571 if test -f $f ; then
1572 conf_utmp_location=$f
1575 if test -z "$conf_utmp_location"; then
1576 AC_DEFINE(DISABLE_UTMP)
1580 if test -n "$conf_utmp_location"; then
1581 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1585 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1587 #include <sys/types.h>
1593 [ char *wtmp = WTMP_FILE; ],
1594 [ AC_MSG_RESULT(yes) ],
1596 system_wtmp_path=no ]
1598 if test -z "$conf_wtmp_location"; then
1599 if test x"$system_wtmp_path" = x"no" ; then
1600 for f in /usr/adm/wtmp /var/log/wtmp; do
1601 if test -f $f ; then
1602 conf_wtmp_location=$f
1605 if test -z "$conf_wtmp_location"; then
1606 AC_DEFINE(DISABLE_WTMP)
1610 if test -n "$conf_wtmp_location"; then
1611 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1615 dnl utmpx detection - I don't know any system so perverse as to require
1616 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1618 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1620 #include <sys/types.h>
1629 [ char *utmpx = UTMPX_FILE; ],
1630 [ AC_MSG_RESULT(yes) ],
1632 system_utmpx_path=no ]
1634 if test -z "$conf_utmpx_location"; then
1635 if test x"$system_utmpx_path" = x"no" ; then
1636 AC_DEFINE(DISABLE_UTMPX)
1639 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1643 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1645 #include <sys/types.h>
1654 [ char *wtmpx = WTMPX_FILE; ],
1655 [ AC_MSG_RESULT(yes) ],
1657 system_wtmpx_path=no ]
1659 if test -z "$conf_wtmpx_location"; then
1660 if test x"$system_wtmpx_path" = x"no" ; then
1661 AC_DEFINE(DISABLE_WTMPX)
1664 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1668 # Change default command timeout for builtin PRNG
1670 AC_ARG_WITH(entropy-timeout,
1671 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1673 if test "x$withval" != "xno" ; then
1674 entropy_timeout=$withval
1678 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1681 if test ! -z "$blibpath" ; then
1682 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1683 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1688 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1690 # Print summary of options
1692 if test x$MANTYPE = x'$(CATMAN)' ; then
1697 if test ! -z "$RANDOM_POOL" ; then
1698 RAND_MSG="Device ($RANDOM_POOL)"
1700 if test ! -z "$EGD_SOCKET" ; then
1701 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
1703 RAND_MSG="Builtin (timeout $entropy_timeout)"
1708 # Someone please show me a better way :)
1709 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1710 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1711 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1712 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1713 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1714 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1715 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1718 echo "OpenSSH configured has been configured with the following options."
1719 echo " User binaries: $B"
1720 echo " System binaries: $C"
1721 echo " Configuration files: $D"
1722 echo " Askpass program: $E"
1723 echo " Manual pages: $F"
1724 echo " PID file: $G"
1725 echo " Random number collection: $RAND_MSG"
1726 echo " Manpage format: $MAN_MSG"
1727 echo " PAM support: ${PAM_MSG}"
1728 echo " KerberosIV support: $KRB4_MSG"
1729 echo " AFS support: $AFS_MSG"
1730 echo " S/KEY support: $SKEY_MSG"
1731 echo " TCP Wrappers support: $TCPW_MSG"
1732 echo " MD5 password support: $MD5_MSG"
1733 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1734 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1735 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1739 echo " Host: ${host}"
1740 echo " Compiler: ${CC}"
1741 echo " Compiler flags: ${CFLAGS}"
1742 echo "Preprocessor flags: ${CPPFLAGS}"
1743 echo " Linker flags: ${LDFLAGS}"
1744 echo " Libraries: ${LIBS}"
1748 if test "x$PAM_MSG" = "xyes" ; then
1749 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1750 echo "otherwise password authentication may fail. Example PAM control files"
1751 echo "can be found in the contrib/ subdirectory"
1755 if test ! -z "$BUILTIN_RNG" ; then
1756 echo "WARNING: you are using the builtin random number collection service."
1757 echo "Please read WARNING.RNG and request that your OS vendor includes"
1758 echo "/dev/random in future versions of their OS."
1762 if test ! -z "$NO_SFTP"; then
1763 echo "sftp-server will be disabled. Your compiler does not support"
1764 echo "64bit integers."