3 AC_CONFIG_HEADER(config.h)
11 AC_CHECK_PROG(AR, ar, ar)
12 AC_PATH_PROG(PERL, perl)
14 AC_PATH_PROG(ENT, ent)
17 if test -z "$LD" ; then
24 if test "$GCC" = "yes"; then
25 CFLAGS="$CFLAGS -Wall"
28 # Check for some target-specific stuff
32 CFLAGS="$CFLAGS -I/usr/local/include"
33 LDFLAGS="$LDFLAGS -L/usr/local/lib"
34 if test "$LD" != "gcc" -a -z "$blibpath"; then
35 blibpath="/usr/lib:/lib:/usr/local/lib"
37 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
38 AC_DEFINE(BROKEN_GETADDRINFO)
39 dnl AIX handles lastlog as part of its login message
40 AC_DEFINE(DISABLE_LASTLOG)
43 if test -z "$GCC"; then
46 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
47 AC_DEFINE(IPADDR_IN_DISPLAY)
48 AC_MSG_CHECKING(for HPUX trusted system password database)
49 if test -f /tcb/files/auth/system/default; then
51 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
53 AC_MSG_WARN([This configuration is untested])
56 AC_DEFINE(DISABLE_SHADOW)
62 if test -z "$GCC"; then
65 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
66 AC_DEFINE(IPADDR_IN_DISPLAY)
67 AC_MSG_CHECKING(for HPUX trusted system password database)
68 if test -f /tcb/files/auth/system/default; then
70 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
72 AC_MSG_WARN([This configuration is untested])
75 AC_DEFINE(DISABLE_SHADOW)
81 CFLAGS="$CFLAGS -I/usr/local/include"
82 LDFLAGS="$LDFLAGS -L/usr/local/lib"
88 CFLAGS="$CFLAGS -I/usr/local/include"
89 LDFLAGS="$LDFLAGS -L/usr/local/lib"
91 AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
97 AC_DEFINE(DONT_TRY_OTHER_AF)
98 inet6_default_4in6=yes
104 CFLAGS="$CFLAGS -I/usr/local/include"
105 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
107 # hardwire lastlog location (can't detect it on some versions)
108 conf_lastlog_location="/var/adm/lastlog"
111 CFLAGS="$CFLAGS -DSUNOS4"
112 AC_CHECK_FUNCS(getpwanam)
115 CFLAGS="$CFLAGS -I/usr/local/include"
116 LDFLAGS="$LDFLAGS -L/usr/local/lib"
119 LIBS="$LIBS -lgen -lsocket"
123 # Checks for libraries.
124 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
125 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
127 if test -z "$no_libsocket" ; then
128 AC_CHECK_LIB(nsl, yp_match, , )
130 if test -z "$no_libnsl" ; then
131 AC_CHECK_LIB(socket, main, , )
134 # Checks for header files.
135 AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h util.h utmp.h utmpx.h)
137 # Checks for library functions.
138 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy vsnprintf vhangup _getpty __b64_ntop)
139 dnl checks for time functions
140 AC_CHECK_FUNCS(gettimeofday time)
141 dnl checks for libutil functions
142 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
143 dnl checks for utmp functions
144 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
145 AC_CHECK_FUNCS(utmpname)
146 dnl checks for utmpx functions
147 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
148 AC_CHECK_FUNCS(setutxent utmpxname)
151 [AC_DEFINE(HAVE_LOGIN)],
152 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
155 AC_CHECK_FUNC(daemon,
156 [AC_DEFINE(HAVE_DAEMON)],
157 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
160 AC_CHECK_FUNC(getpagesize,
161 [AC_DEFINE(HAVE_GETPAGESIZE)],
162 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
166 [ --without-pam Disable PAM support ],
168 if test "x$withval" = "xno" ; then
170 AC_DEFINE(DISABLE_PAM)
174 if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
175 AC_CHECK_LIB(dl, dlopen, , )
178 AC_CHECK_FUNCS(pam_getenvlist)
180 # Check PAM strerror arguments (old PAM)
181 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
185 #include <security/pam_appl.h>
187 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
190 AC_DEFINE(HAVE_OLD_PAM)
196 # The big search for OpenSSL
198 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
200 if test "x$withval" != "$xno" ; then
207 saved_LDFLAGS="$LDFLAGS"
208 saved_CFLAGS="$CFLAGS"
209 if test "x$prefix" != "xNONE" ; then
210 tryssldir="$tryssldir $prefix"
212 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
214 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
215 if test ! -z "$ssldir" ; then
216 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
217 CFLAGS="$saved_CFLAGS -I$ssldir/include"
218 if test ! -z "$need_dash_r" ; then
219 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
222 LDFLAGS="$saved_LDFLAGS"
225 LIBS="$saved_LIBS -lcrypto"
227 # Basic test to check for compatible version and correct linking
228 # *does not* test for RSA - that comes later.
232 #include <openssl/rand.h>
236 memset(a, 0, sizeof(a));
237 RAND_add(a, sizeof(a), sizeof(a));
238 return(RAND_status() <= 0);
247 if test ! -z "$found_crypto" ; then
252 if test -z "$found_crypto" ; then
253 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
255 if test -z "$ssldir" ; then
259 ac_cv_openssldir=$ssldir
262 if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
263 AC_DEFINE(HAVE_OPENSSL)
264 dnl Need to recover ssldir - test above runs in subshell
265 ssldir=$ac_cv_openssldir
266 CFLAGS="$saved_CFLAGS -I$ssldir/include"
267 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
268 if test ! -z "$need_dash_r" ; then
269 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
271 if test ! -z "$blibpath" ; then
272 blibpath="$blibpath:$ssldir:$ssldir/lib"
275 LIBS="$saved_LIBS -lcrypto"
277 # Now test RSA support
279 AC_MSG_CHECKING([for RSA support])
280 for WANTS_RSAREF in "" 1 ; do
281 if test -z "$WANTS_RSAREF" ; then
284 LIBS="$saved_LIBS -lRSAglue -lrsaref"
288 #include <openssl/rand.h>
289 #include <openssl/rsa.h>
290 #include <openssl/bn.h>
291 #include <openssl/sha.h>
294 int num; RSA *key; static unsigned char p_in[] = "blahblah";
295 unsigned char c[256], p[256];
296 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
297 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
298 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
299 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
308 if test ! -z "$no_rsa" ; then
309 AC_MSG_RESULT(disabled)
311 if test -z "$rsa_works" ; then
312 AC_MSG_WARN([*** No RSA support found *** ])
314 if test -z "$WANTS_RSAREF" ; then
317 AC_MSG_RESULT(using RSAref)
318 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
323 # Checks for data types
324 AC_CHECK_SIZEOF(char, 1)
325 AC_CHECK_SIZEOF(short int, 2)
326 AC_CHECK_SIZEOF(int, 4)
327 AC_CHECK_SIZEOF(long int, 4)
328 AC_CHECK_SIZEOF(long long int, 8)
330 # More checks for data types
331 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
333 [ #include <sys/types.h> ],
334 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
335 [ ac_cv_have_intxx_t="yes" ],
336 [ ac_cv_have_intxx_t="no" ]
339 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
340 AC_DEFINE(HAVE_INTXX_T)
344 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
346 [ #include <sys/types.h> ],
347 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
348 [ ac_cv_have_u_intxx_t="yes" ],
349 [ ac_cv_have_u_intxx_t="no" ]
352 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
353 AC_DEFINE(HAVE_U_INTXX_T)
358 if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
359 "x$ac_cv_header_sys_bitypes_h" = "xyes"
361 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
364 #include <sys/bitypes.h>
367 int8_t a; int16_t b; int32_t c;
368 u_int8_t e; u_int16_t f; u_int32_t g;
369 a = b = c = e = f = g = 1;
372 AC_DEFINE(HAVE_U_INTXX_T)
373 AC_DEFINE(HAVE_INTXX_T)
380 if test -z "$have_u_intxx_t" ; then
381 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
384 #include <sys/types.h>
386 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
387 [ ac_cv_have_uintxx_t="yes" ],
388 [ ac_cv_have_uintxx_t="no" ]
391 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
392 AC_DEFINE(HAVE_UINTXX_T)
396 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
399 #include <sys/types.h>
400 #include <sys/socket.h>
402 [socklen_t foo; foo = 1235;],
403 [ ac_cv_have_socklen_t="yes" ],
404 [ ac_cv_have_socklen_t="no" ]
407 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
408 AC_DEFINE(HAVE_SOCKLEN_T)
411 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
414 #include <sys/types.h>
416 [ size_t foo; foo = 1235; ],
417 [ ac_cv_have_size_t="yes" ],
418 [ ac_cv_have_size_t="no" ]
421 if test "x$ac_cv_have_size_t" = "xyes" ; then
422 AC_DEFINE(HAVE_SIZE_T)
425 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
428 #include <sys/types.h>
430 [ ssize_t foo; foo = 1235; ],
431 [ ac_cv_have_ssize_t="yes" ],
432 [ ac_cv_have_ssize_t="no" ]
435 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
436 AC_DEFINE(HAVE_SSIZE_T)
440 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
443 #include <sys/types.h>
444 #include <sys/socket.h>
446 [ struct sockaddr_storage s; ],
447 [ ac_cv_have_struct_sockaddr_storage="yes" ],
448 [ ac_cv_have_struct_sockaddr_storage="no" ]
451 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
452 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
455 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
458 #include <netinet/in.h>
460 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
461 [ ac_cv_have_struct_sockaddr_in6="yes" ],
462 [ ac_cv_have_struct_sockaddr_in6="no" ]
465 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
466 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
469 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
472 #include <netinet/in.h>
474 [ struct in6_addr s; s.s6_addr[0] = 0; ],
475 [ ac_cv_have_struct_in6_addr="yes" ],
476 [ ac_cv_have_struct_in6_addr="no" ]
479 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
480 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
483 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
486 #include <sys/types.h>
487 #include <sys/socket.h>
490 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
491 [ ac_cv_have_struct_addrinfo="yes" ],
492 [ ac_cv_have_struct_addrinfo="no" ]
495 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
496 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
500 # Checks for structure members
502 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
503 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
504 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
505 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
506 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
507 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
508 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
509 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
510 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
511 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
512 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
513 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
514 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
515 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
516 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
517 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
521 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
522 ac_cv_have_ss_family_in_struct_ss, [
525 #include <sys/types.h>
526 #include <sys/socket.h>
528 [ struct sockaddr_storage s; s.ss_family = 1; ],
529 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
530 [ ac_cv_have_ss_family_in_struct_ss="no" ],
533 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
534 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
538 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
539 ac_cv_have___ss_family_in_struct_ss, [
542 #include <sys/types.h>
543 #include <sys/socket.h>
545 [ struct sockaddr_storage s; s.__ss_family = 1; ],
546 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
547 [ ac_cv_have___ss_family_in_struct_ss="no" ]
550 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
551 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
555 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
557 [ extern char *__progname; printf("%s", __progname); ],
558 [ ac_cv_libc_defines___progname="yes" ],
559 [ ac_cv_libc_defines___progname="no" ]
562 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
563 AC_DEFINE(HAVE___PROGNAME)
567 # Looking for programs, paths and files
569 [ --with-rsh=PATH Specify path to remote shell program ],
571 if test "x$withval" != "$no" ; then
572 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
576 AC_PATH_PROG(rsh_path, rsh)
581 [ --with-xauth=PATH Specify path to xauth program ],
583 if test "x$withval" != "$xno" ; then
584 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval")
588 AC_PATH_PROG(xauth_path, xauth)
589 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
590 xauth_path="/usr/openwin/bin/xauth"
595 if test ! -z "$xauth_path" ; then
596 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
598 if test ! -z "$rsh_path" ; then
599 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
602 # Check for mail directory (last resort if we cannot get it from headers)
603 if test ! -z "$MAIL" ; then
604 maildir=`dirname $MAIL`
605 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
608 if test -z "$no_dev_ptmx" ; then
609 AC_CHECK_FILE("/dev/ptmx",
611 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
616 AC_CHECK_FILE("/dev/ptc",
618 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
623 # Options from here on. Some of these are preset by platform above
625 # Check for user-specified random device, otherwise check /dev/urandom
627 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
629 if test "x$withval" != "xno" ; then
630 RANDOM_POOL="$withval";
631 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
635 # Check for random device
636 AC_CHECK_FILE("/dev/urandom",
638 RANDOM_POOL="/dev/urandom";
639 AC_SUBST(RANDOM_POOL)
640 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
646 # Check for EGD pool file
647 AC_ARG_WITH(egd-pool,
648 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
650 if test "x$withval" != "xno" ; then
651 EGD_SOCKET="$withval";
652 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
657 # detect pathnames for entropy gathering commands, if we need them
658 INSTALL_SSH_PRNG_CMDS=""
660 if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
661 # Use these commands to collect entropy
662 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
663 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
664 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
665 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
666 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
667 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
668 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
669 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
670 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
671 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
672 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
673 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
674 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
675 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
676 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
678 INSTALL_SSH_PRNG_CMDS="yes"
680 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
684 [ --with-catman=man|cat Install preformatted manpages[no]],
687 if test x"$withval" != x"yes" ; then
693 if test -z "$MANTYPE" ; then
694 MANTYPE='$(TROFFMAN)'
702 # Check whether user wants Kerberos support
703 AC_ARG_WITH(kerberos4,
704 [ --with-kerberos4=PATH Enable Kerberos 4 support],
706 if test "x$withval" != "xno" ; then
708 if test "x$withval" != "$xyes" ; then
709 CFLAGS="$CFLAGS -I${withval}/include"
710 LDFLAGS="$LDFLAGS -L${withval}/lib"
711 if test ! -z "$need_dash_r" ; then
712 LDFLAGS="$LDFLAGS -R${withval}/lib"
714 if test ! -z "$blibpath" ; then
715 blibpath="$blibpath:${withval}/lib"
718 if test -d /usr/include/kerberosIV ; then
719 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
723 AC_CHECK_HEADERS(krb.h)
724 AC_CHECK_LIB(krb, main)
725 if test "$ac_cv_header_krb_h" != yes; then
726 AC_MSG_WARN([Cannot find krb.h, build may fail])
728 if test "$ac_cv_lib_krb_main" != yes; then
729 AC_MSG_WARN([Cannot find libkrb, build may fail])
733 AC_CHECK_LIB(resolv, dn_expand, , )
740 # Check whether user wants AFS support
742 [ --with-afs=PATH Enable AFS support],
744 if test "x$withval" != "xno" ; then
746 if test "x$withval" != "$xyes" ; then
747 CFLAGS="$CFLAGS -I${withval}/include"
748 LFLAGS="$LFLAGS -L${withval}/lib"
751 if test -z "$KRB4" ; then
752 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
756 if test ! -z "$AFS_LIBS" ; then
757 LIBS="$LIBS $AFS_LIBS"
765 # Check whether user wants S/Key support
767 [ --with-skey Enable S/Key support],
769 if test "x$withval" != "xno" ; then
776 # Check whether user wants TCP wrappers support
777 AC_ARG_WITH(tcp-wrappers,
778 [ --with-tcp-wrappers Enable tcpwrappers support],
780 if test "x$withval" != "xno" ; then
783 AC_MSG_CHECKING(for libwrap)
787 int deny_severity = 0, allow_severity = 0;
796 AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***])
804 # Check whether to enable MD5 passwords
805 AC_ARG_WITH(md5-passwords,
806 [ --with-md5-passwords Enable use of MD5 passwords],
808 if test "x$withval" != "xno" ; then
809 AC_DEFINE(HAVE_MD5_PASSWORDS)
814 # Whether to disable shadow password support
816 [ --without-shadow Disable shadow password support],
818 if test "x$withval" = "xno" ; then
819 AC_DEFINE(DISABLE_SHADOW)
824 # Use ip address instead of hostname in $DISPLAY
825 AC_ARG_WITH(ipaddr-display,
826 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
828 if test "x$withval" = "xno" ; then
829 AC_DEFINE(IPADDR_IN_DISPLAY)
834 # Whether to mess with the default path
835 AC_ARG_WITH(default-path,
836 [ --with-default-path=PATH Specify default \$PATH environment for server],
838 if test "x$withval" != "xno" ; then
839 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
844 # Whether to force IPv4 by default (needed on broken glibc Linux)
845 AC_ARG_WITH(ipv4-default,
846 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
848 if test "x$withval" != "xno" ; then
849 AC_DEFINE(IPV4_DEFAULT)
854 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
856 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
858 if test "x$withval" != "xno" ; then
860 AC_DEFINE(IPV4_IN_IPV6)
865 if test "x$inet6_default_4in6" = "xyes"; then
866 AC_MSG_RESULT([yes (default)])
867 AC_DEFINE(IPV4_IN_IPV6)
869 AC_MSG_RESULT([no (default)])
874 # Where to place sshd.pid
877 [ --with-pid-dir=PATH Specify location of ssh.pid file],
879 if test "x$withval" != "xno" ; then
885 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
888 dnl allow user to disable some login recording features
889 AC_ARG_ENABLE(lastlog,
890 [ --disable-lastlog disable use of lastlog even if detected [no]],
891 [ AC_DEFINE(DISABLE_LASTLOG) ]
894 [ --disable-utmp disable use of utmp even if detected [no]],
895 [ AC_DEFINE(DISABLE_UTMP) ]
898 [ --disable-utmpx disable use of utmpx even if detected [no]],
899 [ AC_DEFINE(DISABLE_UTMPX) ]
902 [ --disable-wtmp disable use of wtmp even if detected [no]],
903 [ AC_DEFINE(DISABLE_WTMP) ]
906 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
907 [ AC_DEFINE(DISABLE_WTMPX) ]
909 AC_ARG_ENABLE(libutil,
910 [ --disable-libutil disable use of libutil (login() etc.) [no]],
911 [ AC_DEFINE(DISABLE_LOGIN) ]
913 AC_ARG_ENABLE(pututline,
914 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
915 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
917 AC_ARG_ENABLE(pututxline,
918 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
919 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
922 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
923 [ conf_lastlog_location="$withval"; ],)
925 dnl lastlog, [uw]tmpx? detection
926 dnl NOTE: set the paths in the platform section to avoid the
927 dnl need for command-line parameters
928 dnl lastlog and [uw]tmp are subject to a file search if all else fails
930 dnl lastlog detection
931 dnl NOTE: the code itself will detect if lastlog is a directory
932 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
934 #include <sys/types.h>
936 #ifdef HAVE_LASTLOG_H
937 # include <lastlog.h>
943 [ char *lastlog = LASTLOG_FILE; ],
944 [ AC_MSG_RESULT(yes) ],
946 system_lastlog_path=no ]
948 if test -z "$conf_lastlog_location"; then
949 if test x"$system_lastlog_path" = x"no" ; then
950 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
952 conf_lastlog_location=$f
955 if test -z "$conf_lastlog_location"; then
956 AC_MSG_WARN([** Cannot find lastlog - disabling feature **])
957 AC_DEFINE(DISABLE_LASTLOG)
962 if test -n "$conf_lastlog_location"; then
963 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
967 AC_MSG_CHECKING([if your system defines UTMP_FILE])
969 #include <sys/types.h>
975 [ char *utmp = UTMP_FILE; ],
976 [ AC_MSG_RESULT(yes) ],
978 system_utmp_path=no ]
980 if test -z "$conf_utmp_location"; then
981 if test x"$system_utmp_path" = x"no" ; then
982 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
984 conf_utmp_location=$f
987 if test -z "$conf_utmp_location"; then
988 AC_DEFINE(DISABLE_UTMP)
992 if test -n "$conf_utmp_location"; then
993 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
997 AC_MSG_CHECKING([if your system defines WTMP_FILE])
999 #include <sys/types.h>
1005 [ char *wtmp = WTMP_FILE; ],
1006 [ AC_MSG_RESULT(yes) ],
1008 system_wtmp_path=no ]
1010 if test -z "$conf_wtmp_location"; then
1011 if test x"$system_wtmp_path" = x"no" ; then
1012 for f in /usr/adm/wtmp /var/log/wtmp; do
1013 if test -f $f ; then
1014 conf_wtmp_location=$f
1017 if test -z "$conf_wtmp_location"; then
1018 AC_DEFINE(DISABLE_WTMP)
1022 if test -n "$conf_wtmp_location"; then
1023 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1027 dnl utmpx detection - I don't know any system so perverse as to require
1028 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1030 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1032 #include <sys/types.h>
1041 [ char *utmpx = UTMPX_FILE; ],
1042 [ AC_MSG_RESULT(yes) ],
1044 system_utmpx_path=no ]
1046 if test -z "$conf_utmpx_location"; then
1047 if test x"$system_utmpx_path" = x"no" ; then
1048 AC_DEFINE(DISABLE_UTMPX)
1051 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1055 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1057 #include <sys/types.h>
1066 [ char *wtmpx = WTMPX_FILE; ],
1067 [ AC_MSG_RESULT(yes) ],
1069 system_wtmpx_path=no ]
1071 if test -z "$conf_wtmpx_location"; then
1072 if test x"$system_wtmpx_path" = x"no" ; then
1073 AC_DEFINE(DISABLE_WTMPX)
1076 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1080 # Change default command timeout for builtin PRNG
1082 AC_ARG_WITH(entropy-timeout,
1083 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1085 if test "x$withval" != "xno" ; then
1086 entropy_timeout=$withval
1090 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1093 if test ! -z "$blibpath" ; then
1094 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1095 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1098 AC_OUTPUT(Makefile ssh_prng_cmds)