5 AC_CONFIG_HEADER(config.h)
10 # Checks for programs.
15 AC_PATH_PROG(PERL, perl)
17 AC_PATH_PROG(ENT, ent)
19 AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
20 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
21 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
24 if test -z "$AR" ; then
25 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
28 # Use LOGIN_PROGRAM from environment if possible
29 if test ! -z "$LOGIN_PROGRAM" ; then
30 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
33 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
34 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
39 if test -z "$LD" ; then
46 if test "$GCC" = "yes"; then
47 CFLAGS="$CFLAGS -Wall"
50 # Check for some target-specific stuff
54 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
55 LDFLAGS="$LDFLAGS -L/usr/local/lib"
56 if (test "$LD" != "gcc" && test -z "$blibpath"); then
57 blibpath="/usr/lib:/lib:/usr/local/lib"
59 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
60 AC_DEFINE(BROKEN_GETADDRINFO)
63 dnl AIX handles lastlog as part of its login message
64 AC_DEFINE(DISABLE_LASTLOG)
69 LIBS="$LIBS -lregex /usr/lib/textmode.o"
70 AC_DEFINE(HAVE_CYGWIN)
71 AC_DEFINE(DISABLE_SHADOW)
72 AC_DEFINE(IPV4_DEFAULT)
73 AC_DEFINE(IP_TOS_IS_BROKEN)
74 AC_DEFINE(BROKEN_VHANGUP)
75 AC_DEFINE(NO_X11_UNIX_SOCKETS)
80 AC_DEFINE(IP_TOS_IS_BROKEN)
83 if test -z "$GCC"; then
86 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
89 AC_DEFINE(DISABLE_SHADOW)
90 AC_DEFINE(DISABLE_UTMP)
91 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
97 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
99 AC_DEFINE(PAM_SUN_CODEBASE)
101 AC_DEFINE(DISABLE_SHADOW)
102 AC_DEFINE(DISABLE_UTMP)
103 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
109 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
111 PATH="$PATH:/usr/etc"
115 AC_DEFINE(BROKEN_INET_NTOA)
118 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
120 PATH="$PATH:/usr/etc"
122 AC_DEFINE(WITH_IRIX_ARRAY)
123 AC_DEFINE(WITH_IRIX_PROJECT)
124 AC_DEFINE(WITH_IRIX_AUDIT)
125 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
128 AC_DEFINE(BROKEN_INET_NTOA)
133 check_for_libcrypt_later=1
134 AC_DEFINE(DONT_TRY_OTHER_AF)
135 AC_DEFINE(PAM_TTY_KLUDGE)
136 inet6_default_4in6=yes
138 mips-sony-bsd|mips-sony-newsos4)
139 AC_DEFINE(HAVE_NEWS4)
141 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
142 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
149 check_for_libcrypt_later=1
152 conf_lastlog_location="/usr/adm/lastlog"
153 conf_utmp_location=/etc/utmp
154 conf_wtmp_location=/usr/adm/wtmp
157 AC_DEFINE(BROKEN_REALPATH)
159 AC_DEFINE(BROKEN_SAVED_UIDS)
160 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
164 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
165 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
167 AC_DEFINE(PAM_SUN_CODEBASE)
168 # hardwire lastlog location (can't detect it on some versions)
169 conf_lastlog_location="/var/adm/lastlog"
170 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
171 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
172 if test "$sol2ver" -ge 8; then
174 AC_DEFINE(DISABLE_UTMP)
175 AC_DEFINE(DISABLE_WTMP)
181 CPPFLAGS="$CPPFLAGS -DSUNOS4"
182 AC_CHECK_FUNCS(getpwanam)
183 AC_DEFINE(PAM_SUN_CODEBASE)
184 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
185 conf_utmp_location=/etc/utmp
186 conf_wtmp_location=/var/adm/wtmp
187 conf_lastlog_location=/var/adm/lastlog
193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
194 LDFLAGS="$LDFLAGS -L/usr/local/lib"
197 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
200 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
201 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
203 IPADDR_IN_DISPLAY=yes
205 AC_DEFINE(IP_TOS_IS_BROKEN)
206 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
208 LIBS="$LIBS -lgen -lnsl -lucb"
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"
227 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
228 LDFLAGS="$LDFLAGS -L/usr/local/lib"
231 LIBS="$LIBS -lgen -lsocket"
234 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
235 LDFLAGS="$LDFLAGS -L/usr/local/lib"
237 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
239 rsh_path="/usr/bin/rcmd"
242 AC_DEFINE(BROKEN_SYS_TERMIO_H)
244 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
245 AC_DEFINE(DISABLE_SHADOW)
246 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
247 AC_DEFINE(BROKEN_SAVED_UIDS)
248 AC_CHECK_FUNCS(getluid setluid)
251 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
252 LDFLAGS="$LDFLAGS -L/usr/local/lib"
253 LIBS="$LIBS -lprot -lx -ltinfo -lm"
257 rsh_path="/usr/bin/rcmd"
259 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
260 AC_DEFINE(DISABLE_SHADOW)
261 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
262 AC_CHECK_FUNCS(getluid setluid)
265 if test ! -z "USE_SIA" ; then
266 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
267 if test -f /etc/sia/matrix.conf; then
269 AC_DEFINE(HAVE_OSF_SIA)
270 AC_DEFINE(DISABLE_LOGIN)
271 LIBS="$LIBS -lsecurity -ldb -lm -laud"
279 # Allow user to specify flags
281 [ --with-cflags Specify additional flags to pass to compiler],
283 if test "x$withval" != "xno" ; then
284 CFLAGS="$CFLAGS $withval"
288 AC_ARG_WITH(cppflags,
289 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
291 if test "x$withval" != "xno"; then
292 CPPFLAGS="$CPPFLAGS $withval"
297 [ --with-ldflags Specify additional flags to pass to linker],
299 if test "x$withval" != "xno" ; then
300 LDFLAGS="$LDFLAGS $withval"
305 [ --with-libs Specify additional libraries to link with],
307 if test "x$withval" != "xno" ; then
308 LIBS="$LIBS $withval"
314 [ --with-pcre Override built in regex library with pcre],
317 AC_CHECK_LIB(pcre, pcre_info,
319 AC_DEFINE(HAVE_LIBPCRE)
320 LIBS="$LIBS -lpcreposix -lpcre"
323 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
328 # Checks for libraries.
329 if test -z "$no_libnsl" ; then
330 AC_CHECK_LIB(nsl, yp_match, , )
332 if test -z "$no_libsocket" ; then
333 AC_CHECK_LIB(socket, main, , )
336 dnl SCO OS3 needs this for libwrap
337 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
339 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
340 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
341 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
343 # We don't want to check if we did an pcre override.
344 if test -z "$no_comp_check" ; then
345 AC_CHECK_FUNC(regcomp,
346 [ AC_DEFINE(HAVE_REGCOMP)],
348 AC_CHECK_LIB(pcre, pcre_info,
350 AC_DEFINE(HAVE_LIBPCRE)
351 LIBS="$LIBS -lpcreposix -lpcre"
354 AC_MSG_ERROR([*** No regex library found.])
361 AC_CHECK_FUNC(strcasecmp,
362 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
364 AC_CHECK_FUNC(utimes,
365 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
370 # Checks for header files.
371 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)
373 # Check whether user wants Kerberos support
375 AC_ARG_WITH(kerberos4,
376 [ --with-kerberos4=PATH Enable Kerberos 4 support],
378 if test "x$withval" != "xno" ; then
380 if test "x$withval" != "xyes" ; then
381 CPPFLAGS="$CPPFLAGS -I${withval}/include"
382 LDFLAGS="$LDFLAGS -L${withval}/lib"
383 if test ! -z "$need_dash_r" ; then
384 LDFLAGS="$LDFLAGS -R${withval}/lib"
386 if test ! -z "$blibpath" ; then
387 blibpath="$blibpath:${withval}/lib"
390 if test -d /usr/include/kerberosIV ; then
391 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
395 AC_CHECK_HEADERS(krb.h)
396 AC_CHECK_LIB(krb, main)
397 if test "$ac_cv_header_krb_h" != yes; then
398 AC_MSG_WARN([Cannot find krb.h, build may fail])
400 if test "$ac_cv_lib_krb_main" != yes; then
401 AC_MSG_WARN([Cannot find libkrb, build may fail])
405 AC_CHECK_LIB(resolv, dn_expand, , )
413 # Check whether user wants AFS support
416 [ --with-afs=PATH Enable AFS support],
418 if test "x$withval" != "xno" ; then
420 if test "x$withval" != "xyes" ; then
421 CPPFLAGS="$CPPFLAGS -I${withval}/include"
422 LDFLAGS="$LDFLAGS -L${withval}/lib"
425 if test -z "$KRB4" ; then
426 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
430 if test ! -z "$AFS_LIBS" ; then
431 LIBS="$LIBS $AFS_LIBS"
440 # Check whether user wants S/Key support
443 [ --with-skey=PATH Enable S/Key support],
445 if test "x$withval" != "xno" ; then
447 if test "x$withval" != "xyes" ; then
448 CPPFLAGS="$CPPFLAGS -I${withval}/include"
449 LDFLAGS="$LDFLAGS -L${withval}/lib"
456 AC_CHECK_FUNC(skey_keyinfo,
459 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
465 # Check whether user wants TCP wrappers support
467 AC_ARG_WITH(tcp-wrappers,
468 [ --with-tcp-wrappers Enable tcpwrappers support],
470 if test "x$withval" != "xno" ; then
473 AC_MSG_CHECKING(for libwrap)
477 int deny_severity = 0, allow_severity = 0;
486 AC_MSG_ERROR([*** libwrap missing])
493 dnl Checks for library functions.
494 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)
495 dnl Checks for time functions
496 AC_CHECK_FUNCS(gettimeofday time)
497 dnl Checks for libutil functions
498 AC_CHECK_HEADERS(libutil.h)
499 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
500 dnl Checks for utmp functions
501 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
502 AC_CHECK_FUNCS(utmpname)
503 dnl Checks for utmpx functions
504 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
505 AC_CHECK_FUNCS(setutxent utmpxname)
507 AC_CHECK_FUNC(getuserattr,
508 [AC_DEFINE(HAVE_GETUSERATTR)],
509 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
513 [AC_DEFINE(HAVE_LOGIN)],
514 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
517 AC_CHECK_FUNC(daemon,
518 [AC_DEFINE(HAVE_DAEMON)],
519 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
522 AC_CHECK_FUNC(getpagesize,
523 [AC_DEFINE(HAVE_GETPAGESIZE)],
524 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
527 # Check for broken snprintf
528 if test "x$ac_cv_func_snprintf" = "xyes" ; then
529 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
533 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
535 [AC_MSG_RESULT(yes)],
538 AC_DEFINE(BROKEN_SNPRINTF)
539 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
549 [ --with-pam Enable PAM support ],
551 if test "x$withval" != "xno" ; then
552 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
553 AC_MSG_ERROR([PAM headers not found])
556 AC_CHECK_LIB(dl, dlopen, , )
557 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
558 AC_CHECK_FUNCS(pam_getenvlist)
568 # Check for older PAM
569 if test "x$PAM_MSG" = "xyes" ; then
570 # Check PAM strerror arguments (old PAM)
571 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
575 #include <security/pam_appl.h>
577 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
580 AC_DEFINE(HAVE_OLD_PAM)
582 PAM_MSG="yes (old library)"
587 # The big search for OpenSSL
589 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
591 if test "x$withval" != "xno" ; then
598 saved_LDFLAGS="$LDFLAGS"
599 saved_CPPFLAGS="$CPPFLAGS"
600 if test "x$prefix" != "xNONE" ; then
601 tryssldir="$tryssldir $prefix"
603 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
604 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
605 CPPFLAGS="$saved_CPPFLAGS"
606 LDFLAGS="$saved_LDFLAGS"
607 LIBS="$saved_LIBS -lcrypto"
609 # Skip directories if they don't exist
610 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
613 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
614 # Try to use $ssldir/lib if it exists, otherwise
616 if test -d "$ssldir/lib" ; then
617 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
618 if test ! -z "$need_dash_r" ; then
619 LDFLAGS="$LDFLAGS -R$ssldir/lib"
622 LDFLAGS="$saved_LDFLAGS -L$ssldir"
623 if test ! -z "$need_dash_r" ; then
624 LDFLAGS="$LDFLAGS -R$ssldir"
627 # Try to use $ssldir/include if it exists, otherwise
629 if test -d "$ssldir/include" ; then
630 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
632 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
636 # Basic test to check for compatible version and correct linking
637 # *does not* test for RSA - that comes later.
641 #include <openssl/rand.h>
645 memset(a, 0, sizeof(a));
646 RAND_add(a, sizeof(a), sizeof(a));
647 return(RAND_status() <= 0);
656 if test ! -z "$found_crypto" ; then
661 if test -z "$found_crypto" ; then
662 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
664 if test -z "$ssldir" ; then
668 ac_cv_openssldir=$ssldir
671 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
672 AC_DEFINE(HAVE_OPENSSL)
673 dnl Need to recover ssldir - test above runs in subshell
674 ssldir=$ac_cv_openssldir
675 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
676 # Try to use $ssldir/lib if it exists, otherwise
678 if test -d "$ssldir/lib" ; then
679 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
680 if test ! -z "$need_dash_r" ; then
681 LDFLAGS="$LDFLAGS -R$ssldir/lib"
684 LDFLAGS="$saved_LDFLAGS -L$ssldir"
685 if test ! -z "$need_dash_r" ; then
686 LDFLAGS="$LDFLAGS -R$ssldir"
689 # Try to use $ssldir/include if it exists, otherwise
691 if test -d "$ssldir/include" ; then
692 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
694 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
698 LIBS="$saved_LIBS -lcrypto"
700 # Now test RSA support
702 AC_MSG_CHECKING([for RSA support])
703 for WANTS_RSAREF in "" 1 ; do
704 if test -z "$WANTS_RSAREF" ; then
707 LIBS="$saved_LIBS -lRSAglue -lrsaref"
711 #include <openssl/rand.h>
712 #include <openssl/rsa.h>
713 #include <openssl/bn.h>
714 #include <openssl/sha.h>
717 int num; RSA *key; static unsigned char p_in[] = "blahblah";
718 unsigned char c[256], p[256];
719 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
720 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
721 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
722 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
731 if test ! -z "$no_rsa" ; then
732 AC_MSG_RESULT(disabled)
735 if test -z "$rsa_works" ; then
736 AC_MSG_WARN([*** No RSA support found *** ])
739 if test -z "$WANTS_RSAREF" ; then
743 RSA_MSG="yes (using RSAref)"
744 AC_MSG_RESULT(using RSAref)
745 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
750 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
751 # version in OpenSSL. Skip this for PAM
752 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
753 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
756 # Cheap hack to ensure NEWS-OS libraries are arranged right.
757 if test ! -z "$SONY" ; then
758 LIBS="$LIBS -liberty";
761 # Checks for data types
762 AC_CHECK_SIZEOF(char, 1)
763 AC_CHECK_SIZEOF(short int, 2)
764 AC_CHECK_SIZEOF(int, 4)
765 AC_CHECK_SIZEOF(long int, 4)
766 AC_CHECK_SIZEOF(long long int, 8)
768 # More checks for data types
769 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
771 [ #include <sys/types.h> ],
773 [ ac_cv_have_u_int="yes" ],
774 [ ac_cv_have_u_int="no" ]
777 if test "x$ac_cv_have_u_int" = "xyes" ; then
778 AC_DEFINE(HAVE_U_INT)
782 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
784 [ #include <sys/types.h> ],
785 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
786 [ ac_cv_have_intxx_t="yes" ],
787 [ ac_cv_have_intxx_t="no" ]
790 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
791 AC_DEFINE(HAVE_INTXX_T)
795 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
797 [ #include <sys/types.h> ],
798 [ int64_t a; a = 1;],
799 [ ac_cv_have_int64_t="yes" ],
800 [ ac_cv_have_int64_t="no" ]
803 if test "x$ac_cv_have_int64_t" = "xyes" ; then
804 AC_DEFINE(HAVE_INT64_T)
808 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
810 [ #include <sys/types.h> ],
811 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
812 [ ac_cv_have_u_intxx_t="yes" ],
813 [ ac_cv_have_u_intxx_t="no" ]
816 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
817 AC_DEFINE(HAVE_U_INTXX_T)
821 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
823 [ #include <sys/types.h> ],
824 [ u_int64_t a; a = 1;],
825 [ ac_cv_have_u_int64_t="yes" ],
826 [ ac_cv_have_u_int64_t="no" ]
829 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
830 AC_DEFINE(HAVE_U_INT64_T)
834 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
835 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
837 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
840 #include <sys/bitypes.h>
843 int8_t a; int16_t b; int32_t c;
844 u_int8_t e; u_int16_t f; u_int32_t g;
845 a = b = c = e = f = g = 1;
848 AC_DEFINE(HAVE_U_INTXX_T)
849 AC_DEFINE(HAVE_INTXX_T)
856 if test -z "$have_u_intxx_t" ; then
857 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
860 #include <sys/types.h>
862 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
863 [ ac_cv_have_uintxx_t="yes" ],
864 [ ac_cv_have_uintxx_t="no" ]
867 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
868 AC_DEFINE(HAVE_UINTXX_T)
872 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
875 #include <sys/types.h>
876 #include <sys/socket.h>
878 [socklen_t foo; foo = 1235;],
879 [ ac_cv_have_socklen_t="yes" ],
880 [ ac_cv_have_socklen_t="no" ]
883 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
884 AC_DEFINE(HAVE_SOCKLEN_T)
887 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
890 #include <sys/types.h>
892 [ size_t foo; foo = 1235; ],
893 [ ac_cv_have_size_t="yes" ],
894 [ ac_cv_have_size_t="no" ]
897 if test "x$ac_cv_have_size_t" = "xyes" ; then
898 AC_DEFINE(HAVE_SIZE_T)
901 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
904 #include <sys/types.h>
906 [ ssize_t foo; foo = 1235; ],
907 [ ac_cv_have_ssize_t="yes" ],
908 [ ac_cv_have_ssize_t="no" ]
911 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
912 AC_DEFINE(HAVE_SSIZE_T)
915 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
920 [ clock_t foo; foo = 1235; ],
921 [ ac_cv_have_clock_t="yes" ],
922 [ ac_cv_have_clock_t="no" ]
925 if test "x$ac_cv_have_clock_t" = "xyes" ; then
926 AC_DEFINE(HAVE_CLOCK_T)
929 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
932 #include <sys/types.h>
933 #include <sys/socket.h>
935 [ sa_family_t foo; foo = 1235; ],
936 [ ac_cv_have_sa_family_t="yes" ],
939 #include <sys/types.h>
940 #include <sys/socket.h>
941 #include <netinet/in.h>
943 [ sa_family_t foo; foo = 1235; ],
944 [ ac_cv_have_sa_family_t="yes" ],
946 [ ac_cv_have_sa_family_t="no" ]
950 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
951 AC_DEFINE(HAVE_SA_FAMILY_T)
954 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
957 #include <sys/types.h>
959 [ pid_t foo; foo = 1235; ],
960 [ ac_cv_have_pid_t="yes" ],
961 [ ac_cv_have_pid_t="no" ]
964 if test "x$ac_cv_have_pid_t" = "xyes" ; then
965 AC_DEFINE(HAVE_PID_T)
968 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
971 #include <sys/types.h>
973 [ mode_t foo; foo = 1235; ],
974 [ ac_cv_have_mode_t="yes" ],
975 [ ac_cv_have_mode_t="no" ]
978 if test "x$ac_cv_have_mode_t" = "xyes" ; then
979 AC_DEFINE(HAVE_MODE_T)
983 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
986 #include <sys/types.h>
987 #include <sys/socket.h>
989 [ struct sockaddr_storage s; ],
990 [ ac_cv_have_struct_sockaddr_storage="yes" ],
991 [ ac_cv_have_struct_sockaddr_storage="no" ]
994 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
995 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
998 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1001 #include <sys/types.h>
1002 #include <netinet/in.h>
1004 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1005 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1006 [ ac_cv_have_struct_sockaddr_in6="no" ]
1009 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1010 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1013 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1016 #include <sys/types.h>
1017 #include <netinet/in.h>
1019 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1020 [ ac_cv_have_struct_in6_addr="yes" ],
1021 [ ac_cv_have_struct_in6_addr="no" ]
1024 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1025 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1028 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1031 #include <sys/types.h>
1032 #include <sys/socket.h>
1035 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1036 [ ac_cv_have_struct_addrinfo="yes" ],
1037 [ ac_cv_have_struct_addrinfo="no" ]
1040 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1041 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1044 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1046 [ #include <sys/time.h> ],
1047 [ struct timeval tv; tv.tv_sec = 1;],
1048 [ ac_cv_have_struct_timeval="yes" ],
1049 [ ac_cv_have_struct_timeval="no" ]
1052 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1053 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1054 have_struct_timeval=1
1057 # If we don't have int64_t then we can't compile sftp-server. So don't
1058 # even attempt to do it.
1059 if test "x$ac_cv_have_int64_t" = "xno" -a \
1060 "x$ac_cv_sizeof_long_int" != "x8" -a \
1061 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1064 dnl test snprintf (broken on SCO w/gcc)
1069 #ifdef HAVE_SNPRINTF
1073 char expected_out[50];
1075 #if (SIZEOF_LONG_INT == 8)
1076 long int num = 0x7fffffffffffffff;
1078 long long num = 0x7fffffffffffffff;
1080 strcpy(expected_out, "9223372036854775807");
1081 snprintf(buf, mazsize, "%lld", num);
1082 if(strcmp(buf, expected_out) != 0)
1089 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1094 dnl Checks for structure members
1095 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1096 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1097 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1098 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1099 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1100 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1101 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1102 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1103 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1104 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1105 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1106 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1107 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1108 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1109 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1110 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1111 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1112 AC_STRUCT_ST_BLKSIZE
1114 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1115 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1118 #include <sys/types.h>
1119 #include <sys/socket.h>
1121 [ struct sockaddr_un s; s.sun_len = 1; ],
1122 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1123 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1126 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1127 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1130 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1131 ac_cv_have_ss_family_in_struct_ss, [
1134 #include <sys/types.h>
1135 #include <sys/socket.h>
1137 [ struct sockaddr_storage s; s.ss_family = 1; ],
1138 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1139 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1142 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1143 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1146 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1147 ac_cv_have___ss_family_in_struct_ss, [
1150 #include <sys/types.h>
1151 #include <sys/socket.h>
1153 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1154 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1155 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1158 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1159 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1162 AC_CACHE_CHECK([for pw_class field in struct passwd],
1163 ac_cv_have_pw_class_in_struct_passwd, [
1168 [ struct passwd p; p.pw_class = 0; ],
1169 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1170 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1173 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1174 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1178 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1180 [ extern char *__progname; printf("%s", __progname); ],
1181 [ ac_cv_libc_defines___progname="yes" ],
1182 [ ac_cv_libc_defines___progname="no" ]
1185 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1186 AC_DEFINE(HAVE___PROGNAME)
1190 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1192 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1193 [ ac_cv_libc_defines_sys_errlist="yes" ],
1194 [ ac_cv_libc_defines_sys_errlist="no" ]
1197 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1198 AC_DEFINE(HAVE_SYS_ERRLIST)
1202 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1204 [ extern int sys_nerr; printf("%i", sys_nerr);],
1205 [ ac_cv_libc_defines_sys_nerr="yes" ],
1206 [ ac_cv_libc_defines_sys_nerr="no" ]
1209 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1210 AC_DEFINE(HAVE_SYS_NERR)
1214 # Looking for programs, paths and files
1216 [ --with-rsh=PATH Specify path to remote shell program ],
1218 if test "x$withval" != "$no" ; then
1223 AC_PATH_PROG(rsh_path, rsh)
1228 [ --with-xauth=PATH Specify path to xauth program ],
1230 if test "x$withval" != "xno" ; then
1235 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1236 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1237 xauth_path="/usr/openwin/bin/xauth"
1242 if test -z "$xauth_path" ; then
1243 XAUTH_PATH="undefined"
1244 AC_SUBST(XAUTH_PATH)
1246 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1247 XAUTH_PATH=$xauth_path
1248 AC_SUBST(XAUTH_PATH)
1250 if test ! -z "$rsh_path" ; then
1251 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1254 # Check for mail directory (last resort if we cannot get it from headers)
1255 if test ! -z "$MAIL" ; then
1256 maildir=`dirname $MAIL`
1257 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1260 if test -z "$no_dev_ptmx" ; then
1261 AC_CHECK_FILE("/dev/ptmx",
1263 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1268 AC_CHECK_FILE("/dev/ptc",
1270 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1275 # Options from here on. Some of these are preset by platform above
1277 # Check for user-specified random device, otherwise check /dev/urandom
1279 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1281 if test "x$withval" != "xno" ; then
1282 RANDOM_POOL="$withval";
1283 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1287 # Check for random device
1288 AC_CHECK_FILE("/dev/urandom",
1290 RANDOM_POOL="/dev/urandom";
1291 AC_SUBST(RANDOM_POOL)
1292 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1298 # Check for PRNGD/EGD pool file
1299 AC_ARG_WITH(prngd-port,
1300 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1302 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1303 PRNGD_PORT="$withval"
1304 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1309 # Check for PRNGD/EGD pool file
1310 AC_ARG_WITH(prngd-socket,
1311 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1313 if test "x$withval" != "xno" ; then
1314 PRNGD_SOCKET="$withval"
1315 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1319 # Check for existing socket only if we don't have a random device already
1320 if test -z "$RANDOM_POOL" ; then
1321 AC_MSG_CHECKING(for PRNGD/EGD socket)
1322 # Insert other locations here
1323 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1324 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1325 PRNGD_SOCKET="$sock"
1326 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1330 if test ! -z "$PRNGD_SOCKET" ; then
1331 AC_MSG_RESULT($PRNGD_SOCKET)
1333 AC_MSG_RESULT(not found)
1340 # detect pathnames for entropy gathering commands, if we need them
1341 INSTALL_SSH_PRNG_CMDS=""
1343 if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
1344 # Use these commands to collect entropy
1345 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1346 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1347 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1348 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1349 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1350 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1351 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1352 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1353 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1354 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1355 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1356 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1357 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1358 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1360 INSTALL_SSH_PRNG_CMDS="yes"
1362 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1366 [ --with-catman=man|cat Install preformatted manpages[no]],
1369 if test x"$withval" != x"yes" ; then
1375 if test -z "$MANTYPE" ; then
1376 MANTYPE='$(TROFFMAN)'
1384 # Check whether to enable MD5 passwords
1386 AC_ARG_WITH(md5-passwords,
1387 [ --with-md5-passwords Enable use of MD5 passwords],
1389 if test "x$withval" != "xno" ; then
1390 AC_DEFINE(HAVE_MD5_PASSWORDS)
1396 # Whether to disable shadow password support
1398 [ --without-shadow Disable shadow password support],
1400 if test "x$withval" = "xno" ; then
1401 AC_DEFINE(DISABLE_SHADOW)
1407 if test -z "$disable_shadow" ; then
1408 AC_MSG_CHECKING([if the systems has expire shadow information])
1411 #include <sys/types.h>
1414 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1415 [ sp_expire_available=yes ], []
1418 if test "x$sp_expire_available" = "xyes" ; then
1420 AC_DEFINE(HAS_SHADOW_EXPIRE)
1426 # Use ip address instead of hostname in $DISPLAY
1427 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1428 DISPLAY_HACK_MSG="yes"
1429 AC_DEFINE(IPADDR_IN_DISPLAY)
1431 DISPLAY_HACK_MSG="no"
1432 AC_ARG_WITH(ipaddr-display,
1433 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1435 if test "x$withval" != "xno" ; then
1436 AC_DEFINE(IPADDR_IN_DISPLAY)
1437 DISPLAY_HACK_MSG="yes"
1443 # Whether to mess with the default path
1444 SERVER_PATH_MSG="(default)"
1445 AC_ARG_WITH(default-path,
1446 [ --with-default-path=PATH Specify default \$PATH environment for server],
1448 if test "x$withval" != "xno" ; then
1449 user_path="$withval"
1450 SERVER_PATH_MSG="$withval"
1456 /* find out what STDPATH is */
1461 #ifndef _PATH_STDPATH
1462 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1464 #include <sys/types.h>
1465 #include <sys/stat.h>
1467 #define DATA "conftest.stdpath"
1474 fd = fopen(DATA,"w");
1478 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1483 ], [ user_path=`cat conftest.stdpath` ],
1484 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1485 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1487 # make sure $bindir is in USER_PATH so scp will work
1488 t_bindir=`eval echo ${bindir}`
1490 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1493 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1495 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1496 if test $? -ne 0 ; then
1497 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1498 if test $? -ne 0 ; then
1499 user_path=$user_path:$t_bindir
1500 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1505 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1508 # Whether to force IPv4 by default (needed on broken glibc Linux)
1510 AC_ARG_WITH(ipv4-default,
1511 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1513 if test "x$withval" != "xno" ; then
1514 AC_DEFINE(IPV4_DEFAULT)
1520 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1521 IPV4_IN6_HACK_MSG="no"
1523 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1525 if test "x$withval" != "xno" ; then
1527 AC_DEFINE(IPV4_IN_IPV6)
1528 IPV4_IN6_HACK_MSG="yes"
1533 if test "x$inet6_default_4in6" = "xyes"; then
1534 AC_MSG_RESULT([yes (default)])
1535 AC_DEFINE(IPV4_IN_IPV6)
1536 IPV4_IN6_HACK_MSG="yes"
1538 AC_MSG_RESULT([no (default)])
1543 # Whether to enable BSD auth support
1544 AC_ARG_WITH(bsd-auth,
1545 [ --with-bsd-auth Enable BSD auth support],
1547 if test "x$withval" != "xno" ; then
1554 AC_MSG_CHECKING(whether to install ssh as suid root)
1555 AC_ARG_ENABLE(suid-ssh,
1556 [ --enable-suid-ssh Install ssh as suid root (default)
1557 --disable-suid-ssh Install ssh without suid bit],
1558 [ case "$enableval" in
1563 *) AC_MSG_RESULT(yes)
1573 # Where to place sshd.pid
1575 AC_ARG_WITH(pid-dir,
1576 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1578 if test "x$withval" != "xno" ; then
1584 # make sure the directory exists
1585 if test ! -d $piddir ; then
1586 piddir=`eval echo ${sysconfdir}`
1588 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1592 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1595 dnl allow user to disable some login recording features
1596 AC_ARG_ENABLE(lastlog,
1597 [ --disable-lastlog disable use of lastlog even if detected [no]],
1598 [ AC_DEFINE(DISABLE_LASTLOG) ]
1601 [ --disable-utmp disable use of utmp even if detected [no]],
1602 [ AC_DEFINE(DISABLE_UTMP) ]
1604 AC_ARG_ENABLE(utmpx,
1605 [ --disable-utmpx disable use of utmpx even if detected [no]],
1606 [ AC_DEFINE(DISABLE_UTMPX) ]
1609 [ --disable-wtmp disable use of wtmp even if detected [no]],
1610 [ AC_DEFINE(DISABLE_WTMP) ]
1612 AC_ARG_ENABLE(wtmpx,
1613 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1614 [ AC_DEFINE(DISABLE_WTMPX) ]
1616 AC_ARG_ENABLE(libutil,
1617 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1618 [ AC_DEFINE(DISABLE_LOGIN) ]
1620 AC_ARG_ENABLE(pututline,
1621 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1622 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1624 AC_ARG_ENABLE(pututxline,
1625 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1626 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1628 AC_ARG_WITH(lastlog,
1629 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1631 if test "x$withval" = "xno" ; then
1632 AC_DEFINE(DISABLE_LASTLOG)
1634 conf_lastlog_location=$withval
1639 dnl lastlog, [uw]tmpx? detection
1640 dnl NOTE: set the paths in the platform section to avoid the
1641 dnl need for command-line parameters
1642 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1644 dnl lastlog detection
1645 dnl NOTE: the code itself will detect if lastlog is a directory
1646 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1648 #include <sys/types.h>
1650 #ifdef HAVE_LASTLOG_H
1651 # include <lastlog.h>
1657 [ char *lastlog = LASTLOG_FILE; ],
1658 [ AC_MSG_RESULT(yes) ],
1661 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1663 #include <sys/types.h>
1665 #ifdef HAVE_LASTLOG_H
1666 # include <lastlog.h>
1672 [ char *lastlog = _PATH_LASTLOG; ],
1673 [ AC_MSG_RESULT(yes) ],
1676 system_lastlog_path=no
1681 if test -z "$conf_lastlog_location"; then
1682 if test x"$system_lastlog_path" = x"no" ; then
1683 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1684 if (test -d "$f" || test -f "$f") ; then
1685 conf_lastlog_location=$f
1688 if test -z "$conf_lastlog_location"; then
1689 AC_MSG_WARN([** Cannot find lastlog **])
1690 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1695 if test -n "$conf_lastlog_location"; then
1696 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1700 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1702 #include <sys/types.h>
1708 [ char *utmp = UTMP_FILE; ],
1709 [ AC_MSG_RESULT(yes) ],
1711 system_utmp_path=no ]
1713 if test -z "$conf_utmp_location"; then
1714 if test x"$system_utmp_path" = x"no" ; then
1715 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1716 if test -f $f ; then
1717 conf_utmp_location=$f
1720 if test -z "$conf_utmp_location"; then
1721 AC_DEFINE(DISABLE_UTMP)
1725 if test -n "$conf_utmp_location"; then
1726 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1730 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1732 #include <sys/types.h>
1738 [ char *wtmp = WTMP_FILE; ],
1739 [ AC_MSG_RESULT(yes) ],
1741 system_wtmp_path=no ]
1743 if test -z "$conf_wtmp_location"; then
1744 if test x"$system_wtmp_path" = x"no" ; then
1745 for f in /usr/adm/wtmp /var/log/wtmp; do
1746 if test -f $f ; then
1747 conf_wtmp_location=$f
1750 if test -z "$conf_wtmp_location"; then
1751 AC_DEFINE(DISABLE_WTMP)
1755 if test -n "$conf_wtmp_location"; then
1756 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1760 dnl utmpx detection - I don't know any system so perverse as to require
1761 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1763 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1765 #include <sys/types.h>
1774 [ char *utmpx = UTMPX_FILE; ],
1775 [ AC_MSG_RESULT(yes) ],
1777 system_utmpx_path=no ]
1779 if test -z "$conf_utmpx_location"; then
1780 if test x"$system_utmpx_path" = x"no" ; then
1781 AC_DEFINE(DISABLE_UTMPX)
1784 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1788 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1790 #include <sys/types.h>
1799 [ char *wtmpx = WTMPX_FILE; ],
1800 [ AC_MSG_RESULT(yes) ],
1802 system_wtmpx_path=no ]
1804 if test -z "$conf_wtmpx_location"; then
1805 if test x"$system_wtmpx_path" = x"no" ; then
1806 AC_DEFINE(DISABLE_WTMPX)
1809 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1813 # Change default command timeout for builtin PRNG
1815 AC_ARG_WITH(entropy-timeout,
1816 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1818 if test "x$withval" != "xno" ; then
1819 entropy_timeout=$withval
1823 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1826 if test ! -z "$blibpath" ; then
1827 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1828 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1833 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1835 # Print summary of options
1837 if test x$MANTYPE = x'$(CATMAN)' ; then
1842 if test ! -z "$RANDOM_POOL" ; then
1843 RAND_MSG="Device ($RANDOM_POOL)"
1845 if test ! -z "$PRNGD_PORT" ; then
1846 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1847 elif test ! -z "$PRNGD_SOCKET" ; then
1848 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
1850 RAND_MSG="Builtin (timeout $entropy_timeout)"
1855 # Someone please show me a better way :)
1856 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1857 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1858 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1859 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1860 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1861 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1862 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1863 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
1866 echo "OpenSSH configured has been configured with the following options."
1867 echo " User binaries: $B"
1868 echo " System binaries: $C"
1869 echo " Configuration files: $D"
1870 echo " Askpass program: $E"
1871 echo " Manual pages: $F"
1872 echo " PID file: $G"
1873 echo " sshd default user PATH: $H"
1874 echo " Random number collection: $RAND_MSG"
1875 echo " Manpage format: $MAN_MSG"
1876 echo " PAM support: ${PAM_MSG}"
1877 echo " KerberosIV support: $KRB4_MSG"
1878 echo " AFS support: $AFS_MSG"
1879 echo " S/KEY support: $SKEY_MSG"
1880 echo " TCP Wrappers support: $TCPW_MSG"
1881 echo " MD5 password support: $MD5_MSG"
1882 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1883 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1884 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1886 if test ! -z "$bsd_auth"; then
1887 echo " BSD Auth support: yes"
1892 echo " Host: ${host}"
1893 echo " Compiler: ${CC}"
1894 echo " Compiler flags: ${CFLAGS}"
1895 echo "Preprocessor flags: ${CPPFLAGS}"
1896 echo " Linker flags: ${LDFLAGS}"
1897 echo " Libraries: ${LIBS}"
1901 if test "x$PAM_MSG" = "xyes" ; then
1902 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1903 echo "otherwise password authentication may fail. Example PAM control files"
1904 echo "can be found in the contrib/ subdirectory"
1908 if test ! -z "$BUILTIN_RNG" ; then
1909 echo "WARNING: you are using the builtin random number collection service."
1910 echo "Please read WARNING.RNG and request that your OS vendor includes"
1911 echo "/dev/random in future versions of their OS."
1915 if test ! -z "$NO_SFTP"; then
1916 echo "sftp-server will be disabled. Your compiler does not support"
1917 echo "64bit integers."