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(NO_X11_UNIX_SOCKETS)
79 AC_DEFINE(IP_TOS_IS_BROKEN)
82 if test -z "$GCC"; then
85 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
88 AC_DEFINE(DISABLE_SHADOW)
89 AC_DEFINE(DISABLE_UTMP)
90 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
96 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
98 AC_DEFINE(PAM_SUN_CODEBASE)
100 AC_DEFINE(DISABLE_SHADOW)
101 AC_DEFINE(DISABLE_UTMP)
102 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
108 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
110 PATH="$PATH:/usr/etc"
114 AC_DEFINE(BROKEN_INET_NTOA)
117 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
119 PATH="$PATH:/usr/etc"
121 AC_DEFINE(WITH_IRIX_ARRAY)
122 AC_DEFINE(WITH_IRIX_PROJECT)
123 AC_DEFINE(WITH_IRIX_AUDIT)
124 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
127 AC_DEFINE(BROKEN_INET_NTOA)
132 check_for_libcrypt_later=1
133 AC_DEFINE(DONT_TRY_OTHER_AF)
134 AC_DEFINE(PAM_TTY_KLUDGE)
135 inet6_default_4in6=yes
137 mips-sony-bsd|mips-sony-newsos4)
138 AC_DEFINE(HAVE_NEWS4)
140 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
141 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
148 check_for_libcrypt_later=1
151 conf_lastlog_location="/usr/adm/lastlog"
152 conf_utmp_location=/etc/utmp
153 conf_wtmp_location=/usr/adm/wtmp
156 AC_DEFINE(BROKEN_REALPATH)
158 AC_DEFINE(BROKEN_SAVED_UIDS)
159 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
163 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
164 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
166 AC_DEFINE(PAM_SUN_CODEBASE)
167 # hardwire lastlog location (can't detect it on some versions)
168 conf_lastlog_location="/var/adm/lastlog"
169 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
170 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
171 if test "$sol2ver" -ge 8; then
173 AC_DEFINE(DISABLE_UTMP)
174 AC_DEFINE(DISABLE_WTMP)
180 CPPFLAGS="$CPPFLAGS -DSUNOS4"
181 AC_CHECK_FUNCS(getpwanam)
182 AC_DEFINE(PAM_SUN_CODEBASE)
183 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
184 conf_utmp_location=/etc/utmp
185 conf_wtmp_location=/var/adm/wtmp
186 conf_lastlog_location=/var/adm/lastlog
192 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
193 LDFLAGS="$LDFLAGS -L/usr/local/lib"
196 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
199 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
200 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
202 IPADDR_IN_DISPLAY=yes
204 AC_DEFINE(IP_TOS_IS_BROKEN)
205 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
207 LIBS="$LIBS -lgen -lnsl -lucb"
210 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
211 LDFLAGS="$LDFLAGS -L/usr/local/lib"
218 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
219 LDFLAGS="$LDFLAGS -L/usr/local/lib"
226 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
227 LDFLAGS="$LDFLAGS -L/usr/local/lib"
230 LIBS="$LIBS -lgen -lsocket"
233 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
234 LDFLAGS="$LDFLAGS -L/usr/local/lib"
236 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
238 rsh_path="/usr/bin/rcmd"
241 AC_DEFINE(BROKEN_SYS_TERMIO_H)
243 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
244 AC_DEFINE(DISABLE_SHADOW)
245 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
246 AC_DEFINE(BROKEN_SAVED_UIDS)
247 AC_CHECK_FUNCS(getluid setluid)
250 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
251 LDFLAGS="$LDFLAGS -L/usr/local/lib"
252 LIBS="$LIBS -lprot -lx -ltinfo -lm"
256 rsh_path="/usr/bin/rcmd"
258 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
259 AC_DEFINE(DISABLE_SHADOW)
260 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
261 AC_CHECK_FUNCS(getluid setluid)
264 if test ! -z "USE_SIA" ; then
265 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
266 if test -f /etc/sia/matrix.conf; then
268 AC_DEFINE(HAVE_OSF_SIA)
269 AC_DEFINE(DISABLE_LOGIN)
270 LIBS="$LIBS -lsecurity -ldb -lm -laud"
278 # Allow user to specify flags
280 [ --with-cflags Specify additional flags to pass to compiler],
282 if test "x$withval" != "xno" ; then
283 CFLAGS="$CFLAGS $withval"
287 AC_ARG_WITH(cppflags,
288 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
290 if test "x$withval" != "xno"; then
291 CPPFLAGS="$CPPFLAGS $withval"
296 [ --with-ldflags Specify additional flags to pass to linker],
298 if test "x$withval" != "xno" ; then
299 LDFLAGS="$LDFLAGS $withval"
304 [ --with-libs Specify additional libraries to link with],
306 if test "x$withval" != "xno" ; then
307 LIBS="$LIBS $withval"
313 [ --with-pcre Override built in regex library with pcre],
316 AC_CHECK_LIB(pcre, pcre_info,
318 AC_DEFINE(HAVE_LIBPCRE)
319 LIBS="$LIBS -lpcreposix -lpcre"
322 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
327 # Checks for libraries.
328 if test -z "$no_libnsl" ; then
329 AC_CHECK_LIB(nsl, yp_match, , )
331 if test -z "$no_libsocket" ; then
332 AC_CHECK_LIB(socket, main, , )
335 dnl SCO OS3 needs this for libwrap
336 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
338 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
339 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
340 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
342 # We don't want to check if we did an pcre override.
343 if test -z "$no_comp_check" ; then
344 AC_CHECK_FUNC(regcomp,
345 [ AC_DEFINE(HAVE_REGCOMP)],
347 AC_CHECK_LIB(pcre, pcre_info,
349 AC_DEFINE(HAVE_LIBPCRE)
350 LIBS="$LIBS -lpcreposix -lpcre"
353 AC_MSG_ERROR([*** No regex library found.])
360 AC_CHECK_FUNC(strcasecmp,
361 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
363 AC_CHECK_FUNC(utimes,
364 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
369 # Checks for header files.
370 AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h 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)
372 # Check for ALTDIRFUNC glob() extension
373 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
374 AC_EGREP_CPP(FOUNDIT,
377 #ifdef GLOB_ALTDIRFUNC
382 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
390 # Check for g.gl_matchc glob() extension
391 AC_MSG_CHECKING(for gl_matchc field in glob_t)
392 AC_EGREP_CPP(FOUNDIT,
395 int main(void){glob_t g; g.gl_matchc = 1;}
398 AC_DEFINE(GLOB_HAS_GL_MATCHC)
406 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
409 #include <sys/types.h>
411 int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
413 [AC_MSG_RESULT(yes)],
416 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
420 # Check whether user wants S/Key support
423 [ --with-skey=PATH Enable S/Key support],
425 if test "x$withval" != "xno" ; then
427 if test "x$withval" != "xyes" ; then
428 CPPFLAGS="$CPPFLAGS -I${withval}/include"
429 LDFLAGS="$LDFLAGS -L${withval}/lib"
436 AC_CHECK_FUNC(skey_keyinfo,
439 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
445 # Check whether user wants TCP wrappers support
447 AC_ARG_WITH(tcp-wrappers,
448 [ --with-tcp-wrappers Enable tcpwrappers support],
450 if test "x$withval" != "xno" ; then
453 AC_MSG_CHECKING(for libwrap)
457 int deny_severity = 0, allow_severity = 0;
466 AC_MSG_ERROR([*** libwrap missing])
473 dnl Checks for library functions.
474 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent getusershell glob inet_aton inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv setegid seteuid setlogin setproctitle setresgid setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
475 dnl Checks for time functions
476 AC_CHECK_FUNCS(gettimeofday time)
477 dnl Checks for libutil functions
478 AC_CHECK_HEADERS(libutil.h)
479 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
480 dnl Checks for utmp functions
481 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
482 AC_CHECK_FUNCS(utmpname)
483 dnl Checks for utmpx functions
484 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
485 AC_CHECK_FUNCS(setutxent utmpxname)
487 AC_CHECK_FUNC(getuserattr,
488 [AC_DEFINE(HAVE_GETUSERATTR)],
489 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
493 [AC_DEFINE(HAVE_LOGIN)],
494 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
497 AC_CHECK_FUNC(daemon,
498 [AC_DEFINE(HAVE_DAEMON)],
499 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
502 AC_CHECK_FUNC(getpagesize,
503 [AC_DEFINE(HAVE_GETPAGESIZE)],
504 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
507 # Check for broken snprintf
508 if test "x$ac_cv_func_snprintf" = "xyes" ; then
509 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
513 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
515 [AC_MSG_RESULT(yes)],
518 AC_DEFINE(BROKEN_SNPRINTF)
519 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
529 [ --with-pam Enable PAM support ],
531 if test "x$withval" != "xno" ; then
532 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
533 AC_MSG_ERROR([PAM headers not found])
536 AC_CHECK_LIB(dl, dlopen, , )
537 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
538 AC_CHECK_FUNCS(pam_getenvlist)
548 # Check for older PAM
549 if test "x$PAM_MSG" = "xyes" ; then
550 # Check PAM strerror arguments (old PAM)
551 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
555 #include <security/pam_appl.h>
557 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
560 AC_DEFINE(HAVE_OLD_PAM)
562 PAM_MSG="yes (old library)"
567 # The big search for OpenSSL
569 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
571 if test "x$withval" != "xno" ; then
578 saved_LDFLAGS="$LDFLAGS"
579 saved_CPPFLAGS="$CPPFLAGS"
580 if test "x$prefix" != "xNONE" ; then
581 tryssldir="$tryssldir $prefix"
583 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
584 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
585 CPPFLAGS="$saved_CPPFLAGS"
586 LDFLAGS="$saved_LDFLAGS"
587 LIBS="$saved_LIBS -lcrypto"
589 # Skip directories if they don't exist
590 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
593 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
594 # Try to use $ssldir/lib if it exists, otherwise
596 if test -d "$ssldir/lib" ; then
597 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
598 if test ! -z "$need_dash_r" ; then
599 LDFLAGS="-R$ssldir/lib $LDFLAGS"
602 LDFLAGS="-L$ssldir $saved_LDFLAGS"
603 if test ! -z "$need_dash_r" ; then
604 LDFLAGS="-R$ssldir $LDFLAGS"
607 # Try to use $ssldir/include if it exists, otherwise
609 if test -d "$ssldir/include" ; then
610 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
612 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
616 # Basic test to check for compatible version and correct linking
617 # *does not* test for RSA - that comes later.
621 #include <openssl/rand.h>
625 memset(a, 0, sizeof(a));
626 RAND_add(a, sizeof(a), sizeof(a));
627 return(RAND_status() <= 0);
636 if test ! -z "$found_crypto" ; then
641 if test -z "$found_crypto" ; then
642 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
644 if test -z "$ssldir" ; then
648 ac_cv_openssldir=$ssldir
651 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
652 AC_DEFINE(HAVE_OPENSSL)
653 dnl Need to recover ssldir - test above runs in subshell
654 ssldir=$ac_cv_openssldir
655 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
656 # Try to use $ssldir/lib if it exists, otherwise
658 if test -d "$ssldir/lib" ; then
659 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
660 if test ! -z "$need_dash_r" ; then
661 LDFLAGS="-R$ssldir/lib $LDFLAGS"
664 LDFLAGS="-L$ssldir $saved_LDFLAGS"
665 if test ! -z "$need_dash_r" ; then
666 LDFLAGS="-R$ssldir $LDFLAGS"
669 # Try to use $ssldir/include if it exists, otherwise
671 if test -d "$ssldir/include" ; then
672 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
674 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
678 LIBS="$saved_LIBS -lcrypto"
680 # Now test RSA support
682 AC_MSG_CHECKING([for RSA support])
683 for WANTS_RSAREF in "" 1 ; do
684 if test -z "$WANTS_RSAREF" ; then
687 LIBS="$saved_LIBS -lRSAglue -lrsaref"
691 #include <openssl/rand.h>
692 #include <openssl/rsa.h>
693 #include <openssl/bn.h>
694 #include <openssl/sha.h>
697 int num; RSA *key; static unsigned char p_in[] = "blahblah";
698 unsigned char c[256], p[256];
699 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
700 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
701 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
702 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
711 if test ! -z "$no_rsa" ; then
712 AC_MSG_RESULT(disabled)
715 if test -z "$rsa_works" ; then
716 AC_MSG_WARN([*** No RSA support found *** ])
719 if test -z "$WANTS_RSAREF" ; then
723 RSA_MSG="yes (using RSAref)"
724 AC_MSG_RESULT(using RSAref)
725 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
730 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
731 # version in OpenSSL. Skip this for PAM
732 if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
733 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
736 # Cheap hack to ensure NEWS-OS libraries are arranged right.
737 if test ! -z "$SONY" ; then
738 LIBS="$LIBS -liberty";
741 # Checks for data types
742 AC_CHECK_SIZEOF(char, 1)
743 AC_CHECK_SIZEOF(short int, 2)
744 AC_CHECK_SIZEOF(int, 4)
745 AC_CHECK_SIZEOF(long int, 4)
746 AC_CHECK_SIZEOF(long long int, 8)
748 # More checks for data types
749 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
751 [ #include <sys/types.h> ],
753 [ ac_cv_have_u_int="yes" ],
754 [ ac_cv_have_u_int="no" ]
757 if test "x$ac_cv_have_u_int" = "xyes" ; then
758 AC_DEFINE(HAVE_U_INT)
762 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
764 [ #include <sys/types.h> ],
765 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
766 [ ac_cv_have_intxx_t="yes" ],
767 [ ac_cv_have_intxx_t="no" ]
770 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
771 AC_DEFINE(HAVE_INTXX_T)
775 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
777 [ #include <sys/types.h> ],
778 [ int64_t a; a = 1;],
779 [ ac_cv_have_int64_t="yes" ],
780 [ ac_cv_have_int64_t="no" ]
783 if test "x$ac_cv_have_int64_t" = "xyes" ; then
784 AC_DEFINE(HAVE_INT64_T)
788 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
790 [ #include <sys/types.h> ],
791 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
792 [ ac_cv_have_u_intxx_t="yes" ],
793 [ ac_cv_have_u_intxx_t="no" ]
796 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
797 AC_DEFINE(HAVE_U_INTXX_T)
801 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
803 [ #include <sys/types.h> ],
804 [ u_int64_t a; a = 1;],
805 [ ac_cv_have_u_int64_t="yes" ],
806 [ ac_cv_have_u_int64_t="no" ]
809 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
810 AC_DEFINE(HAVE_U_INT64_T)
814 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
815 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
817 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
820 #include <sys/bitypes.h>
823 int8_t a; int16_t b; int32_t c;
824 u_int8_t e; u_int16_t f; u_int32_t g;
825 a = b = c = e = f = g = 1;
828 AC_DEFINE(HAVE_U_INTXX_T)
829 AC_DEFINE(HAVE_INTXX_T)
836 if test -z "$have_u_intxx_t" ; then
837 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
840 #include <sys/types.h>
842 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
843 [ ac_cv_have_uintxx_t="yes" ],
844 [ ac_cv_have_uintxx_t="no" ]
847 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
848 AC_DEFINE(HAVE_UINTXX_T)
852 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
855 #include <sys/types.h>
856 #include <sys/socket.h>
858 [socklen_t foo; foo = 1235;],
859 [ ac_cv_have_socklen_t="yes" ],
860 [ ac_cv_have_socklen_t="no" ]
863 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
864 AC_DEFINE(HAVE_SOCKLEN_T)
867 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
870 #include <sys/types.h>
872 [ size_t foo; foo = 1235; ],
873 [ ac_cv_have_size_t="yes" ],
874 [ ac_cv_have_size_t="no" ]
877 if test "x$ac_cv_have_size_t" = "xyes" ; then
878 AC_DEFINE(HAVE_SIZE_T)
881 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
884 #include <sys/types.h>
886 [ ssize_t foo; foo = 1235; ],
887 [ ac_cv_have_ssize_t="yes" ],
888 [ ac_cv_have_ssize_t="no" ]
891 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
892 AC_DEFINE(HAVE_SSIZE_T)
895 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
900 [ clock_t foo; foo = 1235; ],
901 [ ac_cv_have_clock_t="yes" ],
902 [ ac_cv_have_clock_t="no" ]
905 if test "x$ac_cv_have_clock_t" = "xyes" ; then
906 AC_DEFINE(HAVE_CLOCK_T)
909 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
912 #include <sys/types.h>
913 #include <sys/socket.h>
915 [ sa_family_t foo; foo = 1235; ],
916 [ ac_cv_have_sa_family_t="yes" ],
919 #include <sys/types.h>
920 #include <sys/socket.h>
921 #include <netinet/in.h>
923 [ sa_family_t foo; foo = 1235; ],
924 [ ac_cv_have_sa_family_t="yes" ],
926 [ ac_cv_have_sa_family_t="no" ]
930 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
931 AC_DEFINE(HAVE_SA_FAMILY_T)
934 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
937 #include <sys/types.h>
939 [ pid_t foo; foo = 1235; ],
940 [ ac_cv_have_pid_t="yes" ],
941 [ ac_cv_have_pid_t="no" ]
944 if test "x$ac_cv_have_pid_t" = "xyes" ; then
945 AC_DEFINE(HAVE_PID_T)
948 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
951 #include <sys/types.h>
953 [ mode_t foo; foo = 1235; ],
954 [ ac_cv_have_mode_t="yes" ],
955 [ ac_cv_have_mode_t="no" ]
958 if test "x$ac_cv_have_mode_t" = "xyes" ; then
959 AC_DEFINE(HAVE_MODE_T)
963 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
966 #include <sys/types.h>
967 #include <sys/socket.h>
969 [ struct sockaddr_storage s; ],
970 [ ac_cv_have_struct_sockaddr_storage="yes" ],
971 [ ac_cv_have_struct_sockaddr_storage="no" ]
974 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
975 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
978 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
981 #include <sys/types.h>
982 #include <netinet/in.h>
984 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
985 [ ac_cv_have_struct_sockaddr_in6="yes" ],
986 [ ac_cv_have_struct_sockaddr_in6="no" ]
989 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
990 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
993 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
996 #include <sys/types.h>
997 #include <netinet/in.h>
999 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1000 [ ac_cv_have_struct_in6_addr="yes" ],
1001 [ ac_cv_have_struct_in6_addr="no" ]
1004 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1005 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1008 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1011 #include <sys/types.h>
1012 #include <sys/socket.h>
1015 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1016 [ ac_cv_have_struct_addrinfo="yes" ],
1017 [ ac_cv_have_struct_addrinfo="no" ]
1020 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1021 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1024 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1026 [ #include <sys/time.h> ],
1027 [ struct timeval tv; tv.tv_sec = 1;],
1028 [ ac_cv_have_struct_timeval="yes" ],
1029 [ ac_cv_have_struct_timeval="no" ]
1032 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1033 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1034 have_struct_timeval=1
1037 # If we don't have int64_t then we can't compile sftp-server. So don't
1038 # even attempt to do it.
1039 if test "x$ac_cv_have_int64_t" = "xno" -a \
1040 "x$ac_cv_sizeof_long_int" != "x8" -a \
1041 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1044 dnl test snprintf (broken on SCO w/gcc)
1049 #ifdef HAVE_SNPRINTF
1053 char expected_out[50];
1055 #if (SIZEOF_LONG_INT == 8)
1056 long int num = 0x7fffffffffffffff;
1058 long long num = 0x7fffffffffffffff;
1060 strcpy(expected_out, "9223372036854775807");
1061 snprintf(buf, mazsize, "%lld", num);
1062 if(strcmp(buf, expected_out) != 0)
1069 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1074 dnl Checks for structure members
1075 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1076 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1077 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1078 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1079 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1080 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1081 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1082 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1083 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1084 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1085 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1086 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1087 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1088 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1089 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1090 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1091 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1092 AC_STRUCT_ST_BLKSIZE
1094 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1095 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1098 #include <sys/types.h>
1099 #include <sys/socket.h>
1101 [ struct sockaddr_un s; s.sun_len = 1; ],
1102 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1103 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1106 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1107 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1110 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1111 ac_cv_have_ss_family_in_struct_ss, [
1114 #include <sys/types.h>
1115 #include <sys/socket.h>
1117 [ struct sockaddr_storage s; s.ss_family = 1; ],
1118 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1119 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1122 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1123 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1126 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1127 ac_cv_have___ss_family_in_struct_ss, [
1130 #include <sys/types.h>
1131 #include <sys/socket.h>
1133 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1134 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1135 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1138 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1139 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1142 AC_CACHE_CHECK([for pw_class field in struct passwd],
1143 ac_cv_have_pw_class_in_struct_passwd, [
1148 [ struct passwd p; p.pw_class = 0; ],
1149 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1150 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1153 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1154 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1158 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1160 [ extern char *__progname; printf("%s", __progname); ],
1161 [ ac_cv_libc_defines___progname="yes" ],
1162 [ ac_cv_libc_defines___progname="no" ]
1165 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1166 AC_DEFINE(HAVE___PROGNAME)
1170 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1172 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1173 [ ac_cv_libc_defines_sys_errlist="yes" ],
1174 [ ac_cv_libc_defines_sys_errlist="no" ]
1177 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1178 AC_DEFINE(HAVE_SYS_ERRLIST)
1182 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1184 [ extern int sys_nerr; printf("%i", sys_nerr);],
1185 [ ac_cv_libc_defines_sys_nerr="yes" ],
1186 [ ac_cv_libc_defines_sys_nerr="no" ]
1189 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1190 AC_DEFINE(HAVE_SYS_NERR)
1194 # Check whether user wants Kerberos support
1196 AC_ARG_WITH(kerberos4,
1197 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1199 if test "x$withval" != "xno" ; then
1201 if test "x$withval" != "xyes" ; then
1202 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1203 LDFLAGS="$LDFLAGS -L${withval}/lib"
1204 if test ! -z "$need_dash_r" ; then
1205 LDFLAGS="$LDFLAGS -R${withval}/lib"
1207 if test ! -z "$blibpath" ; then
1208 blibpath="$blibpath:${withval}/lib"
1211 if test -d /usr/include/kerberosIV ; then
1212 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1216 AC_CHECK_HEADERS(krb.h)
1217 if test "$ac_cv_header_krb_h" != yes; then
1218 AC_MSG_WARN([Cannot find krb.h, build may fail])
1220 AC_CHECK_LIB(krb, main)
1221 if test "$ac_cv_lib_krb_main" != yes; then
1222 AC_CHECK_LIB(krb4, main)
1223 if test "$ac_cv_lib_krb4_main" != yes; then
1224 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1231 AC_CHECK_LIB(des, des_cbc_encrypt)
1232 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1233 AC_CHECK_LIB(des425, des_cbc_encrypt)
1234 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1235 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1242 AC_CHECK_LIB(resolv, dn_expand, , )
1250 # Check whether user wants AFS support
1253 [ --with-afs=PATH Enable AFS support],
1255 if test "x$withval" != "xno" ; then
1257 if test "x$withval" != "xyes" ; then
1258 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1259 LDFLAGS="$LDFLAGS -L${withval}/lib"
1262 if test -z "$KRB4" ; then
1263 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1267 if test ! -z "$AFS_LIBS" ; then
1268 LIBS="$LIBS $AFS_LIBS"
1277 # Looking for programs, paths and files
1279 [ --with-rsh=PATH Specify path to remote shell program ],
1281 if test "x$withval" != "$no" ; then
1286 AC_PATH_PROG(rsh_path, rsh)
1291 [ --with-xauth=PATH Specify path to xauth program ],
1293 if test "x$withval" != "xno" ; then
1298 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
1299 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1300 xauth_path="/usr/openwin/bin/xauth"
1305 if test -z "$xauth_path" ; then
1306 XAUTH_PATH="undefined"
1307 AC_SUBST(XAUTH_PATH)
1309 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
1310 XAUTH_PATH=$xauth_path
1311 AC_SUBST(XAUTH_PATH)
1313 if test ! -z "$rsh_path" ; then
1314 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1317 # Check for mail directory (last resort if we cannot get it from headers)
1318 if test ! -z "$MAIL" ; then
1319 maildir=`dirname $MAIL`
1320 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1323 if test -z "$no_dev_ptmx" ; then
1324 AC_CHECK_FILE("/dev/ptmx",
1326 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1331 AC_CHECK_FILE("/dev/ptc",
1333 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1338 # Options from here on. Some of these are preset by platform above
1340 # Check for user-specified random device, otherwise check /dev/urandom
1342 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
1344 if test "x$withval" != "xno" ; then
1345 RANDOM_POOL="$withval";
1346 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1350 # Check for random device
1351 AC_CHECK_FILE("/dev/urandom",
1353 RANDOM_POOL="/dev/urandom";
1354 AC_SUBST(RANDOM_POOL)
1355 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1361 # Check for PRNGD/EGD pool file
1362 AC_ARG_WITH(prngd-port,
1363 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1365 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1366 PRNGD_PORT="$withval"
1367 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1372 # Check for PRNGD/EGD pool file
1373 AC_ARG_WITH(prngd-socket,
1374 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1376 if test "x$withval" != "xno" ; then
1377 PRNGD_SOCKET="$withval"
1378 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1382 # Check for existing socket only if we don't have a random device already
1383 if test -z "$RANDOM_POOL" ; then
1384 AC_MSG_CHECKING(for PRNGD/EGD socket)
1385 # Insert other locations here
1386 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1387 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1388 PRNGD_SOCKET="$sock"
1389 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1393 if test ! -z "$PRNGD_SOCKET" ; then
1394 AC_MSG_RESULT($PRNGD_SOCKET)
1396 AC_MSG_RESULT(not found)
1403 # detect pathnames for entropy gathering commands, if we need them
1404 INSTALL_SSH_PRNG_CMDS=""
1406 if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
1407 # Use these commands to collect entropy
1408 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1409 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1410 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1411 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1412 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1413 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1414 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1415 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1416 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1417 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1418 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1419 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1420 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1421 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1423 INSTALL_SSH_PRNG_CMDS="yes"
1425 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1429 [ --with-catman=man|cat Install preformatted manpages[no]],
1432 if test x"$withval" != x"yes" ; then
1438 if test -z "$MANTYPE" ; then
1439 MANTYPE='$(TROFFMAN)'
1447 # Check whether to enable MD5 passwords
1449 AC_ARG_WITH(md5-passwords,
1450 [ --with-md5-passwords Enable use of MD5 passwords],
1452 if test "x$withval" != "xno" ; then
1453 AC_DEFINE(HAVE_MD5_PASSWORDS)
1459 # Whether to disable shadow password support
1461 [ --without-shadow Disable shadow password support],
1463 if test "x$withval" = "xno" ; then
1464 AC_DEFINE(DISABLE_SHADOW)
1470 if test -z "$disable_shadow" ; then
1471 AC_MSG_CHECKING([if the systems has expire shadow information])
1474 #include <sys/types.h>
1477 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1478 [ sp_expire_available=yes ], []
1481 if test "x$sp_expire_available" = "xyes" ; then
1483 AC_DEFINE(HAS_SHADOW_EXPIRE)
1489 # Use ip address instead of hostname in $DISPLAY
1490 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1491 DISPLAY_HACK_MSG="yes"
1492 AC_DEFINE(IPADDR_IN_DISPLAY)
1494 DISPLAY_HACK_MSG="no"
1495 AC_ARG_WITH(ipaddr-display,
1496 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1498 if test "x$withval" != "xno" ; then
1499 AC_DEFINE(IPADDR_IN_DISPLAY)
1500 DISPLAY_HACK_MSG="yes"
1506 # Whether to mess with the default path
1507 SERVER_PATH_MSG="(default)"
1508 AC_ARG_WITH(default-path,
1509 [ --with-default-path=PATH Specify default \$PATH environment for server],
1511 if test "x$withval" != "xno" ; then
1512 user_path="$withval"
1513 SERVER_PATH_MSG="$withval"
1519 /* find out what STDPATH is */
1524 #ifndef _PATH_STDPATH
1525 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1527 #include <sys/types.h>
1528 #include <sys/stat.h>
1530 #define DATA "conftest.stdpath"
1537 fd = fopen(DATA,"w");
1541 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1546 ], [ user_path=`cat conftest.stdpath` ],
1547 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1548 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1550 # make sure $bindir is in USER_PATH so scp will work
1551 t_bindir=`eval echo ${bindir}`
1553 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1556 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1558 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1559 if test $? -ne 0 ; then
1560 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1561 if test $? -ne 0 ; then
1562 user_path=$user_path:$t_bindir
1563 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1568 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1571 # Whether to force IPv4 by default (needed on broken glibc Linux)
1573 AC_ARG_WITH(ipv4-default,
1574 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1576 if test "x$withval" != "xno" ; then
1577 AC_DEFINE(IPV4_DEFAULT)
1583 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1584 IPV4_IN6_HACK_MSG="no"
1586 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1588 if test "x$withval" != "xno" ; then
1590 AC_DEFINE(IPV4_IN_IPV6)
1591 IPV4_IN6_HACK_MSG="yes"
1596 if test "x$inet6_default_4in6" = "xyes"; then
1597 AC_MSG_RESULT([yes (default)])
1598 AC_DEFINE(IPV4_IN_IPV6)
1599 IPV4_IN6_HACK_MSG="yes"
1601 AC_MSG_RESULT([no (default)])
1606 # Whether to enable BSD auth support
1607 AC_ARG_WITH(bsd-auth,
1608 [ --with-bsd-auth Enable BSD auth support],
1610 if test "x$withval" != "xno" ; then
1617 AC_MSG_CHECKING(whether to install ssh as suid root)
1618 AC_ARG_ENABLE(suid-ssh,
1619 [ --enable-suid-ssh Install ssh as suid root (default)
1620 --disable-suid-ssh Install ssh without suid bit],
1621 [ case "$enableval" in
1626 *) AC_MSG_RESULT(yes)
1636 # Where to place sshd.pid
1638 AC_ARG_WITH(pid-dir,
1639 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1641 if test "x$withval" != "xno" ; then
1647 # make sure the directory exists
1648 if test ! -d $piddir ; then
1649 piddir=`eval echo ${sysconfdir}`
1651 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1655 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
1658 dnl allow user to disable some login recording features
1659 AC_ARG_ENABLE(lastlog,
1660 [ --disable-lastlog disable use of lastlog even if detected [no]],
1661 [ AC_DEFINE(DISABLE_LASTLOG) ]
1664 [ --disable-utmp disable use of utmp even if detected [no]],
1665 [ AC_DEFINE(DISABLE_UTMP) ]
1667 AC_ARG_ENABLE(utmpx,
1668 [ --disable-utmpx disable use of utmpx even if detected [no]],
1669 [ AC_DEFINE(DISABLE_UTMPX) ]
1672 [ --disable-wtmp disable use of wtmp even if detected [no]],
1673 [ AC_DEFINE(DISABLE_WTMP) ]
1675 AC_ARG_ENABLE(wtmpx,
1676 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1677 [ AC_DEFINE(DISABLE_WTMPX) ]
1679 AC_ARG_ENABLE(libutil,
1680 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1681 [ AC_DEFINE(DISABLE_LOGIN) ]
1683 AC_ARG_ENABLE(pututline,
1684 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1685 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1687 AC_ARG_ENABLE(pututxline,
1688 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1689 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1691 AC_ARG_WITH(lastlog,
1692 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1694 if test "x$withval" = "xno" ; then
1695 AC_DEFINE(DISABLE_LASTLOG)
1697 conf_lastlog_location=$withval
1702 dnl lastlog, [uw]tmpx? detection
1703 dnl NOTE: set the paths in the platform section to avoid the
1704 dnl need for command-line parameters
1705 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1707 dnl lastlog detection
1708 dnl NOTE: the code itself will detect if lastlog is a directory
1709 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1711 #include <sys/types.h>
1713 #ifdef HAVE_LASTLOG_H
1714 # include <lastlog.h>
1720 [ char *lastlog = LASTLOG_FILE; ],
1721 [ AC_MSG_RESULT(yes) ],
1724 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1726 #include <sys/types.h>
1728 #ifdef HAVE_LASTLOG_H
1729 # include <lastlog.h>
1735 [ char *lastlog = _PATH_LASTLOG; ],
1736 [ AC_MSG_RESULT(yes) ],
1739 system_lastlog_path=no
1744 if test -z "$conf_lastlog_location"; then
1745 if test x"$system_lastlog_path" = x"no" ; then
1746 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1747 if (test -d "$f" || test -f "$f") ; then
1748 conf_lastlog_location=$f
1751 if test -z "$conf_lastlog_location"; then
1752 AC_MSG_WARN([** Cannot find lastlog **])
1753 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1758 if test -n "$conf_lastlog_location"; then
1759 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1763 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1765 #include <sys/types.h>
1771 [ char *utmp = UTMP_FILE; ],
1772 [ AC_MSG_RESULT(yes) ],
1774 system_utmp_path=no ]
1776 if test -z "$conf_utmp_location"; then
1777 if test x"$system_utmp_path" = x"no" ; then
1778 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1779 if test -f $f ; then
1780 conf_utmp_location=$f
1783 if test -z "$conf_utmp_location"; then
1784 AC_DEFINE(DISABLE_UTMP)
1788 if test -n "$conf_utmp_location"; then
1789 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1793 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1795 #include <sys/types.h>
1801 [ char *wtmp = WTMP_FILE; ],
1802 [ AC_MSG_RESULT(yes) ],
1804 system_wtmp_path=no ]
1806 if test -z "$conf_wtmp_location"; then
1807 if test x"$system_wtmp_path" = x"no" ; then
1808 for f in /usr/adm/wtmp /var/log/wtmp; do
1809 if test -f $f ; then
1810 conf_wtmp_location=$f
1813 if test -z "$conf_wtmp_location"; then
1814 AC_DEFINE(DISABLE_WTMP)
1818 if test -n "$conf_wtmp_location"; then
1819 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1823 dnl utmpx detection - I don't know any system so perverse as to require
1824 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1826 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1828 #include <sys/types.h>
1837 [ char *utmpx = UTMPX_FILE; ],
1838 [ AC_MSG_RESULT(yes) ],
1840 system_utmpx_path=no ]
1842 if test -z "$conf_utmpx_location"; then
1843 if test x"$system_utmpx_path" = x"no" ; then
1844 AC_DEFINE(DISABLE_UTMPX)
1847 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1851 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1853 #include <sys/types.h>
1862 [ char *wtmpx = WTMPX_FILE; ],
1863 [ AC_MSG_RESULT(yes) ],
1865 system_wtmpx_path=no ]
1867 if test -z "$conf_wtmpx_location"; then
1868 if test x"$system_wtmpx_path" = x"no" ; then
1869 AC_DEFINE(DISABLE_WTMPX)
1872 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1876 # Change default command timeout for builtin PRNG
1878 AC_ARG_WITH(entropy-timeout,
1879 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1881 if test "x$withval" != "xno" ; then
1882 entropy_timeout=$withval
1886 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1889 if test ! -z "$blibpath" ; then
1890 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1891 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1896 AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
1898 # Print summary of options
1900 if test x$MANTYPE = x'$(CATMAN)' ; then
1905 if test ! -z "$RANDOM_POOL" ; then
1906 RAND_MSG="Device ($RANDOM_POOL)"
1908 if test ! -z "$PRNGD_PORT" ; then
1909 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1910 elif test ! -z "$PRNGD_SOCKET" ; then
1911 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
1913 RAND_MSG="Builtin (timeout $entropy_timeout)"
1918 # Someone please show me a better way :)
1919 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1920 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1921 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1922 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1923 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
1924 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1925 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1926 H=`eval echo ${user_path}` ; H=`eval echo ${H}`
1929 echo "OpenSSH has been configured with the following options:"
1930 echo " User binaries: $B"
1931 echo " System binaries: $C"
1932 echo " Configuration files: $D"
1933 echo " Askpass program: $E"
1934 echo " Manual pages: $F"
1935 echo " PID file: $G"
1936 echo " sshd default user PATH: $H"
1937 echo " Random number collection: $RAND_MSG"
1938 echo " Manpage format: $MAN_MSG"
1939 echo " PAM support: ${PAM_MSG}"
1940 echo " KerberosIV support: $KRB4_MSG"
1941 echo " AFS support: $AFS_MSG"
1942 echo " S/KEY support: $SKEY_MSG"
1943 echo " TCP Wrappers support: $TCPW_MSG"
1944 echo " MD5 password support: $MD5_MSG"
1945 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1946 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1947 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1949 if test ! -z "$bsd_auth"; then
1950 echo " BSD Auth support: yes"
1955 echo " Host: ${host}"
1956 echo " Compiler: ${CC}"
1957 echo " Compiler flags: ${CFLAGS}"
1958 echo "Preprocessor flags: ${CPPFLAGS}"
1959 echo " Linker flags: ${LDFLAGS}"
1960 echo " Libraries: ${LIBS}"
1964 if test "x$PAM_MSG" = "xyes" ; then
1965 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1966 echo "otherwise password authentication may fail. Example PAM control files"
1967 echo "can be found in the contrib/ subdirectory"
1971 if test ! -z "$BUILTIN_RNG" ; then
1972 echo "WARNING: you are using the builtin random number collection service."
1973 echo "Please read WARNING.RNG and request that your OS vendor includes"
1974 echo "/dev/random in future versions of their OS."
1978 if test ! -z "$NO_SFTP"; then
1979 echo "sftp-server will be disabled. Your compiler does not support"
1980 echo "64bit integers."