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 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_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
99 AC_DEFINE(DONT_TRY_OTHER_AF)
100 inet6_default_4in6=yes
106 # hardwire lastlog location (can't detect it on some versions)
107 conf_lastlog_location="/usr/adm/lastlog"
109 CFLAGS="$CFLAGS -I/usr/local/include"
111 conf_utmp_location=/etc/utmp
112 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
113 AC_MSG_WARN([*** Expect 'scp' to fail!])
114 AC_MSG_WARN([*** Please report any problems, thanks])
117 CFLAGS="$CFLAGS -I/usr/local/include"
118 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
120 # hardwire lastlog location (can't detect it on some versions)
121 conf_lastlog_location="/var/adm/lastlog"
122 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
123 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
124 if test "$sol2ver" -ge 8; then
126 AC_DEFINE(DISABLE_UTMP)
127 AC_DEFINE(DISABLE_WTMP)
133 CFLAGS="$CFLAGS -DSUNOS4"
134 AC_CHECK_FUNCS(getpwanam)
137 CFLAGS="$CFLAGS -I/usr/local/include"
138 LDFLAGS="$LDFLAGS -L/usr/local/lib"
141 LIBS="$LIBS -lgen -lsocket"
144 CFLAGS="$CFLAGS -I/usr/local/include"
145 LDFLAGS="$LDFLAGS -L/usr/local/lib"
148 LIBS="$LIBS -lgen -lsocket"
153 # Allow user to specify flags
155 [ --with-cflags Specify additional flags to pass to compiler],
157 if test "x$withval" != "xno" ; then
158 CFLAGS="$CFLAGS $withval"
163 [ --with-ldlags Specify additional flags to pass to linker],
165 if test "x$withval" != "xno" ; then
166 LDFLAGS="$LDFLAGS $withval"
171 [ --with-libs Specify additional libraries to link with],
173 if test "x$withval" != "xno" ; then
174 LIBS="$LIBS $withval"
180 # Checks for libraries.
181 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
182 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
184 if test -z "$no_libsocket" ; then
185 AC_CHECK_LIB(nsl, yp_match, , )
187 if test -z "$no_libnsl" ; then
188 AC_CHECK_LIB(socket, main, , )
191 # Checks for header files.
192 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)
194 # Checks for library functions.
195 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)
196 dnl checks for time functions
197 AC_CHECK_FUNCS(gettimeofday time)
198 dnl checks for libutil functions
199 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
200 dnl checks for utmp functions
201 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
202 AC_CHECK_FUNCS(utmpname)
203 dnl checks for utmpx functions
204 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
205 AC_CHECK_FUNCS(setutxent utmpxname)
208 [AC_DEFINE(HAVE_LOGIN)],
209 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
212 AC_CHECK_FUNC(daemon,
213 [AC_DEFINE(HAVE_DAEMON)],
214 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
217 AC_CHECK_FUNC(getpagesize,
218 [AC_DEFINE(HAVE_GETPAGESIZE)],
219 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
224 [ --without-pam Disable PAM support ],
226 if test "x$withval" = "xno" ; then
228 AC_DEFINE(DISABLE_PAM)
233 if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
234 AC_CHECK_LIB(dl, dlopen, , )
237 AC_CHECK_FUNCS(pam_getenvlist)
241 # Check PAM strerror arguments (old PAM)
242 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
246 #include <security/pam_appl.h>
248 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
251 AC_DEFINE(HAVE_OLD_PAM)
253 PAM_MSG="yes (old library)"
258 # The big search for OpenSSL
260 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
262 if test "x$withval" != "$xno" ; then
269 saved_LDFLAGS="$LDFLAGS"
270 saved_CFLAGS="$CFLAGS"
271 if test "x$prefix" != "xNONE" ; then
272 tryssldir="$tryssldir $prefix"
274 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
276 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
277 if test ! -z "$ssldir" ; then
278 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
279 CFLAGS="$saved_CFLAGS -I$ssldir/include"
280 if test ! -z "$need_dash_r" ; then
281 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
284 LDFLAGS="$saved_LDFLAGS"
287 LIBS="$saved_LIBS -lcrypto"
289 # Basic test to check for compatible version and correct linking
290 # *does not* test for RSA - that comes later.
294 #include <openssl/rand.h>
298 memset(a, 0, sizeof(a));
299 RAND_add(a, sizeof(a), sizeof(a));
300 return(RAND_status() <= 0);
309 if test ! -z "$found_crypto" ; then
314 if test -z "$found_crypto" ; then
315 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
317 if test -z "$ssldir" ; then
321 ac_cv_openssldir=$ssldir
324 if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
325 AC_DEFINE(HAVE_OPENSSL)
326 dnl Need to recover ssldir - test above runs in subshell
327 ssldir=$ac_cv_openssldir
328 CFLAGS="$saved_CFLAGS -I$ssldir/include"
329 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
330 if test ! -z "$need_dash_r" ; then
331 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
333 if test ! -z "$blibpath" ; then
334 blibpath="$blibpath:$ssldir:$ssldir/lib"
337 LIBS="$saved_LIBS -lcrypto"
339 # Now test RSA support
341 AC_MSG_CHECKING([for RSA support])
342 for WANTS_RSAREF in "" 1 ; do
343 if test -z "$WANTS_RSAREF" ; then
346 LIBS="$saved_LIBS -lRSAglue -lrsaref"
350 #include <openssl/rand.h>
351 #include <openssl/rsa.h>
352 #include <openssl/bn.h>
353 #include <openssl/sha.h>
356 int num; RSA *key; static unsigned char p_in[] = "blahblah";
357 unsigned char c[256], p[256];
358 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
359 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
360 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
361 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
370 if test ! -z "$no_rsa" ; then
371 AC_MSG_RESULT(disabled)
374 if test -z "$rsa_works" ; then
375 AC_MSG_WARN([*** No RSA support found *** ])
378 if test -z "$WANTS_RSAREF" ; then
382 RSA_MSG="yes (using RSAref)"
383 AC_MSG_RESULT(using RSAref)
384 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
389 # Checks for data types
390 AC_CHECK_SIZEOF(char, 1)
391 AC_CHECK_SIZEOF(short int, 2)
392 AC_CHECK_SIZEOF(int, 4)
393 AC_CHECK_SIZEOF(long int, 4)
394 AC_CHECK_SIZEOF(long long int, 8)
396 # More checks for data types
397 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
399 [ #include <sys/types.h> ],
400 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
401 [ ac_cv_have_intxx_t="yes" ],
402 [ ac_cv_have_intxx_t="no" ]
405 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
406 AC_DEFINE(HAVE_INTXX_T)
410 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
412 [ #include <sys/types.h> ],
413 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
414 [ ac_cv_have_u_intxx_t="yes" ],
415 [ ac_cv_have_u_intxx_t="no" ]
418 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
419 AC_DEFINE(HAVE_U_INTXX_T)
424 if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
425 "x$ac_cv_header_sys_bitypes_h" = "xyes"
427 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
430 #include <sys/bitypes.h>
433 int8_t a; int16_t b; int32_t c;
434 u_int8_t e; u_int16_t f; u_int32_t g;
435 a = b = c = e = f = g = 1;
438 AC_DEFINE(HAVE_U_INTXX_T)
439 AC_DEFINE(HAVE_INTXX_T)
446 if test -z "$have_u_intxx_t" ; then
447 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
450 #include <sys/types.h>
452 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
453 [ ac_cv_have_uintxx_t="yes" ],
454 [ ac_cv_have_uintxx_t="no" ]
457 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
458 AC_DEFINE(HAVE_UINTXX_T)
462 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
465 #include <sys/types.h>
466 #include <sys/socket.h>
468 [socklen_t foo; foo = 1235;],
469 [ ac_cv_have_socklen_t="yes" ],
470 [ ac_cv_have_socklen_t="no" ]
473 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
474 AC_DEFINE(HAVE_SOCKLEN_T)
477 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
480 #include <sys/types.h>
482 [ size_t foo; foo = 1235; ],
483 [ ac_cv_have_size_t="yes" ],
484 [ ac_cv_have_size_t="no" ]
487 if test "x$ac_cv_have_size_t" = "xyes" ; then
488 AC_DEFINE(HAVE_SIZE_T)
491 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
494 #include <sys/types.h>
496 [ ssize_t foo; foo = 1235; ],
497 [ ac_cv_have_ssize_t="yes" ],
498 [ ac_cv_have_ssize_t="no" ]
501 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
502 AC_DEFINE(HAVE_SSIZE_T)
505 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
508 #include <sys/types.h>
510 [ pid_t foo; foo = 1235; ],
511 [ ac_cv_have_pid_t="yes" ],
512 [ ac_cv_have_pid_t="no" ]
515 if test "x$ac_cv_have_pid_t" = "xyes" ; then
516 AC_DEFINE(HAVE_PID_T)
519 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
522 #include <sys/types.h>
524 [ mode_t foo; foo = 1235; ],
525 [ ac_cv_have_mode_t="yes" ],
526 [ ac_cv_have_mode_t="no" ]
529 if test "x$ac_cv_have_mode_t" = "xyes" ; then
530 AC_DEFINE(HAVE_MODE_T)
534 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
537 #include <sys/types.h>
538 #include <sys/socket.h>
540 [ struct sockaddr_storage s; ],
541 [ ac_cv_have_struct_sockaddr_storage="yes" ],
542 [ ac_cv_have_struct_sockaddr_storage="no" ]
545 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
546 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
549 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
552 #include <sys/types.h>
553 #include <netinet/in.h>
555 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
556 [ ac_cv_have_struct_sockaddr_in6="yes" ],
557 [ ac_cv_have_struct_sockaddr_in6="no" ]
560 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
561 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
564 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
567 #include <sys/types.h>
568 #include <netinet/in.h>
570 [ struct in6_addr s; s.s6_addr[0] = 0; ],
571 [ ac_cv_have_struct_in6_addr="yes" ],
572 [ ac_cv_have_struct_in6_addr="no" ]
575 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
576 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
579 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
582 #include <sys/types.h>
583 #include <sys/socket.h>
586 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
587 [ ac_cv_have_struct_addrinfo="yes" ],
588 [ ac_cv_have_struct_addrinfo="no" ]
591 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
592 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
596 # Checks for structure members
598 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
599 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
600 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
601 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
602 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
603 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
604 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
605 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
606 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
607 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
608 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
609 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
610 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
611 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
612 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
613 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
615 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
616 ac_cv_have_ss_family_in_struct_ss, [
619 #include <sys/types.h>
620 #include <sys/socket.h>
622 [ struct sockaddr_storage s; s.ss_family = 1; ],
623 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
624 [ ac_cv_have_ss_family_in_struct_ss="no" ],
627 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
628 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
631 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
632 ac_cv_have___ss_family_in_struct_ss, [
635 #include <sys/types.h>
636 #include <sys/socket.h>
638 [ struct sockaddr_storage s; s.__ss_family = 1; ],
639 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
640 [ ac_cv_have___ss_family_in_struct_ss="no" ]
643 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
644 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
648 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
650 [ extern char *__progname; printf("%s", __progname); ],
651 [ ac_cv_libc_defines___progname="yes" ],
652 [ ac_cv_libc_defines___progname="no" ]
655 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
656 AC_DEFINE(HAVE___PROGNAME)
660 # Looking for programs, paths and files
662 [ --with-rsh=PATH Specify path to remote shell program ],
664 if test "x$withval" != "$no" ; then
669 AC_PATH_PROG(rsh_path, rsh)
674 [ --with-xauth=PATH Specify path to xauth program ],
676 if test "x$withval" != "$xno" ; then
681 AC_PATH_PROG(xauth_path, xauth)
682 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
683 xauth_path="/usr/openwin/bin/xauth"
688 if test ! -z "$xauth_path" ; then
689 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
691 if test ! -z "$rsh_path" ; then
692 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
695 # Check for mail directory (last resort if we cannot get it from headers)
696 if test ! -z "$MAIL" ; then
697 maildir=`dirname $MAIL`
698 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
701 if test -z "$no_dev_ptmx" ; then
702 AC_CHECK_FILE("/dev/ptmx",
704 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
709 AC_CHECK_FILE("/dev/ptc",
711 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
716 # Options from here on. Some of these are preset by platform above
718 # Check for user-specified random device, otherwise check /dev/urandom
720 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
722 if test "x$withval" != "xno" ; then
723 RANDOM_POOL="$withval";
724 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
728 # Check for random device
729 AC_CHECK_FILE("/dev/urandom",
731 RANDOM_POOL="/dev/urandom";
732 AC_SUBST(RANDOM_POOL)
733 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
739 # Check for EGD pool file
740 AC_ARG_WITH(egd-pool,
741 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
743 if test "x$withval" != "xno" ; then
744 EGD_SOCKET="$withval";
745 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
750 # detect pathnames for entropy gathering commands, if we need them
751 INSTALL_SSH_PRNG_CMDS=""
753 if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
754 # Use these commands to collect entropy
755 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
756 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
757 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
758 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
759 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
760 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
761 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
762 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
763 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
764 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
765 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
766 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
767 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
768 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
769 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
771 INSTALL_SSH_PRNG_CMDS="yes"
773 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
777 [ --with-catman=man|cat Install preformatted manpages[no]],
780 if test x"$withval" != x"yes" ; then
786 if test -z "$MANTYPE" ; then
787 MANTYPE='$(TROFFMAN)'
795 # Check whether user wants Kerberos support
797 AC_ARG_WITH(kerberos4,
798 [ --with-kerberos4=PATH Enable Kerberos 4 support],
800 if test "x$withval" != "xno" ; then
802 if test "x$withval" != "$xyes" ; then
803 CFLAGS="$CFLAGS -I${withval}/include"
804 LDFLAGS="$LDFLAGS -L${withval}/lib"
805 if test ! -z "$need_dash_r" ; then
806 LDFLAGS="$LDFLAGS -R${withval}/lib"
808 if test ! -z "$blibpath" ; then
809 blibpath="$blibpath:${withval}/lib"
812 if test -d /usr/include/kerberosIV ; then
813 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
817 AC_CHECK_HEADERS(krb.h)
818 AC_CHECK_LIB(krb, main)
819 if test "$ac_cv_header_krb_h" != yes; then
820 AC_MSG_WARN([Cannot find krb.h, build may fail])
822 if test "$ac_cv_lib_krb_main" != yes; then
823 AC_MSG_WARN([Cannot find libkrb, build may fail])
827 AC_CHECK_LIB(resolv, dn_expand, , )
835 # Check whether user wants AFS support
838 [ --with-afs=PATH Enable AFS support],
840 if test "x$withval" != "xno" ; then
842 if test "x$withval" != "$xyes" ; then
843 CFLAGS="$CFLAGS -I${withval}/include"
844 LFLAGS="$LFLAGS -L${withval}/lib"
847 if test -z "$KRB4" ; then
848 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
852 if test ! -z "$AFS_LIBS" ; then
853 LIBS="$LIBS $AFS_LIBS"
862 # Check whether user wants S/Key support
865 [ --with-skey Enable S/Key support],
867 if test "x$withval" != "xno" ; then
875 # Check whether user wants TCP wrappers support
877 AC_ARG_WITH(tcp-wrappers,
878 [ --with-tcp-wrappers Enable tcpwrappers support],
880 if test "x$withval" != "xno" ; then
883 AC_MSG_CHECKING(for libwrap)
887 int deny_severity = 0, allow_severity = 0;
896 AC_MSG_ERROR([*** libwrap missing])
903 # Check whether to enable MD5 passwords
905 AC_ARG_WITH(md5-passwords,
906 [ --with-md5-passwords Enable use of MD5 passwords],
908 if test "x$withval" != "xno" ; then
909 AC_DEFINE(HAVE_MD5_PASSWORDS)
915 # Whether to disable shadow password support
917 [ --without-shadow Disable shadow password support],
919 if test "x$withval" = "xno" ; then
920 AC_DEFINE(DISABLE_SHADOW)
925 # Use ip address instead of hostname in $DISPLAY
926 DISPLAY_HACK_MSG="no"
927 AC_ARG_WITH(ipaddr-display,
928 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
930 if test "x$withval" = "xno" ; then
931 AC_DEFINE(IPADDR_IN_DISPLAY)
932 DISPLAY_HACK_MSG="yes"
937 # Whether to mess with the default path
938 SERVER_PATH_MSG="(default)"
939 AC_ARG_WITH(default-path,
940 [ --with-default-path=PATH Specify default \$PATH environment for server],
942 if test "x$withval" != "xno" ; then
943 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
944 SERVER_PATH_MSG="$withval"
949 # Whether to force IPv4 by default (needed on broken glibc Linux)
951 AC_ARG_WITH(ipv4-default,
952 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
954 if test "x$withval" != "xno" ; then
955 AC_DEFINE(IPV4_DEFAULT)
961 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
962 IPV4_IN6_HACK_MSG="no"
964 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
966 if test "x$withval" != "xno" ; then
968 AC_DEFINE(IPV4_IN_IPV6)
969 IPV4_IN6_HACK_MSG="yes"
974 if test "x$inet6_default_4in6" = "xyes"; then
975 AC_MSG_RESULT([yes (default)])
976 AC_DEFINE(IPV4_IN_IPV6)
977 IPV4_IN6_HACK_MSG="yes"
979 AC_MSG_RESULT([no (default)])
984 # Where to place sshd.pid
987 [ --with-pid-dir=PATH Specify location of ssh.pid file],
989 if test "x$withval" != "xno" ; then
995 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
998 dnl allow user to disable some login recording features
999 AC_ARG_ENABLE(lastlog,
1000 [ --disable-lastlog disable use of lastlog even if detected [no]],
1001 [ AC_DEFINE(DISABLE_LASTLOG) ]
1004 [ --disable-utmp disable use of utmp even if detected [no]],
1005 [ AC_DEFINE(DISABLE_UTMP) ]
1007 AC_ARG_ENABLE(utmpx,
1008 [ --disable-utmpx disable use of utmpx even if detected [no]],
1009 [ AC_DEFINE(DISABLE_UTMPX) ]
1012 [ --disable-wtmp disable use of wtmp even if detected [no]],
1013 [ AC_DEFINE(DISABLE_WTMP) ]
1015 AC_ARG_ENABLE(wtmpx,
1016 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1017 [ AC_DEFINE(DISABLE_WTMPX) ]
1019 AC_ARG_ENABLE(libutil,
1020 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1021 [ AC_DEFINE(DISABLE_LOGIN) ]
1023 AC_ARG_ENABLE(pututline,
1024 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1025 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1027 AC_ARG_ENABLE(pututxline,
1028 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1029 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1031 AC_ARG_WITH(lastlog,
1032 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1033 [ conf_lastlog_location="$withval"; ],)
1035 dnl lastlog, [uw]tmpx? detection
1036 dnl NOTE: set the paths in the platform section to avoid the
1037 dnl need for command-line parameters
1038 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1040 dnl lastlog detection
1041 dnl NOTE: the code itself will detect if lastlog is a directory
1042 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1044 #include <sys/types.h>
1046 #ifdef HAVE_LASTLOG_H
1047 # include <lastlog.h>
1053 [ char *lastlog = LASTLOG_FILE; ],
1054 [ AC_MSG_RESULT(yes) ],
1057 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1059 #include <sys/types.h>
1061 #ifdef HAVE_LASTLOG_H
1062 # include <lastlog.h>
1068 [ char *lastlog = _PATH_LASTLOG; ],
1069 [ AC_MSG_RESULT(yes) ],
1072 system_lastlog_path=no
1077 if test -z "$conf_lastlog_location"; then
1078 if test x"$system_lastlog_path" = x"no" ; then
1079 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1080 if test -d "$f" -o -f "$f" ; then
1081 conf_lastlog_location=$f
1084 if test -z "$conf_lastlog_location"; then
1085 AC_MSG_WARN([** Cannot find lastlog **])
1086 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1091 if test -n "$conf_lastlog_location"; then
1092 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1096 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1098 #include <sys/types.h>
1104 [ char *utmp = UTMP_FILE; ],
1105 [ AC_MSG_RESULT(yes) ],
1107 system_utmp_path=no ]
1109 if test -z "$conf_utmp_location"; then
1110 if test x"$system_utmp_path" = x"no" ; then
1111 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1112 if test -f $f ; then
1113 conf_utmp_location=$f
1116 if test -z "$conf_utmp_location"; then
1117 AC_DEFINE(DISABLE_UTMP)
1121 if test -n "$conf_utmp_location"; then
1122 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1126 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1128 #include <sys/types.h>
1134 [ char *wtmp = WTMP_FILE; ],
1135 [ AC_MSG_RESULT(yes) ],
1137 system_wtmp_path=no ]
1139 if test -z "$conf_wtmp_location"; then
1140 if test x"$system_wtmp_path" = x"no" ; then
1141 for f in /usr/adm/wtmp /var/log/wtmp; do
1142 if test -f $f ; then
1143 conf_wtmp_location=$f
1146 if test -z "$conf_wtmp_location"; then
1147 AC_DEFINE(DISABLE_WTMP)
1151 if test -n "$conf_wtmp_location"; then
1152 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1156 dnl utmpx detection - I don't know any system so perverse as to require
1157 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1159 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1161 #include <sys/types.h>
1170 [ char *utmpx = UTMPX_FILE; ],
1171 [ AC_MSG_RESULT(yes) ],
1173 system_utmpx_path=no ]
1175 if test -z "$conf_utmpx_location"; then
1176 if test x"$system_utmpx_path" = x"no" ; then
1177 AC_DEFINE(DISABLE_UTMPX)
1180 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1184 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1186 #include <sys/types.h>
1195 [ char *wtmpx = WTMPX_FILE; ],
1196 [ AC_MSG_RESULT(yes) ],
1198 system_wtmpx_path=no ]
1200 if test -z "$conf_wtmpx_location"; then
1201 if test x"$system_wtmpx_path" = x"no" ; then
1202 AC_DEFINE(DISABLE_WTMPX)
1205 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1209 # Change default command timeout for builtin PRNG
1211 AC_ARG_WITH(entropy-timeout,
1212 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1214 if test "x$withval" != "xno" ; then
1215 entropy_timeout=$withval
1219 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1222 if test ! -z "$blibpath" ; then
1223 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1224 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1227 AC_OUTPUT(Makefile ssh_prng_cmds)
1229 # Print summary of options
1231 if test x$MANTYPE = x'$(CATMAN)' ; then
1236 if test ! -z "$RANDOM_POOL" ; then
1237 RAND_MSG="Device ($RANDOM_POOL)"
1239 if test ! -z "$EGD_SOCKET" ; then
1240 RAND_MSG="EGD ($EGD_SOCKET)"
1242 RAND_MSG="Builtin (timeout $entropy_timeout)"
1246 # Someone please show me a better way :)
1247 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1248 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1249 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1250 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1251 E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1252 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1253 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1256 echo "OpenSSH configured has been configured with the following options."
1257 echo " User binaries: $B"
1258 echo " System binaries: $C"
1259 echo " Configuration files: $D"
1260 echo " Askpass program: $E"
1261 echo " Manual pages: $F"
1262 echo " PID file: $G"
1263 echo " Random number collection: $RAND_MSG"
1264 echo " Manpage format: $MAN_MSG"
1265 echo " PAM support: ${PAM_MSG}"
1266 echo " KerberosIV support: $KRB4_MSG"
1267 echo " AFS support: $AFS_MSG"
1268 echo " S/KEY support: $SKEY_MSG"
1269 echo " TCP Wrappers support: $TCPW_MSG"
1270 echo " MD5 password support: $MD5_MSG"
1271 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1272 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1273 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1277 echo "Compiler flags: ${CFLAGS}"
1278 echo "Linker flags: ${LDFLAGS}"
1279 echo "Libraries: ${LIBS}"