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 glob.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 for ALTDIRFUNC glob() extension
374 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
375 AC_EGREP_CPP(FOUNDIT,
378 #ifdef GLOB_ALTDIRFUNC
383 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
391 # Check whether user wants Kerberos support
393 AC_ARG_WITH(kerberos4,
394 [ --with-kerberos4=PATH Enable Kerberos 4 support],
396 if test "x$withval" != "xno" ; then
398 if test "x$withval" != "xyes" ; then
399 CPPFLAGS="$CPPFLAGS -I${withval}/include"
400 LDFLAGS="$LDFLAGS -L${withval}/lib"
401 if test ! -z "$need_dash_r" ; then
402 LDFLAGS="$LDFLAGS -R${withval}/lib"
404 if test ! -z "$blibpath" ; then
405 blibpath="$blibpath:${withval}/lib"
408 if test -d /usr/include/kerberosIV ; then
409 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
413 AC_CHECK_HEADERS(krb.h)
414 AC_CHECK_LIB(krb, main)
415 if test "$ac_cv_header_krb_h" != yes; then
416 AC_MSG_WARN([Cannot find krb.h, build may fail])
418 if test "$ac_cv_lib_krb_main" != yes; then
419 AC_MSG_WARN([Cannot find libkrb, build may fail])
423 AC_CHECK_LIB(resolv, dn_expand, , )
431 # Check whether user wants AFS support
434 [ --with-afs=PATH Enable AFS support],
436 if test "x$withval" != "xno" ; then
438 if test "x$withval" != "xyes" ; then
439 CPPFLAGS="$CPPFLAGS -I${withval}/include"
440 LDFLAGS="$LDFLAGS -L${withval}/lib"
443 if test -z "$KRB4" ; then
444 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
448 if test ! -z "$AFS_LIBS" ; then
449 LIBS="$LIBS $AFS_LIBS"
458 # Check whether user wants S/Key support
461 [ --with-skey=PATH Enable S/Key support],
463 if test "x$withval" != "xno" ; then
465 if test "x$withval" != "xyes" ; then
466 CPPFLAGS="$CPPFLAGS -I${withval}/include"
467 LDFLAGS="$LDFLAGS -L${withval}/lib"
474 AC_CHECK_FUNC(skey_keyinfo,
477 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
483 # Check whether user wants TCP wrappers support
485 AC_ARG_WITH(tcp-wrappers,
486 [ --with-tcp-wrappers Enable tcpwrappers support],
488 if test "x$withval" != "xno" ; then
491 AC_MSG_CHECKING(for libwrap)
495 int deny_severity = 0, allow_severity = 0;
504 AC_MSG_ERROR([*** libwrap missing])
511 dnl Checks for library functions.
512 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent glob 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)
513 dnl Checks for time functions
514 AC_CHECK_FUNCS(gettimeofday time)
515 dnl Checks for libutil functions
516 AC_CHECK_HEADERS(libutil.h)
517 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
518 dnl Checks for utmp functions
519 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
520 AC_CHECK_FUNCS(utmpname)
521 dnl Checks for utmpx functions
522 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
523 AC_CHECK_FUNCS(setutxent utmpxname)
525 AC_CHECK_FUNC(getuserattr,
526 [AC_DEFINE(HAVE_GETUSERATTR)],
527 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
531 [AC_DEFINE(HAVE_LOGIN)],
532 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
535 AC_CHECK_FUNC(daemon,
536 [AC_DEFINE(HAVE_DAEMON)],
537 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
540 AC_CHECK_FUNC(getpagesize,
541 [AC_DEFINE(HAVE_GETPAGESIZE)],
542 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
545 # Check for broken snprintf
546 if test "x$ac_cv_func_snprintf" = "xyes" ; then
547 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
551 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
553 [AC_MSG_RESULT(yes)],
556 AC_DEFINE(BROKEN_SNPRINTF)
557 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
567 [ --with-pam Enable PAM support ],
569 if test "x$withval" != "xno" ; then
570 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
571 AC_MSG_ERROR([PAM headers not found])
574 AC_CHECK_LIB(dl, dlopen, , )
575 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
576 AC_CHECK_FUNCS(pam_getenvlist)
586 # Check for older PAM
587 if test "x$PAM_MSG" = "xyes" ; then
588 # Check PAM strerror arguments (old PAM)
589 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
593 #include <security/pam_appl.h>
595 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
598 AC_DEFINE(HAVE_OLD_PAM)
600 PAM_MSG="yes (old library)"
605 # The big search for OpenSSL
607 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
609 if test "x$withval" != "xno" ; then
616 saved_LDFLAGS="$LDFLAGS"
617 saved_CPPFLAGS="$CPPFLAGS"
618 if test "x$prefix" != "xNONE" ; then
619 tryssldir="$tryssldir $prefix"
621 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
622 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
623 CPPFLAGS="$saved_CPPFLAGS"
624 LDFLAGS="$saved_LDFLAGS"
625 LIBS="$saved_LIBS -lcrypto"
627 # Skip directories if they don't exist
628 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
631 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
632 # Try to use $ssldir/lib if it exists, otherwise
634 if test -d "$ssldir/lib" ; then
635 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
636 if test ! -z "$need_dash_r" ; then
637 LDFLAGS="$LDFLAGS -R$ssldir/lib"
640 LDFLAGS="$saved_LDFLAGS -L$ssldir"
641 if test ! -z "$need_dash_r" ; then
642 LDFLAGS="$LDFLAGS -R$ssldir"
645 # Try to use $ssldir/include if it exists, otherwise
647 if test -d "$ssldir/include" ; then
648 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
650 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
654 # Basic test to check for compatible version and correct linking
655 # *does not* test for RSA - that comes later.
659 #include <openssl/rand.h>
663 memset(a, 0, sizeof(a));
664 RAND_add(a, sizeof(a), sizeof(a));
665 return(RAND_status() <= 0);
674 if test ! -z "$found_crypto" ; then
679 if test -z "$found_crypto" ; then
680 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
682 if test -z "$ssldir" ; then
686 ac_cv_openssldir=$ssldir
689 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
690 AC_DEFINE(HAVE_OPENSSL)
691 dnl Need to recover ssldir - test above runs in subshell
692 ssldir=$ac_cv_openssldir
693 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
694 # Try to use $ssldir/lib if it exists, otherwise
696 if test -d "$ssldir/lib" ; then
697 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
698 if test ! -z "$need_dash_r" ; then
699 LDFLAGS="$LDFLAGS -R$ssldir/lib"
702 LDFLAGS="$saved_LDFLAGS -L$ssldir"
703 if test ! -z "$need_dash_r" ; then
704 LDFLAGS="$LDFLAGS -R$ssldir"
707 # Try to use $ssldir/include if it exists, otherwise
709 if test -d "$ssldir/include" ; then
710 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
712 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
716 LIBS="$saved_LIBS -lcrypto"
718 # Now test RSA support
720 AC_MSG_CHECKING([for RSA support])
721 for WANTS_RSAREF in "" 1 ; do
722 if test -z "$WANTS_RSAREF" ; then
725 LIBS="$saved_LIBS -lRSAglue -lrsaref"
729 #include <openssl/rand.h>
730 #include <openssl/rsa.h>
731 #include <openssl/bn.h>
732 #include <openssl/sha.h>
735 int num; RSA *key; static unsigned char p_in[] = "blahblah";
736 unsigned char c[256], p[256];
737 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
738 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
739 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
740 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
749 if test ! -z "$no_rsa" ; then
750 AC_MSG_RESULT(disabled)
753 if test -z "$rsa_works" ; then
754 AC_MSG_WARN([*** No RSA support found *** ])
757 if test -z "$WANTS_RSAREF" ; then
761 RSA_MSG="yes (using RSAref)"
762 AC_MSG_RESULT(using RSAref)
763 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
768 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
769 # version in OpenSSL. Skip this for PAM
770 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
771 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
774 # Cheap hack to ensure NEWS-OS libraries are arranged right.
775 if test ! -z "$SONY" ; then
776 LIBS="$LIBS -liberty";
779 # Checks for data types
780 AC_CHECK_SIZEOF(char, 1)
781 AC_CHECK_SIZEOF(short int, 2)
782 AC_CHECK_SIZEOF(int, 4)
783 AC_CHECK_SIZEOF(long int, 4)
784 AC_CHECK_SIZEOF(long long int, 8)
786 # More checks for data types
787 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
789 [ #include <sys/types.h> ],
791 [ ac_cv_have_u_int="yes" ],
792 [ ac_cv_have_u_int="no" ]
795 if test "x$ac_cv_have_u_int" = "xyes" ; then
796 AC_DEFINE(HAVE_U_INT)
800 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
802 [ #include <sys/types.h> ],
803 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
804 [ ac_cv_have_intxx_t="yes" ],
805 [ ac_cv_have_intxx_t="no" ]
808 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
809 AC_DEFINE(HAVE_INTXX_T)
813 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
815 [ #include <sys/types.h> ],
816 [ int64_t a; a = 1;],
817 [ ac_cv_have_int64_t="yes" ],
818 [ ac_cv_have_int64_t="no" ]
821 if test "x$ac_cv_have_int64_t" = "xyes" ; then
822 AC_DEFINE(HAVE_INT64_T)
826 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
828 [ #include <sys/types.h> ],
829 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
830 [ ac_cv_have_u_intxx_t="yes" ],
831 [ ac_cv_have_u_intxx_t="no" ]
834 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
835 AC_DEFINE(HAVE_U_INTXX_T)
839 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
841 [ #include <sys/types.h> ],
842 [ u_int64_t a; a = 1;],
843 [ ac_cv_have_u_int64_t="yes" ],
844 [ ac_cv_have_u_int64_t="no" ]
847 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
848 AC_DEFINE(HAVE_U_INT64_T)
852 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
853 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
855 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
858 #include <sys/bitypes.h>
861 int8_t a; int16_t b; int32_t c;
862 u_int8_t e; u_int16_t f; u_int32_t g;
863 a = b = c = e = f = g = 1;
866 AC_DEFINE(HAVE_U_INTXX_T)
867 AC_DEFINE(HAVE_INTXX_T)
874 if test -z "$have_u_intxx_t" ; then
875 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
878 #include <sys/types.h>
880 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
881 [ ac_cv_have_uintxx_t="yes" ],
882 [ ac_cv_have_uintxx_t="no" ]
885 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
886 AC_DEFINE(HAVE_UINTXX_T)
890 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
893 #include <sys/types.h>
894 #include <sys/socket.h>
896 [socklen_t foo; foo = 1235;],
897 [ ac_cv_have_socklen_t="yes" ],
898 [ ac_cv_have_socklen_t="no" ]
901 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
902 AC_DEFINE(HAVE_SOCKLEN_T)
905 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
908 #include <sys/types.h>
910 [ size_t foo; foo = 1235; ],
911 [ ac_cv_have_size_t="yes" ],
912 [ ac_cv_have_size_t="no" ]
915 if test "x$ac_cv_have_size_t" = "xyes" ; then
916 AC_DEFINE(HAVE_SIZE_T)
919 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
922 #include <sys/types.h>
924 [ ssize_t foo; foo = 1235; ],
925 [ ac_cv_have_ssize_t="yes" ],
926 [ ac_cv_have_ssize_t="no" ]
929 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
930 AC_DEFINE(HAVE_SSIZE_T)
933 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
938 [ clock_t foo; foo = 1235; ],
939 [ ac_cv_have_clock_t="yes" ],
940 [ ac_cv_have_clock_t="no" ]
943 if test "x$ac_cv_have_clock_t" = "xyes" ; then
944 AC_DEFINE(HAVE_CLOCK_T)
947 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
950 #include <sys/types.h>
951 #include <sys/socket.h>
953 [ sa_family_t foo; foo = 1235; ],
954 [ ac_cv_have_sa_family_t="yes" ],
957 #include <sys/types.h>
958 #include <sys/socket.h>
959 #include <netinet/in.h>
961 [ sa_family_t foo; foo = 1235; ],
962 [ ac_cv_have_sa_family_t="yes" ],
964 [ ac_cv_have_sa_family_t="no" ]
968 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
969 AC_DEFINE(HAVE_SA_FAMILY_T)
972 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
975 #include <sys/types.h>
977 [ pid_t foo; foo = 1235; ],
978 [ ac_cv_have_pid_t="yes" ],
979 [ ac_cv_have_pid_t="no" ]
982 if test "x$ac_cv_have_pid_t" = "xyes" ; then
983 AC_DEFINE(HAVE_PID_T)
986 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
989 #include <sys/types.h>
991 [ mode_t foo; foo = 1235; ],
992 [ ac_cv_have_mode_t="yes" ],
993 [ ac_cv_have_mode_t="no" ]
996 if test "x$ac_cv_have_mode_t" = "xyes" ; then
997 AC_DEFINE(HAVE_MODE_T)
1001 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1004 #include <sys/types.h>
1005 #include <sys/socket.h>
1007 [ struct sockaddr_storage s; ],
1008 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1009 [ ac_cv_have_struct_sockaddr_storage="no" ]
1012 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1013 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1016 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1019 #include <sys/types.h>
1020 #include <netinet/in.h>
1022 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1023 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1024 [ ac_cv_have_struct_sockaddr_in6="no" ]
1027 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1028 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1031 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1034 #include <sys/types.h>
1035 #include <netinet/in.h>
1037 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1038 [ ac_cv_have_struct_in6_addr="yes" ],
1039 [ ac_cv_have_struct_in6_addr="no" ]
1042 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1043 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1046 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1049 #include <sys/types.h>
1050 #include <sys/socket.h>
1053 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1054 [ ac_cv_have_struct_addrinfo="yes" ],
1055 [ ac_cv_have_struct_addrinfo="no" ]
1058 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1059 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1062 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1064 [ #include <sys/time.h> ],
1065 [ struct timeval tv; tv.tv_sec = 1;],
1066 [ ac_cv_have_struct_timeval="yes" ],
1067 [ ac_cv_have_struct_timeval="no" ]
1070 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1071 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1072 have_struct_timeval=1
1075 # If we don't have int64_t then we can't compile sftp-server. So don't
1076 # even attempt to do it.
1077 if test "x$ac_cv_have_int64_t" = "xno" -a \
1078 "x$ac_cv_sizeof_long_int" != "x8" -a \
1079 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1082 dnl test snprintf (broken on SCO w/gcc)
1087 #ifdef HAVE_SNPRINTF
1091 char expected_out[50];
1093 #if (SIZEOF_LONG_INT == 8)
1094 long int num = 0x7fffffffffffffff;
1096 long long num = 0x7fffffffffffffff;
1098 strcpy(expected_out, "9223372036854775807");
1099 snprintf(buf, mazsize, "%lld", num);
1100 if(strcmp(buf, expected_out) != 0)
1107 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1112 dnl Checks for structure members
1113 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1114 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1115 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1116 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1117 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1118 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1119 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1120 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1121 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1122 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1123 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1124 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1125 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1126 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1127 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1128 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1129 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1130 AC_STRUCT_ST_BLKSIZE
1132 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1133 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1136 #include <sys/types.h>
1137 #include <sys/socket.h>
1139 [ struct sockaddr_un s; s.sun_len = 1; ],
1140 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1141 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1144 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1145 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1148 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1149 ac_cv_have_ss_family_in_struct_ss, [
1152 #include <sys/types.h>
1153 #include <sys/socket.h>
1155 [ struct sockaddr_storage s; s.ss_family = 1; ],
1156 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1157 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1160 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1161 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1164 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1165 ac_cv_have___ss_family_in_struct_ss, [
1168 #include <sys/types.h>
1169 #include <sys/socket.h>
1171 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1172 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1173 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1176 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1177 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1180 AC_CACHE_CHECK([for pw_class field in struct passwd],
1181 ac_cv_have_pw_class_in_struct_passwd, [
1186 [ struct passwd p; p.pw_class = 0; ],
1187 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1188 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1191 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1192 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1196 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1198 [ extern char *__progname; printf("%s", __progname); ],
1199 [ ac_cv_libc_defines___progname="yes" ],
1200 [ ac_cv_libc_defines___progname="no" ]
1203 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1204 AC_DEFINE(HAVE___PROGNAME)
1208 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1210 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1211 [ ac_cv_libc_defines_sys_errlist="yes" ],
1212 [ ac_cv_libc_defines_sys_errlist="no" ]
1215 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1216 AC_DEFINE(HAVE_SYS_ERRLIST)
1220 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1222 [ extern int sys_nerr; printf("%i", sys_nerr);],
1223 [ ac_cv_libc_defines_sys_nerr="yes" ],
1224 [ ac_cv_libc_defines_sys_nerr="no" ]
1227 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1228 AC_DEFINE(HAVE_SYS_NERR)
1232 # Looking for programs, paths and files
1234 [ --with-rsh=PATH Specify path to remote shell program ],
1236 if test "x$withval" != "$no" ; then
1241 AC_PATH_PROG(rsh_path, rsh)
1246 [ --with-xauth=PATH Specify path to xauth program ],
1248 if test "x$withval" != "xno" ; then
1253 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1254 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1255 xauth_path="/usr/openwin/bin/xauth"
1260 if test -z "$xauth_path" ; then
1261 XAUTH_PATH="undefined"
1262 AC_SUBST(XAUTH_PATH)
1264 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1265 XAUTH_PATH=$xauth_path
1266 AC_SUBST(XAUTH_PATH)
1268 if test ! -z "$rsh_path" ; then
1269 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1272 # Check for mail directory (last resort if we cannot get it from headers)
1273 if test ! -z "$MAIL" ; then
1274 maildir=`dirname $MAIL`
1275 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1278 if test -z "$no_dev_ptmx" ; then
1279 AC_CHECK_FILE("/dev/ptmx",
1281 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1286 AC_CHECK_FILE("/dev/ptc",
1288 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1293 # Options from here on. Some of these are preset by platform above
1295 # Check for user-specified random device, otherwise check /dev/urandom
1297 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1299 if test "x$withval" != "xno" ; then
1300 RANDOM_POOL="$withval";
1301 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1305 # Check for random device
1306 AC_CHECK_FILE("/dev/urandom",
1308 RANDOM_POOL="/dev/urandom";
1309 AC_SUBST(RANDOM_POOL)
1310 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1316 # Check for PRNGD/EGD pool file
1317 AC_ARG_WITH(prngd-port,
1318 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1320 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1321 PRNGD_PORT="$withval"
1322 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1327 # Check for PRNGD/EGD pool file
1328 AC_ARG_WITH(prngd-socket,
1329 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1331 if test "x$withval" != "xno" ; then
1332 PRNGD_SOCKET="$withval"
1333 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1337 # Check for existing socket only if we don't have a random device already
1338 if test -z "$RANDOM_POOL" ; then
1339 AC_MSG_CHECKING(for PRNGD/EGD socket)
1340 # Insert other locations here
1341 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1342 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1343 PRNGD_SOCKET="$sock"
1344 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1348 if test ! -z "$PRNGD_SOCKET" ; then
1349 AC_MSG_RESULT($PRNGD_SOCKET)
1351 AC_MSG_RESULT(not found)
1358 # detect pathnames for entropy gathering commands, if we need them
1359 INSTALL_SSH_PRNG_CMDS=""
1361 if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
1362 # Use these commands to collect entropy
1363 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1364 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1365 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1366 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1367 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1368 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1369 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1370 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1371 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1372 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1373 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1374 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1375 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1376 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1378 INSTALL_SSH_PRNG_CMDS="yes"
1380 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1384 [ --with-catman=man|cat Install preformatted manpages[no]],
1387 if test x"$withval" != x"yes" ; then
1393 if test -z "$MANTYPE" ; then
1394 MANTYPE='$(TROFFMAN)'
1402 # Check whether to enable MD5 passwords
1404 AC_ARG_WITH(md5-passwords,
1405 [ --with-md5-passwords Enable use of MD5 passwords],
1407 if test "x$withval" != "xno" ; then
1408 AC_DEFINE(HAVE_MD5_PASSWORDS)
1414 # Whether to disable shadow password support
1416 [ --without-shadow Disable shadow password support],
1418 if test "x$withval" = "xno" ; then
1419 AC_DEFINE(DISABLE_SHADOW)
1425 if test -z "$disable_shadow" ; then
1426 AC_MSG_CHECKING([if the systems has expire shadow information])
1429 #include <sys/types.h>
1432 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1433 [ sp_expire_available=yes ], []
1436 if test "x$sp_expire_available" = "xyes" ; then
1438 AC_DEFINE(HAS_SHADOW_EXPIRE)
1444 # Use ip address instead of hostname in $DISPLAY
1445 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1446 DISPLAY_HACK_MSG="yes"
1447 AC_DEFINE(IPADDR_IN_DISPLAY)
1449 DISPLAY_HACK_MSG="no"
1450 AC_ARG_WITH(ipaddr-display,
1451 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1453 if test "x$withval" != "xno" ; then
1454 AC_DEFINE(IPADDR_IN_DISPLAY)
1455 DISPLAY_HACK_MSG="yes"
1461 # Whether to mess with the default path
1462 SERVER_PATH_MSG="(default)"
1463 AC_ARG_WITH(default-path,
1464 [ --with-default-path=PATH Specify default \$PATH environment for server],
1466 if test "x$withval" != "xno" ; then
1467 user_path="$withval"
1468 SERVER_PATH_MSG="$withval"
1474 /* find out what STDPATH is */
1479 #ifndef _PATH_STDPATH
1480 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1482 #include <sys/types.h>
1483 #include <sys/stat.h>
1485 #define DATA "conftest.stdpath"
1492 fd = fopen(DATA,"w");
1496 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1501 ], [ user_path=`cat conftest.stdpath` ],
1502 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1503 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1505 # make sure $bindir is in USER_PATH so scp will work
1506 t_bindir=`eval echo ${bindir}`
1508 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1511 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1513 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1514 if test $? -ne 0 ; then
1515 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1516 if test $? -ne 0 ; then
1517 user_path=$user_path:$t_bindir
1518 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1523 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1526 # Whether to force IPv4 by default (needed on broken glibc Linux)
1528 AC_ARG_WITH(ipv4-default,
1529 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1531 if test "x$withval" != "xno" ; then
1532 AC_DEFINE(IPV4_DEFAULT)
1538 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1539 IPV4_IN6_HACK_MSG="no"
1541 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1543 if test "x$withval" != "xno" ; then
1545 AC_DEFINE(IPV4_IN_IPV6)
1546 IPV4_IN6_HACK_MSG="yes"
1551 if test "x$inet6_default_4in6" = "xyes"; then
1552 AC_MSG_RESULT([yes (default)])
1553 AC_DEFINE(IPV4_IN_IPV6)
1554 IPV4_IN6_HACK_MSG="yes"
1556 AC_MSG_RESULT([no (default)])
1561 # Whether to enable BSD auth support
1562 AC_ARG_WITH(bsd-auth,
1563 [ --with-bsd-auth Enable BSD auth support],
1565 if test "x$withval" != "xno" ; then
1572 AC_MSG_CHECKING(whether to install ssh as suid root)
1573 AC_ARG_ENABLE(suid-ssh,
1574 [ --enable-suid-ssh Install ssh as suid root (default)
1575 --disable-suid-ssh Install ssh without suid bit],
1576 [ case "$enableval" in
1581 *) AC_MSG_RESULT(yes)
1591 # Where to place sshd.pid
1593 AC_ARG_WITH(pid-dir,
1594 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1596 if test "x$withval" != "xno" ; then
1602 # make sure the directory exists
1603 if test ! -d $piddir ; then
1604 piddir=`eval echo ${sysconfdir}`
1606 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1610 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1613 dnl allow user to disable some login recording features
1614 AC_ARG_ENABLE(lastlog,
1615 [ --disable-lastlog disable use of lastlog even if detected [no]],
1616 [ AC_DEFINE(DISABLE_LASTLOG) ]
1619 [ --disable-utmp disable use of utmp even if detected [no]],
1620 [ AC_DEFINE(DISABLE_UTMP) ]
1622 AC_ARG_ENABLE(utmpx,
1623 [ --disable-utmpx disable use of utmpx even if detected [no]],
1624 [ AC_DEFINE(DISABLE_UTMPX) ]
1627 [ --disable-wtmp disable use of wtmp even if detected [no]],
1628 [ AC_DEFINE(DISABLE_WTMP) ]
1630 AC_ARG_ENABLE(wtmpx,
1631 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1632 [ AC_DEFINE(DISABLE_WTMPX) ]
1634 AC_ARG_ENABLE(libutil,
1635 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1636 [ AC_DEFINE(DISABLE_LOGIN) ]
1638 AC_ARG_ENABLE(pututline,
1639 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1640 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1642 AC_ARG_ENABLE(pututxline,
1643 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1644 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1646 AC_ARG_WITH(lastlog,
1647 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1649 if test "x$withval" = "xno" ; then
1650 AC_DEFINE(DISABLE_LASTLOG)
1652 conf_lastlog_location=$withval
1657 dnl lastlog, [uw]tmpx? detection
1658 dnl NOTE: set the paths in the platform section to avoid the
1659 dnl need for command-line parameters
1660 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1662 dnl lastlog detection
1663 dnl NOTE: the code itself will detect if lastlog is a directory
1664 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1666 #include <sys/types.h>
1668 #ifdef HAVE_LASTLOG_H
1669 # include <lastlog.h>
1675 [ char *lastlog = LASTLOG_FILE; ],
1676 [ AC_MSG_RESULT(yes) ],
1679 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1681 #include <sys/types.h>
1683 #ifdef HAVE_LASTLOG_H
1684 # include <lastlog.h>
1690 [ char *lastlog = _PATH_LASTLOG; ],
1691 [ AC_MSG_RESULT(yes) ],
1694 system_lastlog_path=no
1699 if test -z "$conf_lastlog_location"; then
1700 if test x"$system_lastlog_path" = x"no" ; then
1701 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1702 if (test -d "$f" || test -f "$f") ; then
1703 conf_lastlog_location=$f
1706 if test -z "$conf_lastlog_location"; then
1707 AC_MSG_WARN([** Cannot find lastlog **])
1708 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1713 if test -n "$conf_lastlog_location"; then
1714 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1718 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1720 #include <sys/types.h>
1726 [ char *utmp = UTMP_FILE; ],
1727 [ AC_MSG_RESULT(yes) ],
1729 system_utmp_path=no ]
1731 if test -z "$conf_utmp_location"; then
1732 if test x"$system_utmp_path" = x"no" ; then
1733 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1734 if test -f $f ; then
1735 conf_utmp_location=$f
1738 if test -z "$conf_utmp_location"; then
1739 AC_DEFINE(DISABLE_UTMP)
1743 if test -n "$conf_utmp_location"; then
1744 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1748 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1750 #include <sys/types.h>
1756 [ char *wtmp = WTMP_FILE; ],
1757 [ AC_MSG_RESULT(yes) ],
1759 system_wtmp_path=no ]
1761 if test -z "$conf_wtmp_location"; then
1762 if test x"$system_wtmp_path" = x"no" ; then
1763 for f in /usr/adm/wtmp /var/log/wtmp; do
1764 if test -f $f ; then
1765 conf_wtmp_location=$f
1768 if test -z "$conf_wtmp_location"; then
1769 AC_DEFINE(DISABLE_WTMP)
1773 if test -n "$conf_wtmp_location"; then
1774 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1778 dnl utmpx detection - I don't know any system so perverse as to require
1779 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1781 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1783 #include <sys/types.h>
1792 [ char *utmpx = UTMPX_FILE; ],
1793 [ AC_MSG_RESULT(yes) ],
1795 system_utmpx_path=no ]
1797 if test -z "$conf_utmpx_location"; then
1798 if test x"$system_utmpx_path" = x"no" ; then
1799 AC_DEFINE(DISABLE_UTMPX)
1802 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1806 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1808 #include <sys/types.h>
1817 [ char *wtmpx = WTMPX_FILE; ],
1818 [ AC_MSG_RESULT(yes) ],
1820 system_wtmpx_path=no ]
1822 if test -z "$conf_wtmpx_location"; then
1823 if test x"$system_wtmpx_path" = x"no" ; then
1824 AC_DEFINE(DISABLE_WTMPX)
1827 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1831 # Change default command timeout for builtin PRNG
1833 AC_ARG_WITH(entropy-timeout,
1834 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1836 if test "x$withval" != "xno" ; then
1837 entropy_timeout=$withval
1841 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1844 if test ! -z "$blibpath" ; then
1845 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1846 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1851 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1853 # Print summary of options
1855 if test x$MANTYPE = x'$(CATMAN)' ; then
1860 if test ! -z "$RANDOM_POOL" ; then
1861 RAND_MSG="Device ($RANDOM_POOL)"
1863 if test ! -z "$PRNGD_PORT" ; then
1864 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1865 elif test ! -z "$PRNGD_SOCKET" ; then
1866 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
1868 RAND_MSG="Builtin (timeout $entropy_timeout)"
1873 # Someone please show me a better way :)
1874 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1875 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1876 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1877 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1878 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1879 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1880 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1881 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
1884 echo "OpenSSH configured has been configured with the following options."
1885 echo " User binaries: $B"
1886 echo " System binaries: $C"
1887 echo " Configuration files: $D"
1888 echo " Askpass program: $E"
1889 echo " Manual pages: $F"
1890 echo " PID file: $G"
1891 echo " sshd default user PATH: $H"
1892 echo " Random number collection: $RAND_MSG"
1893 echo " Manpage format: $MAN_MSG"
1894 echo " PAM support: ${PAM_MSG}"
1895 echo " KerberosIV support: $KRB4_MSG"
1896 echo " AFS support: $AFS_MSG"
1897 echo " S/KEY support: $SKEY_MSG"
1898 echo " TCP Wrappers support: $TCPW_MSG"
1899 echo " MD5 password support: $MD5_MSG"
1900 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1901 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1902 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1904 if test ! -z "$bsd_auth"; then
1905 echo " BSD Auth support: yes"
1910 echo " Host: ${host}"
1911 echo " Compiler: ${CC}"
1912 echo " Compiler flags: ${CFLAGS}"
1913 echo "Preprocessor flags: ${CPPFLAGS}"
1914 echo " Linker flags: ${LDFLAGS}"
1915 echo " Libraries: ${LIBS}"
1919 if test "x$PAM_MSG" = "xyes" ; then
1920 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1921 echo "otherwise password authentication may fail. Example PAM control files"
1922 echo "can be found in the contrib/ subdirectory"
1926 if test ! -z "$BUILTIN_RNG" ; then
1927 echo "WARNING: you are using the builtin random number collection service."
1928 echo "Please read WARNING.RNG and request that your OS vendor includes"
1929 echo "/dev/random in future versions of their OS."
1933 if test ! -z "$NO_SFTP"; then
1934 echo "sftp-server will be disabled. Your compiler does not support"
1935 echo "64bit integers."