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)
41 if test -z "$GCC"; then
44 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
45 AC_DEFINE(IPADDR_IN_DISPLAY)
46 AC_MSG_CHECKING(for HPUX trusted system password database)
47 if test -f /tcb/files/auth/system/default; then
49 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
51 AC_MSG_WARN([This configuration is untested])
54 AC_DEFINE(DISABLE_SHADOW)
60 if test -z "$GCC"; then
63 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
64 AC_DEFINE(IPADDR_IN_DISPLAY)
65 AC_MSG_CHECKING(for HPUX trusted system password database)
66 if test -f /tcb/files/auth/system/default; then
68 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
70 AC_MSG_WARN([This configuration is untested])
73 AC_DEFINE(DISABLE_SHADOW)
79 CFLAGS="$CFLAGS -I/usr/local/include"
80 LDFLAGS="$LDFLAGS -L/usr/local/lib"
86 CFLAGS="$CFLAGS -I/usr/local/include"
87 LDFLAGS="$LDFLAGS -L/usr/local/lib"
89 AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
95 AC_DEFINE(DONT_TRY_OTHER_AF)
96 inet6_default_4in6=yes
102 CFLAGS="$CFLAGS -I/usr/local/include"
103 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
105 # hardwire lastlog location (can't detect it on some versions)
106 conf_lastlog_location="/var/adm/lastlog"
109 CFLAGS="$CFLAGS -DSUNOS4"
110 AC_CHECK_FUNCS(getpwanam)
113 CFLAGS="$CFLAGS -I/usr/local/include"
114 LDFLAGS="$LDFLAGS -L/usr/local/lib"
117 LIBS="$LIBS -lgen -lsocket"
121 # Checks for libraries.
122 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
123 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
125 if test -z "$no_libsocket" ; then
126 AC_CHECK_LIB(nsl, yp_match, , )
128 if test -z "$no_libnsl" ; then
129 AC_CHECK_LIB(socket, main, , )
132 # Checks for header files.
133 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)
135 # Checks for library functions.
136 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)
137 dnl checks for time functions
138 AC_CHECK_FUNCS(gettimeofday time)
139 dnl checks for libutil functions
140 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
141 dnl checks for utmp functions
142 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
143 AC_CHECK_FUNCS(utmpname)
144 dnl checks for utmpx functions
145 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
146 AC_CHECK_FUNCS(setutxent utmpxname)
149 [AC_DEFINE(HAVE_LOGIN)],
150 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
153 AC_CHECK_FUNC(daemon,
154 [AC_DEFINE(HAVE_DAEMON)],
155 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
158 AC_CHECK_FUNC(getpagesize,
159 [AC_DEFINE(HAVE_GETPAGESIZE)],
160 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
164 [ --without-pam Disable PAM support ],
166 if test "x$withval" = "xno" ; then
168 AC_DEFINE(DISABLE_PAM)
172 if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
173 AC_CHECK_LIB(dl, dlopen, , )
176 AC_CHECK_FUNCS(pam_getenvlist)
178 # Check PAM strerror arguments (old PAM)
179 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
183 #include <security/pam_appl.h>
185 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
188 AC_DEFINE(HAVE_OLD_PAM)
194 # The big search for OpenSSL
196 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
198 if test "x$withval" != "$xno" ; then
205 saved_LDFLAGS="$LDFLAGS"
206 saved_CFLAGS="$CFLAGS"
207 if test "x$prefix" != "xNONE" ; then
208 tryssldir="$tryssldir $prefix"
210 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
212 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
213 if test ! -z "$ssldir" ; then
214 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
215 CFLAGS="$saved_CFLAGS -I$ssldir/include"
216 if test ! -z "$need_dash_r" ; then
217 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
220 LDFLAGS="$saved_LDFLAGS"
223 LIBS="$saved_LIBS -lcrypto"
225 # Basic test to check for compatible version and correct linking
226 # *does not* test for RSA - that comes later.
230 #include <openssl/rand.h>
234 memset(a, 0, sizeof(a));
235 RAND_add(a, sizeof(a), sizeof(a));
236 return(RAND_status() <= 0);
245 if test ! -z "$found_crypto" ; then
250 if test -z "$found_crypto" ; then
251 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
253 if test -z "$ssldir" ; then
257 ac_cv_openssldir=$ssldir
260 if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
261 AC_DEFINE(HAVE_OPENSSL)
262 dnl Need to recover ssldir - test above runs in subshell
263 ssldir=$ac_cv_openssldir
264 CFLAGS="$saved_CFLAGS -I$ssldir/include"
265 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
266 if test ! -z "$need_dash_r" ; then
267 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
269 if test ! -z "$blibpath" ; then
270 blibpath="$blibpath:$ssldir:$ssldir/lib"
273 LIBS="$saved_LIBS -lcrypto"
275 # Now test RSA support
277 AC_MSG_CHECKING([for RSA support])
278 for WANTS_RSAREF in "" 1 ; do
279 if test -z "$WANTS_RSAREF" ; then
282 LIBS="$saved_LIBS -lRSAglue -lrsaref"
286 #include <openssl/rand.h>
287 #include <openssl/rsa.h>
288 #include <openssl/bn.h>
289 #include <openssl/sha.h>
292 int num; RSA *key; static unsigned char p_in[] = "blahblah";
293 unsigned char c[256], p[256];
294 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
295 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
296 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
297 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
306 if test ! -z "$no_rsa" ; then
307 AC_MSG_RESULT(disabled)
309 if test -z "$rsa_works" ; then
310 AC_MSG_WARN([*** No RSA support found *** ])
312 if test -z "$WANTS_RSAREF" ; then
315 AC_MSG_RESULT(using RSAref)
316 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
321 # Checks for data types
322 AC_CHECK_SIZEOF(char, 1)
323 AC_CHECK_SIZEOF(short int, 2)
324 AC_CHECK_SIZEOF(int, 4)
325 AC_CHECK_SIZEOF(long int, 4)
326 AC_CHECK_SIZEOF(long long int, 8)
328 # More checks for data types
329 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
331 [ #include <sys/types.h> ],
332 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
333 [ ac_cv_have_intxx_t="yes" ],
334 [ ac_cv_have_intxx_t="no" ]
337 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
338 AC_DEFINE(HAVE_INTXX_T)
342 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
344 [ #include <sys/types.h> ],
345 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
346 [ ac_cv_have_u_intxx_t="yes" ],
347 [ ac_cv_have_u_intxx_t="no" ]
350 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
351 AC_DEFINE(HAVE_U_INTXX_T)
356 if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
357 "x$ac_cv_header_sys_bitypes_h" = "xyes"
359 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
362 #include <sys/bitypes.h>
365 int8_t a; int16_t b; int32_t c;
366 u_int8_t e; u_int16_t f; u_int32_t g;
367 a = b = c = e = f = g = 1;
370 AC_DEFINE(HAVE_U_INTXX_T)
371 AC_DEFINE(HAVE_INTXX_T)
378 if test -z "$have_u_intxx_t" ; then
379 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
382 #include <sys/types.h>
384 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
385 [ ac_cv_have_uintxx_t="yes" ],
386 [ ac_cv_have_uintxx_t="no" ]
389 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
390 AC_DEFINE(HAVE_UINTXX_T)
394 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
397 #include <sys/types.h>
398 #include <sys/socket.h>
400 [socklen_t foo; foo = 1235;],
401 [ ac_cv_have_socklen_t="yes" ],
402 [ ac_cv_have_socklen_t="no" ]
405 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
406 AC_DEFINE(HAVE_SOCKLEN_T)
409 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
412 #include <sys/types.h>
414 [ size_t foo; foo = 1235; ],
415 [ ac_cv_have_size_t="yes" ],
416 [ ac_cv_have_size_t="no" ]
419 if test "x$ac_cv_have_size_t" = "xyes" ; then
420 AC_DEFINE(HAVE_SIZE_T)
423 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
426 #include <sys/types.h>
428 [ ssize_t foo; foo = 1235; ],
429 [ ac_cv_have_ssize_t="yes" ],
430 [ ac_cv_have_ssize_t="no" ]
433 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
434 AC_DEFINE(HAVE_SSIZE_T)
438 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
441 #include <sys/types.h>
442 #include <sys/socket.h>
444 [ struct sockaddr_storage s; ],
445 [ ac_cv_have_struct_sockaddr_storage="yes" ],
446 [ ac_cv_have_struct_sockaddr_storage="no" ]
449 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
450 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
453 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
456 #include <netinet/in.h>
458 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
459 [ ac_cv_have_struct_sockaddr_in6="yes" ],
460 [ ac_cv_have_struct_sockaddr_in6="no" ]
463 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
464 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
467 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
470 #include <netinet/in.h>
472 [ struct in6_addr s; s.s6_addr[0] = 0; ],
473 [ ac_cv_have_struct_in6_addr="yes" ],
474 [ ac_cv_have_struct_in6_addr="no" ]
477 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
478 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
481 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
484 #include <sys/types.h>
485 #include <sys/socket.h>
488 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
489 [ ac_cv_have_struct_addrinfo="yes" ],
490 [ ac_cv_have_struct_addrinfo="no" ]
493 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
494 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
498 # Checks for structure members
500 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
501 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
502 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
503 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
504 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
505 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
506 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
507 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
508 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
509 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
510 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
511 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
512 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
513 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
514 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
515 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
519 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
520 ac_cv_have_ss_family_in_struct_ss, [
523 #include <sys/types.h>
524 #include <sys/socket.h>
526 [ struct sockaddr_storage s; s.ss_family = 1; ],
527 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
528 [ ac_cv_have_ss_family_in_struct_ss="no" ],
531 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
532 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
536 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
537 ac_cv_have___ss_family_in_struct_ss, [
540 #include <sys/types.h>
541 #include <sys/socket.h>
543 [ struct sockaddr_storage s; s.__ss_family = 1; ],
544 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
545 [ ac_cv_have___ss_family_in_struct_ss="no" ]
548 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
549 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
553 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
555 [ extern char *__progname; printf("%s", __progname); ],
556 [ ac_cv_libc_defines___progname="yes" ],
557 [ ac_cv_libc_defines___progname="no" ]
560 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
561 AC_DEFINE(HAVE___PROGNAME)
565 # Looking for programs, paths and files
567 [ --with-rsh=PATH Specify path to remote shell program ],
569 if test "x$withval" != "$no" ; then
570 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
574 AC_PATH_PROG(rsh_path, rsh)
579 [ --with-xauth=PATH Specify path to xauth program ],
581 if test "x$withval" != "$xno" ; then
582 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval")
586 AC_PATH_PROG(xauth_path, xauth)
587 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
588 xauth_path="/usr/openwin/bin/xauth"
593 if test ! -z "$xauth_path" ; then
594 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
596 if test ! -z "$rsh_path" ; then
597 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
600 # Check for mail directory (last resort if we cannot get it from headers)
601 if test ! -z "$MAIL" ; then
602 maildir=`dirname $MAIL`
603 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
606 if test -z "$no_dev_ptmx" ; then
607 AC_CHECK_FILE("/dev/ptmx",
609 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
614 AC_CHECK_FILE("/dev/ptc",
616 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
621 # Options from here on. Some of these are preset by platform above
623 # Check for user-specified random device, otherwise check /dev/urandom
625 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
627 if test "x$withval" != "xno" ; then
628 RANDOM_POOL="$withval";
629 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
633 # Check for random device
634 AC_CHECK_FILE("/dev/urandom",
636 RANDOM_POOL="/dev/urandom";
637 AC_SUBST(RANDOM_POOL)
638 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
644 # Check for EGD pool file
645 AC_ARG_WITH(egd-pool,
646 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
648 if test "x$withval" != "xno" ; then
649 EGD_SOCKET="$withval";
650 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
655 # detect pathnames for entropy gathering commands, if we need them
656 INSTALL_SSH_PRNG_CMDS=""
658 if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
659 # Use these commands to collect entropy
660 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
661 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
662 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
663 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
664 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
665 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
666 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
667 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
668 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
669 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
670 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
671 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
672 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
673 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
674 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
676 INSTALL_SSH_PRNG_CMDS="yes"
678 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
682 [ --with-catman=man|cat Install preformatted manpages[no]],
685 if test x"$withval" != x"yes" ; then
691 if test -z "$MANTYPE" ; then
692 MANTYPE='$(TROFFMAN)'
700 # Check whether user wants Kerberos support
701 AC_ARG_WITH(kerberos4,
702 [ --with-kerberos4=PATH Enable Kerberos 4 support],
704 if test "x$withval" != "xno" ; then
706 if test "x$withval" != "$xyes" ; then
707 CFLAGS="$CFLAGS -I${withval}/include"
708 LDFLAGS="$LDFLAGS -L${withval}/lib"
709 if test ! -z "$need_dash_r" ; then
710 LDFLAGS="$LDFLAGS -R${withval}/lib"
712 if test ! -z "$blibpath" ; then
713 blibpath="$blibpath:${withval}/lib"
716 if test -d /usr/include/kerberosIV ; then
717 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
721 AC_CHECK_HEADERS(krb.h)
722 AC_CHECK_LIB(krb, main)
723 if test "$ac_cv_header_krb_h" != yes; then
724 AC_MSG_WARN([Cannot find krb.h, build may fail])
726 if test "$ac_cv_lib_krb_main" != yes; then
727 AC_MSG_WARN([Cannot find libkrb, build may fail])
731 AC_CHECK_LIB(resolv, dn_expand, , )
738 # Check whether user wants AFS support
740 [ --with-afs=PATH Enable AFS support],
742 if test "x$withval" != "xno" ; then
744 if test "x$withval" != "$xyes" ; then
745 CFLAGS="$CFLAGS -I${withval}/include"
746 LFLAGS="$LFLAGS -L${withval}/lib"
749 if test -z "$KRB4" ; then
750 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
754 if test ! -z "$AFS_LIBS" ; then
755 LIBS="$LIBS $AFS_LIBS"
763 # Check whether user wants S/Key support
765 [ --with-skey Enable S/Key support],
767 if test "x$withval" != "xno" ; then
774 # Check whether user wants TCP wrappers support
775 AC_ARG_WITH(tcp-wrappers,
776 [ --with-tcp-wrappers Enable tcpwrappers support],
778 if test "x$withval" != "xno" ; then
781 AC_MSG_CHECKING(for libwrap)
785 int deny_severity = 0, allow_severity = 0;
794 AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***])
802 # Check whether to enable MD5 passwords
803 AC_ARG_WITH(md5-passwords,
804 [ --with-md5-passwords Enable use of MD5 passwords],
806 if test "x$withval" != "xno" ; then
807 AC_DEFINE(HAVE_MD5_PASSWORDS)
812 # Whether to disable shadow password support
814 [ --without-shadow Disable shadow password support],
816 if test "x$withval" = "xno" ; then
817 AC_DEFINE(DISABLE_SHADOW)
822 # Use ip address instead of hostname in $DISPLAY
823 AC_ARG_WITH(ipaddr-display,
824 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
826 if test "x$withval" = "xno" ; then
827 AC_DEFINE(IPADDR_IN_DISPLAY)
832 # Whether to mess with the default path
833 AC_ARG_WITH(default-path,
834 [ --with-default-path=PATH Specify default \$PATH environment for server],
836 if test "x$withval" != "xno" ; then
837 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
842 # Whether to force IPv4 by default (needed on broken glibc Linux)
843 AC_ARG_WITH(ipv4-default,
844 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
846 if test "x$withval" != "xno" ; then
847 AC_DEFINE(IPV4_DEFAULT)
852 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
854 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
856 if test "x$withval" != "xno" ; then
858 AC_DEFINE(IPV4_IN_IPV6)
863 if test "x$inet6_default_4in6" = "xyes"; then
864 AC_MSG_RESULT([yes (default)])
865 AC_DEFINE(IPV4_IN_IPV6)
867 AC_MSG_RESULT([no (default)])
872 # Where to place sshd.pid
875 [ --with-pid-dir=PATH Specify location of ssh.pid file],
877 if test "x$withval" != "xno" ; then
883 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
886 dnl allow user to disable some login recording features
887 AC_ARG_ENABLE(lastlog,
888 [ --disable-lastlog disable use of lastlog even if detected [no]],
889 [ AC_DEFINE(DISABLE_LASTLOG) ]
892 [ --disable-utmp disable use of utmp even if detected [no]],
893 [ AC_DEFINE(DISABLE_UTMP) ]
896 [ --disable-utmpx disable use of utmpx even if detected [no]],
897 [ AC_DEFINE(DISABLE_UTMPX) ]
900 [ --disable-wtmp disable use of wtmp even if detected [no]],
901 [ AC_DEFINE(DISABLE_WTMP) ]
904 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
905 [ AC_DEFINE(DISABLE_WTMPX) ]
907 AC_ARG_ENABLE(libutil,
908 [ --disable-libutil disable use of libutil (login() etc.) [no]],
909 [ AC_DEFINE(DISABLE_LOGIN) ]
911 AC_ARG_ENABLE(pututline,
912 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
913 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
915 AC_ARG_ENABLE(pututxline,
916 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
917 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
920 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
921 [ conf_lastlog_location="$withval"; ],)
923 dnl lastlog, [uw]tmpx? detection
924 dnl NOTE: set the paths in the platform section to avoid the
925 dnl need for command-line parameters
926 dnl lastlog and [uw]tmp are subject to a file search if all else fails
928 dnl lastlog detection
929 dnl NOTE: the code itself will detect if lastlog is a directory
930 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
932 #include <sys/types.h>
934 #ifdef HAVE_LASTLOG_H
935 # include <lastlog.h>
941 [ char *lastlog = LASTLOG_FILE; ],
942 [ AC_MSG_RESULT(yes) ],
944 system_lastlog_path=no ]
946 if test -z "$conf_lastlog_location"; then
947 if test x"$system_lastlog_path" = x"no" ; then
948 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
950 conf_lastlog_location=$f
953 if test -z "$conf_lastlog_location"; then
954 AC_MSG_WARN([** Cannot find lastlog - disabling feature **])
955 AC_DEFINE(DISABLE_LASTLOG)
960 if test -n "$conf_lastlog_location"; then
961 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
965 AC_MSG_CHECKING([if your system defines UTMP_FILE])
967 #include <sys/types.h>
973 [ char *utmp = UTMP_FILE; ],
974 [ AC_MSG_RESULT(yes) ],
976 system_utmp_path=no ]
978 if test -z "$conf_utmp_location"; then
979 if test x"$system_utmp_path" = x"no" ; then
980 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
982 conf_utmp_location=$f
985 if test -z "$conf_utmp_location"; then
986 AC_DEFINE(DISABLE_UTMP)
990 if test -n "$conf_utmp_location"; then
991 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
995 AC_MSG_CHECKING([if your system defines WTMP_FILE])
997 #include <sys/types.h>
1003 [ char *wtmp = WTMP_FILE; ],
1004 [ AC_MSG_RESULT(yes) ],
1006 system_wtmp_path=no ]
1008 if test -z "$conf_wtmp_location"; then
1009 if test x"$system_wtmp_path" = x"no" ; then
1010 for f in /usr/adm/wtmp /var/log/wtmp; do
1011 if test -f $f ; then
1012 conf_wtmp_location=$f
1015 if test -z "$conf_wtmp_location"; then
1016 AC_DEFINE(DISABLE_WTMP)
1020 if test -n "$conf_wtmp_location"; then
1021 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1025 dnl utmpx detection - I don't know any system so perverse as to require
1026 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1028 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1030 #include <sys/types.h>
1039 [ char *utmpx = UTMPX_FILE; ],
1040 [ AC_MSG_RESULT(yes) ],
1042 system_utmpx_path=no ]
1044 if test -z "$conf_utmpx_location"; then
1045 if test x"$system_utmpx_path" = x"no" ; then
1046 AC_DEFINE(DISABLE_UTMPX)
1049 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1053 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1055 #include <sys/types.h>
1064 [ char *wtmpx = WTMPX_FILE; ],
1065 [ AC_MSG_RESULT(yes) ],
1067 system_wtmpx_path=no ]
1069 if test -z "$conf_wtmpx_location"; then
1070 if test x"$system_wtmpx_path" = x"no" ; then
1071 AC_DEFINE(DISABLE_WTMPX)
1074 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1078 # Change default command timeout for builtin PRNG
1080 AC_ARG_WITH(entropy-timeout,
1081 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1083 if test "x$withval" != "xno" ; then
1084 entropy_timeout=$withval
1088 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1091 if test ! -z "$blibpath" ; then
1092 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1093 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1096 AC_OUTPUT(Makefile ssh_prng_cmds)