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" && test -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 dnl AIX handles lastlog as part of its login message
42 AC_DEFINE(DISABLE_LASTLOG)
45 if test -z "$GCC"; then
48 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
49 AC_DEFINE(IPADDR_IN_DISPLAY)
50 AC_MSG_CHECKING(for HPUX trusted system password database)
51 if test -f /tcb/files/auth/system/default; then
53 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
55 AC_MSG_WARN([This configuration is untested])
58 AC_DEFINE(DISABLE_SHADOW)
64 if test -z "$GCC"; then
67 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
68 AC_DEFINE(IPADDR_IN_DISPLAY)
69 AC_MSG_CHECKING(for HPUX trusted system password database)
70 if test -f /tcb/files/auth/system/default; then
72 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
74 AC_MSG_WARN([This configuration is untested])
77 AC_DEFINE(DISABLE_SHADOW)
83 CFLAGS="$CFLAGS -I/usr/local/include"
90 CFLAGS="$CFLAGS -I/usr/local/include"
93 AC_DEFINE(WITH_IRIX_ARRAY)
94 AC_DEFINE(WITH_IRIX_PROJECT)
95 AC_DEFINE(WITH_IRIX_AUDIT)
101 AC_DEFINE(DONT_TRY_OTHER_AF)
102 inet6_default_4in6=yes
108 # hardwire lastlog location (can't detect it on some versions)
109 conf_lastlog_location="/usr/adm/lastlog"
111 CFLAGS="$CFLAGS -I/usr/local/include"
113 conf_utmp_location=/etc/utmp
114 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
115 AC_MSG_WARN([*** Expect 'scp' to fail!])
116 AC_MSG_WARN([*** Please report any problems, thanks])
119 CFLAGS="$CFLAGS -I/usr/local/include"
120 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
122 # hardwire lastlog location (can't detect it on some versions)
123 conf_lastlog_location="/var/adm/lastlog"
124 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
125 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
126 if test "$sol2ver" -ge 8; then
128 AC_DEFINE(DISABLE_UTMP)
129 AC_DEFINE(DISABLE_WTMP)
135 CFLAGS="$CFLAGS -DSUNOS4"
136 AC_CHECK_FUNCS(getpwanam)
139 CFLAGS="$CFLAGS -I/usr/local/include"
140 LDFLAGS="$LDFLAGS -L/usr/local/lib"
143 LIBS="$LIBS -lgen -lsocket"
146 CFLAGS="$CFLAGS -I/usr/local/include"
147 LDFLAGS="$LDFLAGS -L/usr/local/lib"
150 LIBS="$LIBS -lgen -lsocket"
155 # Allow user to specify flags
157 [ --with-cflags Specify additional flags to pass to compiler],
159 if test "x$withval" != "xno" ; then
160 CFLAGS="$CFLAGS $withval"
165 [ --with-ldlags Specify additional flags to pass to linker],
167 if test "x$withval" != "xno" ; then
168 LDFLAGS="$LDFLAGS $withval"
173 [ --with-libs Specify additional libraries to link with],
175 if test "x$withval" != "xno" ; then
176 LIBS="$LIBS $withval"
182 # Checks for libraries.
183 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
184 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
186 if test -z "$no_libsocket" ; then
187 AC_CHECK_LIB(nsl, yp_match, , )
189 if test -z "$no_libnsl" ; then
190 AC_CHECK_LIB(socket, main, , )
193 # Checks for header files.
194 AC_CHECK_HEADERS(bstring.h endian.h lastlog.h limits.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/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h util.h utmp.h utmpx.h)
196 # Checks for library functions.
197 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)
198 dnl checks for time functions
199 AC_CHECK_FUNCS(gettimeofday time)
200 dnl checks for libutil functions
201 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
202 dnl checks for utmp functions
203 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
204 AC_CHECK_FUNCS(utmpname)
205 dnl checks for utmpx functions
206 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
207 AC_CHECK_FUNCS(setutxent utmpxname)
210 [AC_DEFINE(HAVE_LOGIN)],
211 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
214 AC_CHECK_FUNC(daemon,
215 [AC_DEFINE(HAVE_DAEMON)],
216 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
219 AC_CHECK_FUNC(getpagesize,
220 [AC_DEFINE(HAVE_GETPAGESIZE)],
221 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
226 [ --without-pam Disable PAM support ],
228 if test "x$withval" = "xno" ; then
230 AC_DEFINE(DISABLE_PAM)
235 if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
236 AC_CHECK_LIB(dl, dlopen, , )
239 AC_CHECK_FUNCS(pam_getenvlist)
245 # Check PAM strerror arguments (old PAM)
246 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
250 #include <security/pam_appl.h>
252 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
255 AC_DEFINE(HAVE_OLD_PAM)
257 PAM_MSG="yes (old library)"
262 # The big search for OpenSSL
264 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
266 if test "x$withval" != "$xno" ; then
273 saved_LDFLAGS="$LDFLAGS"
274 saved_CFLAGS="$CFLAGS"
275 if test "x$prefix" != "xNONE" ; then
276 tryssldir="$tryssldir $prefix"
278 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
280 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
281 if test ! -z "$ssldir" ; then
282 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
283 CFLAGS="$saved_CFLAGS -I$ssldir/include"
284 if test ! -z "$need_dash_r" ; then
285 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
288 LDFLAGS="$saved_LDFLAGS"
291 LIBS="$saved_LIBS -lcrypto"
293 # Basic test to check for compatible version and correct linking
294 # *does not* test for RSA - that comes later.
298 #include <openssl/rand.h>
302 memset(a, 0, sizeof(a));
303 RAND_add(a, sizeof(a), sizeof(a));
304 return(RAND_status() <= 0);
313 if test ! -z "$found_crypto" ; then
318 if test -z "$found_crypto" ; then
319 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
321 if test -z "$ssldir" ; then
325 ac_cv_openssldir=$ssldir
328 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
329 AC_DEFINE(HAVE_OPENSSL)
330 dnl Need to recover ssldir - test above runs in subshell
331 ssldir=$ac_cv_openssldir
332 CFLAGS="$saved_CFLAGS -I$ssldir/include"
333 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
334 if test ! -z "$need_dash_r" ; then
335 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
337 if test ! -z "$blibpath" ; then
338 blibpath="$blibpath:$ssldir:$ssldir/lib"
341 LIBS="$saved_LIBS -lcrypto"
343 # Now test RSA support
345 AC_MSG_CHECKING([for RSA support])
346 for WANTS_RSAREF in "" 1 ; do
347 if test -z "$WANTS_RSAREF" ; then
350 LIBS="$saved_LIBS -lRSAglue -lrsaref"
354 #include <openssl/rand.h>
355 #include <openssl/rsa.h>
356 #include <openssl/bn.h>
357 #include <openssl/sha.h>
360 int num; RSA *key; static unsigned char p_in[] = "blahblah";
361 unsigned char c[256], p[256];
362 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
363 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
364 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
365 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
374 if test ! -z "$no_rsa" ; then
375 AC_MSG_RESULT(disabled)
378 if test -z "$rsa_works" ; then
379 AC_MSG_WARN([*** No RSA support found *** ])
382 if test -z "$WANTS_RSAREF" ; then
386 RSA_MSG="yes (using RSAref)"
387 AC_MSG_RESULT(using RSAref)
388 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
393 # Checks for data types
394 AC_CHECK_SIZEOF(char, 1)
395 AC_CHECK_SIZEOF(short int, 2)
396 AC_CHECK_SIZEOF(int, 4)
397 AC_CHECK_SIZEOF(long int, 4)
398 AC_CHECK_SIZEOF(long long int, 8)
400 # More checks for data types
401 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
403 [ #include <sys/types.h> ],
404 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
405 [ ac_cv_have_intxx_t="yes" ],
406 [ ac_cv_have_intxx_t="no" ]
409 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
410 AC_DEFINE(HAVE_INTXX_T)
414 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
416 [ #include <sys/types.h> ],
417 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
418 [ ac_cv_have_u_intxx_t="yes" ],
419 [ ac_cv_have_u_intxx_t="no" ]
422 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
423 AC_DEFINE(HAVE_U_INTXX_T)
428 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
429 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
431 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
434 #include <sys/bitypes.h>
437 int8_t a; int16_t b; int32_t c;
438 u_int8_t e; u_int16_t f; u_int32_t g;
439 a = b = c = e = f = g = 1;
442 AC_DEFINE(HAVE_U_INTXX_T)
443 AC_DEFINE(HAVE_INTXX_T)
450 if test -z "$have_u_intxx_t" ; then
451 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
454 #include <sys/types.h>
456 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
457 [ ac_cv_have_uintxx_t="yes" ],
458 [ ac_cv_have_uintxx_t="no" ]
461 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
462 AC_DEFINE(HAVE_UINTXX_T)
466 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
469 #include <sys/types.h>
470 #include <sys/socket.h>
472 [socklen_t foo; foo = 1235;],
473 [ ac_cv_have_socklen_t="yes" ],
474 [ ac_cv_have_socklen_t="no" ]
477 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
478 AC_DEFINE(HAVE_SOCKLEN_T)
481 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
484 #include <sys/types.h>
486 [ size_t foo; foo = 1235; ],
487 [ ac_cv_have_size_t="yes" ],
488 [ ac_cv_have_size_t="no" ]
491 if test "x$ac_cv_have_size_t" = "xyes" ; then
492 AC_DEFINE(HAVE_SIZE_T)
495 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
498 #include <sys/types.h>
500 [ ssize_t foo; foo = 1235; ],
501 [ ac_cv_have_ssize_t="yes" ],
502 [ ac_cv_have_ssize_t="no" ]
505 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
506 AC_DEFINE(HAVE_SSIZE_T)
509 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
512 #include <sys/types.h>
513 #include <sys/socket.h>
515 [ sa_family_t foo; foo = 1235; ],
516 [ ac_cv_have_sa_family_t="yes" ],
517 [ ac_cv_have_sa_family_t="no" ]
520 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
521 AC_DEFINE(HAVE_SA_FAMILY_T)
524 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
527 #include <sys/types.h>
529 [ pid_t foo; foo = 1235; ],
530 [ ac_cv_have_pid_t="yes" ],
531 [ ac_cv_have_pid_t="no" ]
534 if test "x$ac_cv_have_pid_t" = "xyes" ; then
535 AC_DEFINE(HAVE_PID_T)
538 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
541 #include <sys/types.h>
543 [ mode_t foo; foo = 1235; ],
544 [ ac_cv_have_mode_t="yes" ],
545 [ ac_cv_have_mode_t="no" ]
548 if test "x$ac_cv_have_mode_t" = "xyes" ; then
549 AC_DEFINE(HAVE_MODE_T)
553 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
556 #include <sys/types.h>
557 #include <sys/socket.h>
559 [ struct sockaddr_storage s; ],
560 [ ac_cv_have_struct_sockaddr_storage="yes" ],
561 [ ac_cv_have_struct_sockaddr_storage="no" ]
564 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
565 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
568 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
571 #include <sys/types.h>
572 #include <netinet/in.h>
574 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
575 [ ac_cv_have_struct_sockaddr_in6="yes" ],
576 [ ac_cv_have_struct_sockaddr_in6="no" ]
579 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
580 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
583 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
586 #include <sys/types.h>
587 #include <netinet/in.h>
589 [ struct in6_addr s; s.s6_addr[0] = 0; ],
590 [ ac_cv_have_struct_in6_addr="yes" ],
591 [ ac_cv_have_struct_in6_addr="no" ]
594 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
595 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
598 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
601 #include <sys/types.h>
602 #include <sys/socket.h>
605 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
606 [ ac_cv_have_struct_addrinfo="yes" ],
607 [ ac_cv_have_struct_addrinfo="no" ]
610 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
611 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
615 # Checks for structure members
617 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
618 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
619 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
620 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
621 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
622 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
623 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
624 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
625 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
626 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
627 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
628 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
629 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
630 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
631 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
632 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
634 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
635 ac_cv_have_ss_family_in_struct_ss, [
638 #include <sys/types.h>
639 #include <sys/socket.h>
641 [ struct sockaddr_storage s; s.ss_family = 1; ],
642 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
643 [ ac_cv_have_ss_family_in_struct_ss="no" ],
646 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
647 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
650 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
651 ac_cv_have___ss_family_in_struct_ss, [
654 #include <sys/types.h>
655 #include <sys/socket.h>
657 [ struct sockaddr_storage s; s.__ss_family = 1; ],
658 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
659 [ ac_cv_have___ss_family_in_struct_ss="no" ]
662 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
663 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
667 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
669 [ extern char *__progname; printf("%s", __progname); ],
670 [ ac_cv_libc_defines___progname="yes" ],
671 [ ac_cv_libc_defines___progname="no" ]
674 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
675 AC_DEFINE(HAVE___PROGNAME)
679 # Looking for programs, paths and files
681 [ --with-rsh=PATH Specify path to remote shell program ],
683 if test "x$withval" != "$no" ; then
688 AC_PATH_PROG(rsh_path, rsh)
693 [ --with-xauth=PATH Specify path to xauth program ],
695 if test "x$withval" != "$xno" ; then
700 AC_PATH_PROG(xauth_path, xauth)
701 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
702 xauth_path="/usr/openwin/bin/xauth"
707 if test ! -z "$xauth_path" ; then
708 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
710 if test ! -z "$rsh_path" ; then
711 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
714 # Check for mail directory (last resort if we cannot get it from headers)
715 if test ! -z "$MAIL" ; then
716 maildir=`dirname $MAIL`
717 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
720 if test -z "$no_dev_ptmx" ; then
721 AC_CHECK_FILE("/dev/ptmx",
723 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
728 AC_CHECK_FILE("/dev/ptc",
730 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
735 # Options from here on. Some of these are preset by platform above
737 # Check for user-specified random device, otherwise check /dev/urandom
739 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
741 if test "x$withval" != "xno" ; then
742 RANDOM_POOL="$withval";
743 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
747 # Check for random device
748 AC_CHECK_FILE("/dev/urandom",
750 RANDOM_POOL="/dev/urandom";
751 AC_SUBST(RANDOM_POOL)
752 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
758 # Check for EGD pool file
759 AC_ARG_WITH(egd-pool,
760 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
762 if test "x$withval" != "xno" ; then
763 EGD_SOCKET="$withval";
764 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
769 # detect pathnames for entropy gathering commands, if we need them
770 INSTALL_SSH_PRNG_CMDS=""
772 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
773 # Use these commands to collect entropy
774 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
775 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
776 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
777 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
778 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
779 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
780 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
781 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
782 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
783 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
784 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
785 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
786 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
787 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
788 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
790 INSTALL_SSH_PRNG_CMDS="yes"
792 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
796 [ --with-catman=man|cat Install preformatted manpages[no]],
799 if test x"$withval" != x"yes" ; then
805 if test -z "$MANTYPE" ; then
806 MANTYPE='$(TROFFMAN)'
814 # Check whether user wants Kerberos support
816 AC_ARG_WITH(kerberos4,
817 [ --with-kerberos4=PATH Enable Kerberos 4 support],
819 if test "x$withval" != "xno" ; then
821 if test "x$withval" != "$xyes" ; then
822 CFLAGS="$CFLAGS -I${withval}/include"
823 LDFLAGS="$LDFLAGS -L${withval}/lib"
824 if test ! -z "$need_dash_r" ; then
825 LDFLAGS="$LDFLAGS -R${withval}/lib"
827 if test ! -z "$blibpath" ; then
828 blibpath="$blibpath:${withval}/lib"
831 if test -d /usr/include/kerberosIV ; then
832 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
836 AC_CHECK_HEADERS(krb.h)
837 AC_CHECK_LIB(krb, main)
838 if test "$ac_cv_header_krb_h" != yes; then
839 AC_MSG_WARN([Cannot find krb.h, build may fail])
841 if test "$ac_cv_lib_krb_main" != yes; then
842 AC_MSG_WARN([Cannot find libkrb, build may fail])
846 AC_CHECK_LIB(resolv, dn_expand, , )
854 # Check whether user wants AFS support
857 [ --with-afs=PATH Enable AFS support],
859 if test "x$withval" != "xno" ; then
861 if test "x$withval" != "$xyes" ; then
862 CFLAGS="$CFLAGS -I${withval}/include"
863 LFLAGS="$LFLAGS -L${withval}/lib"
866 if test -z "$KRB4" ; then
867 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
871 if test ! -z "$AFS_LIBS" ; then
872 LIBS="$LIBS $AFS_LIBS"
881 # Check whether user wants S/Key support
884 [ --with-skey Enable S/Key support],
886 if test "x$withval" != "xno" ; then
894 # Check whether user wants TCP wrappers support
896 AC_ARG_WITH(tcp-wrappers,
897 [ --with-tcp-wrappers Enable tcpwrappers support],
899 if test "x$withval" != "xno" ; then
902 AC_MSG_CHECKING(for libwrap)
906 int deny_severity = 0, allow_severity = 0;
915 AC_MSG_ERROR([*** libwrap missing])
922 # Check whether to enable MD5 passwords
924 AC_ARG_WITH(md5-passwords,
925 [ --with-md5-passwords Enable use of MD5 passwords],
927 if test "x$withval" != "xno" ; then
928 AC_DEFINE(HAVE_MD5_PASSWORDS)
934 # Whether to disable shadow password support
936 [ --without-shadow Disable shadow password support],
938 if test "x$withval" = "xno" ; then
939 AC_DEFINE(DISABLE_SHADOW)
945 if test -z "$disable_shadow" ; then
946 AC_MSG_CHECKING([if the systems has expire shadow information])
949 #include <sys/types.h>
952 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
953 [ sp_expire_available=yes ], []
956 if test "x$sp_expire_available" = "xyes" ; then
958 AC_DEFINE(HAS_SHADOW_EXPIRE)
964 # Use ip address instead of hostname in $DISPLAY
965 DISPLAY_HACK_MSG="no"
966 AC_ARG_WITH(ipaddr-display,
967 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
969 if test "x$withval" = "xno" ; then
970 AC_DEFINE(IPADDR_IN_DISPLAY)
971 DISPLAY_HACK_MSG="yes"
976 # Whether to mess with the default path
977 SERVER_PATH_MSG="(default)"
978 AC_ARG_WITH(default-path,
979 [ --with-default-path=PATH Specify default \$PATH environment for server],
981 if test "x$withval" != "xno" ; then
982 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
983 SERVER_PATH_MSG="$withval"
988 # Whether to force IPv4 by default (needed on broken glibc Linux)
990 AC_ARG_WITH(ipv4-default,
991 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
993 if test "x$withval" != "xno" ; then
994 AC_DEFINE(IPV4_DEFAULT)
1000 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1001 IPV4_IN6_HACK_MSG="no"
1003 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1005 if test "x$withval" != "xno" ; then
1007 AC_DEFINE(IPV4_IN_IPV6)
1008 IPV4_IN6_HACK_MSG="yes"
1013 if test "x$inet6_default_4in6" = "xyes"; then
1014 AC_MSG_RESULT([yes (default)])
1015 AC_DEFINE(IPV4_IN_IPV6)
1016 IPV4_IN6_HACK_MSG="yes"
1018 AC_MSG_RESULT([no (default)])
1023 # Where to place sshd.pid
1025 AC_ARG_WITH(pid-dir,
1026 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1028 if test "x$withval" != "xno" ; then
1034 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
1037 dnl allow user to disable some login recording features
1038 AC_ARG_ENABLE(lastlog,
1039 [ --disable-lastlog disable use of lastlog even if detected [no]],
1040 [ AC_DEFINE(DISABLE_LASTLOG) ]
1043 [ --disable-utmp disable use of utmp even if detected [no]],
1044 [ AC_DEFINE(DISABLE_UTMP) ]
1046 AC_ARG_ENABLE(utmpx,
1047 [ --disable-utmpx disable use of utmpx even if detected [no]],
1048 [ AC_DEFINE(DISABLE_UTMPX) ]
1051 [ --disable-wtmp disable use of wtmp even if detected [no]],
1052 [ AC_DEFINE(DISABLE_WTMP) ]
1054 AC_ARG_ENABLE(wtmpx,
1055 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1056 [ AC_DEFINE(DISABLE_WTMPX) ]
1058 AC_ARG_ENABLE(libutil,
1059 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1060 [ AC_DEFINE(DISABLE_LOGIN) ]
1062 AC_ARG_ENABLE(pututline,
1063 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1064 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1066 AC_ARG_ENABLE(pututxline,
1067 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1068 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1070 AC_ARG_WITH(lastlog,
1071 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1072 [ conf_lastlog_location="$withval"; ],)
1074 dnl lastlog, [uw]tmpx? detection
1075 dnl NOTE: set the paths in the platform section to avoid the
1076 dnl need for command-line parameters
1077 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1079 dnl lastlog detection
1080 dnl NOTE: the code itself will detect if lastlog is a directory
1081 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1083 #include <sys/types.h>
1085 #ifdef HAVE_LASTLOG_H
1086 # include <lastlog.h>
1092 [ char *lastlog = LASTLOG_FILE; ],
1093 [ AC_MSG_RESULT(yes) ],
1096 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1098 #include <sys/types.h>
1100 #ifdef HAVE_LASTLOG_H
1101 # include <lastlog.h>
1107 [ char *lastlog = _PATH_LASTLOG; ],
1108 [ AC_MSG_RESULT(yes) ],
1111 system_lastlog_path=no
1116 if test -z "$conf_lastlog_location"; then
1117 if test x"$system_lastlog_path" = x"no" ; then
1118 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1119 if (test -d "$f" || test -f "$f") ; then
1120 conf_lastlog_location=$f
1123 if test -z "$conf_lastlog_location"; then
1124 AC_MSG_WARN([** Cannot find lastlog **])
1125 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1130 if test -n "$conf_lastlog_location"; then
1131 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1135 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1137 #include <sys/types.h>
1143 [ char *utmp = UTMP_FILE; ],
1144 [ AC_MSG_RESULT(yes) ],
1146 system_utmp_path=no ]
1148 if test -z "$conf_utmp_location"; then
1149 if test x"$system_utmp_path" = x"no" ; then
1150 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1151 if test -f $f ; then
1152 conf_utmp_location=$f
1155 if test -z "$conf_utmp_location"; then
1156 AC_DEFINE(DISABLE_UTMP)
1160 if test -n "$conf_utmp_location"; then
1161 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1165 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1167 #include <sys/types.h>
1173 [ char *wtmp = WTMP_FILE; ],
1174 [ AC_MSG_RESULT(yes) ],
1176 system_wtmp_path=no ]
1178 if test -z "$conf_wtmp_location"; then
1179 if test x"$system_wtmp_path" = x"no" ; then
1180 for f in /usr/adm/wtmp /var/log/wtmp; do
1181 if test -f $f ; then
1182 conf_wtmp_location=$f
1185 if test -z "$conf_wtmp_location"; then
1186 AC_DEFINE(DISABLE_WTMP)
1190 if test -n "$conf_wtmp_location"; then
1191 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1195 dnl utmpx detection - I don't know any system so perverse as to require
1196 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1198 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1200 #include <sys/types.h>
1209 [ char *utmpx = UTMPX_FILE; ],
1210 [ AC_MSG_RESULT(yes) ],
1212 system_utmpx_path=no ]
1214 if test -z "$conf_utmpx_location"; then
1215 if test x"$system_utmpx_path" = x"no" ; then
1216 AC_DEFINE(DISABLE_UTMPX)
1219 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1223 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1225 #include <sys/types.h>
1234 [ char *wtmpx = WTMPX_FILE; ],
1235 [ AC_MSG_RESULT(yes) ],
1237 system_wtmpx_path=no ]
1239 if test -z "$conf_wtmpx_location"; then
1240 if test x"$system_wtmpx_path" = x"no" ; then
1241 AC_DEFINE(DISABLE_WTMPX)
1244 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1248 # Change default command timeout for builtin PRNG
1250 AC_ARG_WITH(entropy-timeout,
1251 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1253 if test "x$withval" != "xno" ; then
1254 entropy_timeout=$withval
1258 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1261 if test ! -z "$blibpath" ; then
1262 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1263 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1266 AC_OUTPUT(Makefile ssh_prng_cmds)
1268 # Print summary of options
1270 if test x$MANTYPE = x'$(CATMAN)' ; then
1275 if test ! -z "$RANDOM_POOL" ; then
1276 RAND_MSG="Device ($RANDOM_POOL)"
1278 if test ! -z "$EGD_SOCKET" ; then
1279 RAND_MSG="EGD ($EGD_SOCKET)"
1281 RAND_MSG="Builtin (timeout $entropy_timeout)"
1285 # Someone please show me a better way :)
1286 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1287 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1288 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1289 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1290 E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1291 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1292 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1295 echo "OpenSSH configured has been configured with the following options."
1296 echo " User binaries: $B"
1297 echo " System binaries: $C"
1298 echo " Configuration files: $D"
1299 echo " Askpass program: $E"
1300 echo " Manual pages: $F"
1301 echo " PID file: $G"
1302 echo " Random number collection: $RAND_MSG"
1303 echo " Manpage format: $MAN_MSG"
1304 echo " PAM support: ${PAM_MSG}"
1305 echo " KerberosIV support: $KRB4_MSG"
1306 echo " AFS support: $AFS_MSG"
1307 echo " S/KEY support: $SKEY_MSG"
1308 echo " TCP Wrappers support: $TCPW_MSG"
1309 echo " MD5 password support: $MD5_MSG"
1310 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1311 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1312 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1316 echo "Compiler flags: ${CFLAGS}"
1317 echo "Linker flags: ${LDFLAGS}"
1318 echo "Libraries: ${LIBS}"