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"
88 CFLAGS="$CFLAGS -I/usr/local/include"
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"
109 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
110 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
111 if test "$sol2ver" -ge 8; then
113 AC_DEFINE(DISABLE_UTMP)
114 AC_DEFINE(DISABLE_WTMP)
120 CFLAGS="$CFLAGS -DSUNOS4"
121 AC_CHECK_FUNCS(getpwanam)
124 CFLAGS="$CFLAGS -I/usr/local/include"
125 LDFLAGS="$LDFLAGS -L/usr/local/lib"
128 LIBS="$LIBS -lgen -lsocket"
132 # Allow user to specify flags
134 [ --with-cflags Specify additional flags to pass to compiler],
136 if test "x$withval" != "xno" ; then
137 CFLAGS="$CFLAGS $withval"
142 [ --with-ldlags Specify additional flags to pass to linker],
144 if test "x$withval" != "xno" ; then
145 LDFLAGS="$LDFLAGS $withval"
150 [ --with-libs Specify additional libraries to link with],
152 if test "x$withval" != "xno" ; then
153 LIBS="$LIBS $withval"
159 # Checks for libraries.
160 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
161 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
163 if test -z "$no_libsocket" ; then
164 AC_CHECK_LIB(nsl, yp_match, , )
166 if test -z "$no_libnsl" ; then
167 AC_CHECK_LIB(socket, main, , )
170 # Checks for header files.
171 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)
173 # Checks for library functions.
174 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)
175 dnl checks for time functions
176 AC_CHECK_FUNCS(gettimeofday time)
177 dnl checks for libutil functions
178 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
179 dnl checks for utmp functions
180 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
181 AC_CHECK_FUNCS(utmpname)
182 dnl checks for utmpx functions
183 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
184 AC_CHECK_FUNCS(setutxent utmpxname)
187 [AC_DEFINE(HAVE_LOGIN)],
188 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
191 AC_CHECK_FUNC(daemon,
192 [AC_DEFINE(HAVE_DAEMON)],
193 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
196 AC_CHECK_FUNC(getpagesize,
197 [AC_DEFINE(HAVE_GETPAGESIZE)],
198 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
202 [ --without-pam Disable PAM support ],
204 if test "x$withval" = "xno" ; then
206 AC_DEFINE(DISABLE_PAM)
210 if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
211 AC_CHECK_LIB(dl, dlopen, , )
214 AC_CHECK_FUNCS(pam_getenvlist)
216 # Check PAM strerror arguments (old PAM)
217 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
221 #include <security/pam_appl.h>
223 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
226 AC_DEFINE(HAVE_OLD_PAM)
232 # The big search for OpenSSL
234 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
236 if test "x$withval" != "$xno" ; then
243 saved_LDFLAGS="$LDFLAGS"
244 saved_CFLAGS="$CFLAGS"
245 if test "x$prefix" != "xNONE" ; then
246 tryssldir="$tryssldir $prefix"
248 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
250 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
251 if test ! -z "$ssldir" ; then
252 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
253 CFLAGS="$saved_CFLAGS -I$ssldir/include"
254 if test ! -z "$need_dash_r" ; then
255 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
258 LDFLAGS="$saved_LDFLAGS"
261 LIBS="$saved_LIBS -lcrypto"
263 # Basic test to check for compatible version and correct linking
264 # *does not* test for RSA - that comes later.
268 #include <openssl/rand.h>
272 memset(a, 0, sizeof(a));
273 RAND_add(a, sizeof(a), sizeof(a));
274 return(RAND_status() <= 0);
283 if test ! -z "$found_crypto" ; then
288 if test -z "$found_crypto" ; then
289 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
291 if test -z "$ssldir" ; then
295 ac_cv_openssldir=$ssldir
298 if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
299 AC_DEFINE(HAVE_OPENSSL)
300 dnl Need to recover ssldir - test above runs in subshell
301 ssldir=$ac_cv_openssldir
302 CFLAGS="$saved_CFLAGS -I$ssldir/include"
303 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
304 if test ! -z "$need_dash_r" ; then
305 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
307 if test ! -z "$blibpath" ; then
308 blibpath="$blibpath:$ssldir:$ssldir/lib"
311 LIBS="$saved_LIBS -lcrypto"
313 # Now test RSA support
315 AC_MSG_CHECKING([for RSA support])
316 for WANTS_RSAREF in "" 1 ; do
317 if test -z "$WANTS_RSAREF" ; then
320 LIBS="$saved_LIBS -lRSAglue -lrsaref"
324 #include <openssl/rand.h>
325 #include <openssl/rsa.h>
326 #include <openssl/bn.h>
327 #include <openssl/sha.h>
330 int num; RSA *key; static unsigned char p_in[] = "blahblah";
331 unsigned char c[256], p[256];
332 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
333 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
334 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
335 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
344 if test ! -z "$no_rsa" ; then
345 AC_MSG_RESULT(disabled)
347 if test -z "$rsa_works" ; then
348 AC_MSG_WARN([*** No RSA support found *** ])
350 if test -z "$WANTS_RSAREF" ; then
353 AC_MSG_RESULT(using RSAref)
354 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
359 # Checks for data types
360 AC_CHECK_SIZEOF(char, 1)
361 AC_CHECK_SIZEOF(short int, 2)
362 AC_CHECK_SIZEOF(int, 4)
363 AC_CHECK_SIZEOF(long int, 4)
364 AC_CHECK_SIZEOF(long long int, 8)
366 # More checks for data types
367 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
369 [ #include <sys/types.h> ],
370 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
371 [ ac_cv_have_intxx_t="yes" ],
372 [ ac_cv_have_intxx_t="no" ]
375 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
376 AC_DEFINE(HAVE_INTXX_T)
380 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
382 [ #include <sys/types.h> ],
383 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
384 [ ac_cv_have_u_intxx_t="yes" ],
385 [ ac_cv_have_u_intxx_t="no" ]
388 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
389 AC_DEFINE(HAVE_U_INTXX_T)
394 if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
395 "x$ac_cv_header_sys_bitypes_h" = "xyes"
397 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
400 #include <sys/bitypes.h>
403 int8_t a; int16_t b; int32_t c;
404 u_int8_t e; u_int16_t f; u_int32_t g;
405 a = b = c = e = f = g = 1;
408 AC_DEFINE(HAVE_U_INTXX_T)
409 AC_DEFINE(HAVE_INTXX_T)
416 if test -z "$have_u_intxx_t" ; then
417 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
420 #include <sys/types.h>
422 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
423 [ ac_cv_have_uintxx_t="yes" ],
424 [ ac_cv_have_uintxx_t="no" ]
427 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
428 AC_DEFINE(HAVE_UINTXX_T)
432 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
435 #include <sys/types.h>
436 #include <sys/socket.h>
438 [socklen_t foo; foo = 1235;],
439 [ ac_cv_have_socklen_t="yes" ],
440 [ ac_cv_have_socklen_t="no" ]
443 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
444 AC_DEFINE(HAVE_SOCKLEN_T)
447 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
450 #include <sys/types.h>
452 [ size_t foo; foo = 1235; ],
453 [ ac_cv_have_size_t="yes" ],
454 [ ac_cv_have_size_t="no" ]
457 if test "x$ac_cv_have_size_t" = "xyes" ; then
458 AC_DEFINE(HAVE_SIZE_T)
461 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
464 #include <sys/types.h>
466 [ ssize_t foo; foo = 1235; ],
467 [ ac_cv_have_ssize_t="yes" ],
468 [ ac_cv_have_ssize_t="no" ]
471 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
472 AC_DEFINE(HAVE_SSIZE_T)
476 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
479 #include <sys/types.h>
480 #include <sys/socket.h>
482 [ struct sockaddr_storage s; ],
483 [ ac_cv_have_struct_sockaddr_storage="yes" ],
484 [ ac_cv_have_struct_sockaddr_storage="no" ]
487 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
488 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
491 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
494 #include <netinet/in.h>
496 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
497 [ ac_cv_have_struct_sockaddr_in6="yes" ],
498 [ ac_cv_have_struct_sockaddr_in6="no" ]
501 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
502 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
505 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
508 #include <netinet/in.h>
510 [ struct in6_addr s; s.s6_addr[0] = 0; ],
511 [ ac_cv_have_struct_in6_addr="yes" ],
512 [ ac_cv_have_struct_in6_addr="no" ]
515 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
516 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
519 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
522 #include <sys/types.h>
523 #include <sys/socket.h>
526 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
527 [ ac_cv_have_struct_addrinfo="yes" ],
528 [ ac_cv_have_struct_addrinfo="no" ]
531 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
532 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
536 # Checks for structure members
538 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
539 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
540 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
541 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
542 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
543 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
544 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
545 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
546 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
547 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
548 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
549 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
550 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
551 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
552 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
553 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
557 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
558 ac_cv_have_ss_family_in_struct_ss, [
561 #include <sys/types.h>
562 #include <sys/socket.h>
564 [ struct sockaddr_storage s; s.ss_family = 1; ],
565 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
566 [ ac_cv_have_ss_family_in_struct_ss="no" ],
569 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
570 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
574 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
575 ac_cv_have___ss_family_in_struct_ss, [
578 #include <sys/types.h>
579 #include <sys/socket.h>
581 [ struct sockaddr_storage s; s.__ss_family = 1; ],
582 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
583 [ ac_cv_have___ss_family_in_struct_ss="no" ]
586 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
587 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
591 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
593 [ extern char *__progname; printf("%s", __progname); ],
594 [ ac_cv_libc_defines___progname="yes" ],
595 [ ac_cv_libc_defines___progname="no" ]
598 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
599 AC_DEFINE(HAVE___PROGNAME)
603 # Looking for programs, paths and files
605 [ --with-rsh=PATH Specify path to remote shell program ],
607 if test "x$withval" != "$no" ; then
608 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
612 AC_PATH_PROG(rsh_path, rsh)
617 [ --with-xauth=PATH Specify path to xauth program ],
619 if test "x$withval" != "$xno" ; then
620 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval")
624 AC_PATH_PROG(xauth_path, xauth)
625 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
626 xauth_path="/usr/openwin/bin/xauth"
631 if test ! -z "$xauth_path" ; then
632 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
634 if test ! -z "$rsh_path" ; then
635 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
638 # Check for mail directory (last resort if we cannot get it from headers)
639 if test ! -z "$MAIL" ; then
640 maildir=`dirname $MAIL`
641 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
644 if test -z "$no_dev_ptmx" ; then
645 AC_CHECK_FILE("/dev/ptmx",
647 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
652 AC_CHECK_FILE("/dev/ptc",
654 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
659 # Options from here on. Some of these are preset by platform above
661 # Check for user-specified random device, otherwise check /dev/urandom
663 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
665 if test "x$withval" != "xno" ; then
666 RANDOM_POOL="$withval";
667 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
671 # Check for random device
672 AC_CHECK_FILE("/dev/urandom",
674 RANDOM_POOL="/dev/urandom";
675 AC_SUBST(RANDOM_POOL)
676 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
682 # Check for EGD pool file
683 AC_ARG_WITH(egd-pool,
684 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
686 if test "x$withval" != "xno" ; then
687 EGD_SOCKET="$withval";
688 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
693 # detect pathnames for entropy gathering commands, if we need them
694 INSTALL_SSH_PRNG_CMDS=""
696 if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
697 # Use these commands to collect entropy
698 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
699 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
700 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
701 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
702 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
703 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
704 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
705 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
706 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
707 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
708 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
709 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
710 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
711 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
712 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
714 INSTALL_SSH_PRNG_CMDS="yes"
716 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
720 [ --with-catman=man|cat Install preformatted manpages[no]],
723 if test x"$withval" != x"yes" ; then
729 if test -z "$MANTYPE" ; then
730 MANTYPE='$(TROFFMAN)'
738 # Check whether user wants Kerberos support
739 AC_ARG_WITH(kerberos4,
740 [ --with-kerberos4=PATH Enable Kerberos 4 support],
742 if test "x$withval" != "xno" ; then
744 if test "x$withval" != "$xyes" ; then
745 CFLAGS="$CFLAGS -I${withval}/include"
746 LDFLAGS="$LDFLAGS -L${withval}/lib"
747 if test ! -z "$need_dash_r" ; then
748 LDFLAGS="$LDFLAGS -R${withval}/lib"
750 if test ! -z "$blibpath" ; then
751 blibpath="$blibpath:${withval}/lib"
754 if test -d /usr/include/kerberosIV ; then
755 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
759 AC_CHECK_HEADERS(krb.h)
760 AC_CHECK_LIB(krb, main)
761 if test "$ac_cv_header_krb_h" != yes; then
762 AC_MSG_WARN([Cannot find krb.h, build may fail])
764 if test "$ac_cv_lib_krb_main" != yes; then
765 AC_MSG_WARN([Cannot find libkrb, build may fail])
769 AC_CHECK_LIB(resolv, dn_expand, , )
776 # Check whether user wants AFS support
778 [ --with-afs=PATH Enable AFS support],
780 if test "x$withval" != "xno" ; then
782 if test "x$withval" != "$xyes" ; then
783 CFLAGS="$CFLAGS -I${withval}/include"
784 LFLAGS="$LFLAGS -L${withval}/lib"
787 if test -z "$KRB4" ; then
788 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
792 if test ! -z "$AFS_LIBS" ; then
793 LIBS="$LIBS $AFS_LIBS"
801 # Check whether user wants S/Key support
803 [ --with-skey Enable S/Key support],
805 if test "x$withval" != "xno" ; then
812 # Check whether user wants TCP wrappers support
813 AC_ARG_WITH(tcp-wrappers,
814 [ --with-tcp-wrappers Enable tcpwrappers support],
816 if test "x$withval" != "xno" ; then
819 AC_MSG_CHECKING(for libwrap)
823 int deny_severity = 0, allow_severity = 0;
832 AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***])
840 # Check whether to enable MD5 passwords
841 AC_ARG_WITH(md5-passwords,
842 [ --with-md5-passwords Enable use of MD5 passwords],
844 if test "x$withval" != "xno" ; then
845 AC_DEFINE(HAVE_MD5_PASSWORDS)
850 # Whether to disable shadow password support
852 [ --without-shadow Disable shadow password support],
854 if test "x$withval" = "xno" ; then
855 AC_DEFINE(DISABLE_SHADOW)
860 # Use ip address instead of hostname in $DISPLAY
861 AC_ARG_WITH(ipaddr-display,
862 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
864 if test "x$withval" = "xno" ; then
865 AC_DEFINE(IPADDR_IN_DISPLAY)
870 # Whether to mess with the default path
871 AC_ARG_WITH(default-path,
872 [ --with-default-path=PATH Specify default \$PATH environment for server],
874 if test "x$withval" != "xno" ; then
875 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
880 # Whether to force IPv4 by default (needed on broken glibc Linux)
881 AC_ARG_WITH(ipv4-default,
882 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
884 if test "x$withval" != "xno" ; then
885 AC_DEFINE(IPV4_DEFAULT)
890 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
892 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
894 if test "x$withval" != "xno" ; then
896 AC_DEFINE(IPV4_IN_IPV6)
901 if test "x$inet6_default_4in6" = "xyes"; then
902 AC_MSG_RESULT([yes (default)])
903 AC_DEFINE(IPV4_IN_IPV6)
905 AC_MSG_RESULT([no (default)])
910 # Where to place sshd.pid
913 [ --with-pid-dir=PATH Specify location of ssh.pid file],
915 if test "x$withval" != "xno" ; then
921 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
924 dnl allow user to disable some login recording features
925 AC_ARG_ENABLE(lastlog,
926 [ --disable-lastlog disable use of lastlog even if detected [no]],
927 [ AC_DEFINE(DISABLE_LASTLOG) ]
930 [ --disable-utmp disable use of utmp even if detected [no]],
931 [ AC_DEFINE(DISABLE_UTMP) ]
934 [ --disable-utmpx disable use of utmpx even if detected [no]],
935 [ AC_DEFINE(DISABLE_UTMPX) ]
938 [ --disable-wtmp disable use of wtmp even if detected [no]],
939 [ AC_DEFINE(DISABLE_WTMP) ]
942 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
943 [ AC_DEFINE(DISABLE_WTMPX) ]
945 AC_ARG_ENABLE(libutil,
946 [ --disable-libutil disable use of libutil (login() etc.) [no]],
947 [ AC_DEFINE(DISABLE_LOGIN) ]
949 AC_ARG_ENABLE(pututline,
950 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
951 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
953 AC_ARG_ENABLE(pututxline,
954 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
955 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
958 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
959 [ conf_lastlog_location="$withval"; ],)
961 dnl lastlog, [uw]tmpx? detection
962 dnl NOTE: set the paths in the platform section to avoid the
963 dnl need for command-line parameters
964 dnl lastlog and [uw]tmp are subject to a file search if all else fails
966 dnl lastlog detection
967 dnl NOTE: the code itself will detect if lastlog is a directory
968 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
970 #include <sys/types.h>
972 #ifdef HAVE_LASTLOG_H
973 # include <lastlog.h>
979 [ char *lastlog = LASTLOG_FILE; ],
980 [ AC_MSG_RESULT(yes) ],
983 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
985 #include <sys/types.h>
987 #ifdef HAVE_LASTLOG_H
988 # include <lastlog.h>
994 [ char *lastlog = _PATH_LASTLOG; ],
995 [ AC_MSG_RESULT(yes) ],
998 system_lastlog_path=no
1003 if test -z "$conf_lastlog_location"; then
1004 if test x"$system_lastlog_path" = x"no" ; then
1005 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1006 if test -d "$f" -o -e "$f" ; then
1007 conf_lastlog_location=$f
1010 if test -z "$conf_lastlog_location"; then
1011 AC_MSG_WARN([** Cannot find lastlog - disabling feature **])
1012 AC_DEFINE(DISABLE_LASTLOG)
1017 if test -n "$conf_lastlog_location"; then
1018 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1022 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1024 #include <sys/types.h>
1030 [ char *utmp = UTMP_FILE; ],
1031 [ AC_MSG_RESULT(yes) ],
1033 system_utmp_path=no ]
1035 if test -z "$conf_utmp_location"; then
1036 if test x"$system_utmp_path" = x"no" ; then
1037 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1038 if test -f $f ; then
1039 conf_utmp_location=$f
1042 if test -z "$conf_utmp_location"; then
1043 AC_DEFINE(DISABLE_UTMP)
1047 if test -n "$conf_utmp_location"; then
1048 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1052 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1054 #include <sys/types.h>
1060 [ char *wtmp = WTMP_FILE; ],
1061 [ AC_MSG_RESULT(yes) ],
1063 system_wtmp_path=no ]
1065 if test -z "$conf_wtmp_location"; then
1066 if test x"$system_wtmp_path" = x"no" ; then
1067 for f in /usr/adm/wtmp /var/log/wtmp; do
1068 if test -f $f ; then
1069 conf_wtmp_location=$f
1072 if test -z "$conf_wtmp_location"; then
1073 AC_DEFINE(DISABLE_WTMP)
1077 if test -n "$conf_wtmp_location"; then
1078 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1082 dnl utmpx detection - I don't know any system so perverse as to require
1083 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1085 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1087 #include <sys/types.h>
1096 [ char *utmpx = UTMPX_FILE; ],
1097 [ AC_MSG_RESULT(yes) ],
1099 system_utmpx_path=no ]
1101 if test -z "$conf_utmpx_location"; then
1102 if test x"$system_utmpx_path" = x"no" ; then
1103 AC_DEFINE(DISABLE_UTMPX)
1106 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1110 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1112 #include <sys/types.h>
1121 [ char *wtmpx = WTMPX_FILE; ],
1122 [ AC_MSG_RESULT(yes) ],
1124 system_wtmpx_path=no ]
1126 if test -z "$conf_wtmpx_location"; then
1127 if test x"$system_wtmpx_path" = x"no" ; then
1128 AC_DEFINE(DISABLE_WTMPX)
1131 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1135 # Change default command timeout for builtin PRNG
1137 AC_ARG_WITH(entropy-timeout,
1138 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1140 if test "x$withval" != "xno" ; then
1141 entropy_timeout=$withval
1145 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1148 if test ! -z "$blibpath" ; then
1149 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1150 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1153 AC_OUTPUT(Makefile ssh_prng_cmds)