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)
47 if test -z "$GCC"; then
50 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
51 AC_DEFINE(IPADDR_IN_DISPLAY)
52 AC_MSG_CHECKING(for HPUX trusted system password database)
53 if test -f /tcb/files/auth/system/default; then
55 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
57 AC_MSG_WARN([This configuration is untested])
60 AC_DEFINE(DISABLE_SHADOW)
66 if test -z "$GCC"; then
69 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
70 AC_DEFINE(IPADDR_IN_DISPLAY)
71 AC_MSG_CHECKING(for HPUX trusted system password database)
72 if test -f /tcb/files/auth/system/default; then
74 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
76 AC_MSG_WARN([This configuration is untested])
79 AC_DEFINE(DISABLE_SHADOW)
85 CFLAGS="$CFLAGS -I/usr/local/include"
92 CFLAGS="$CFLAGS -I/usr/local/include"
95 AC_DEFINE(WITH_IRIX_ARRAY)
96 AC_DEFINE(WITH_IRIX_PROJECT)
97 AC_DEFINE(WITH_IRIX_AUDIT)
103 AC_DEFINE(DONT_TRY_OTHER_AF)
104 AC_DEFINE(PAM_TTY_KLUDGE)
105 inet6_default_4in6=yes
111 # hardwire lastlog location (can't detect it on some versions)
112 conf_lastlog_location="/usr/adm/lastlog"
113 conf_utmp_location=/etc/utmp
115 CFLAGS="$CFLAGS -I/usr/local/include"
117 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
118 AC_MSG_WARN([*** Expect 'scp' to fail!])
119 AC_MSG_WARN([*** Please report any problems, thanks])
122 CFLAGS="$CFLAGS -I/usr/local/include"
123 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
125 # hardwire lastlog location (can't detect it on some versions)
126 conf_lastlog_location="/var/adm/lastlog"
127 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
128 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
129 if test "$sol2ver" -ge 8; then
131 AC_DEFINE(DISABLE_UTMP)
132 AC_DEFINE(DISABLE_WTMP)
138 CFLAGS="$CFLAGS -DSUNOS4"
139 AC_CHECK_FUNCS(getpwanam)
142 CFLAGS="$CFLAGS -I/usr/local/include"
143 LDFLAGS="$LDFLAGS -L/usr/local/lib"
146 LIBS="$LIBS -lgen -lsocket"
149 CFLAGS="$CFLAGS -I/usr/local/include"
150 LDFLAGS="$LDFLAGS -L/usr/local/lib"
153 LIBS="$LIBS -lgen -lsocket"
158 if test ! -z "USE_SIA" ; then
159 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
160 if test -f /etc/sia/matrix.conf; then
162 AC_DEFINE(HAVE_OSF_SIA)
163 AC_DEFINE(DISABLE_LOGIN)
164 LIBS="$LIBS -lsecurity -ldb -lm -laud"
172 # Allow user to specify flags
174 [ --with-cflags Specify additional flags to pass to compiler],
176 if test "x$withval" != "xno" ; then
177 CFLAGS="$CFLAGS $withval"
182 [ --with-ldlags Specify additional flags to pass to linker],
184 if test "x$withval" != "xno" ; then
185 LDFLAGS="$LDFLAGS $withval"
190 [ --with-libs Specify additional libraries to link with],
192 if test "x$withval" != "xno" ; then
193 LIBS="$LIBS $withval"
199 # Checks for libraries.
200 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
201 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
203 if test -z "$no_libsocket" ; then
204 AC_CHECK_LIB(nsl, yp_match, , )
206 if test -z "$no_libnsl" ; then
207 AC_CHECK_LIB(socket, main, , )
210 # Checks for header files.
211 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 usersec.h util.h utmp.h utmpx.h)
213 # Checks for library functions.
214 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 sigaction sigvec snprintf strlcat strlcpy vsnprintf vhangup _getpty __b64_ntop)
215 dnl checks for time functions
216 AC_CHECK_FUNCS(gettimeofday time)
217 dnl checks for libutil functions
218 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
219 dnl checks for utmp functions
220 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
221 AC_CHECK_FUNCS(utmpname)
222 dnl checks for utmpx functions
223 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
224 AC_CHECK_FUNCS(setutxent utmpxname)
226 AC_CHECK_FUNC(getuserattr,
227 [AC_DEFINE(HAVE_GETUSERATTR)],
228 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
232 [AC_DEFINE(HAVE_LOGIN)],
233 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
236 AC_CHECK_FUNC(daemon,
237 [AC_DEFINE(HAVE_DAEMON)],
238 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
241 AC_CHECK_FUNC(getpagesize,
242 [AC_DEFINE(HAVE_GETPAGESIZE)],
243 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
246 # Check for broken snprintf
247 if test "x$ac_cv_func_snprintf" = "xyes" ; then
248 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
252 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
254 [AC_MSG_RESULT(yes)],
257 AC_DEFINE(BROKEN_SNPRINTF)
258 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
265 [ --without-pam Disable PAM support ],
267 if test "x$withval" = "xno" ; then
269 AC_DEFINE(DISABLE_PAM)
274 if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
275 AC_CHECK_LIB(dl, dlopen, , )
278 AC_CHECK_FUNCS(pam_getenvlist)
284 # Check PAM strerror arguments (old PAM)
285 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
289 #include <security/pam_appl.h>
291 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
294 AC_DEFINE(HAVE_OLD_PAM)
296 PAM_MSG="yes (old library)"
301 # The big search for OpenSSL
303 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
305 if test "x$withval" != "$xno" ; then
312 saved_LDFLAGS="$LDFLAGS"
313 saved_CFLAGS="$CFLAGS"
314 if test "x$prefix" != "xNONE" ; then
315 tryssldir="$tryssldir $prefix"
317 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
319 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
320 if test ! -z "$ssldir" ; then
321 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
322 CFLAGS="$saved_CFLAGS -I$ssldir/include"
323 if test ! -z "$need_dash_r" ; then
324 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
327 LDFLAGS="$saved_LDFLAGS"
330 LIBS="$saved_LIBS -lcrypto"
332 # Basic test to check for compatible version and correct linking
333 # *does not* test for RSA - that comes later.
337 #include <openssl/rand.h>
341 memset(a, 0, sizeof(a));
342 RAND_add(a, sizeof(a), sizeof(a));
343 return(RAND_status() <= 0);
352 if test ! -z "$found_crypto" ; then
357 if test -z "$found_crypto" ; then
358 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
360 if test -z "$ssldir" ; then
364 ac_cv_openssldir=$ssldir
367 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
368 AC_DEFINE(HAVE_OPENSSL)
369 dnl Need to recover ssldir - test above runs in subshell
370 ssldir=$ac_cv_openssldir
371 CFLAGS="$saved_CFLAGS -I$ssldir/include"
372 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
373 if test ! -z "$need_dash_r" ; then
374 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
376 if test ! -z "$blibpath" ; then
377 blibpath="$blibpath:$ssldir:$ssldir/lib"
380 LIBS="$saved_LIBS -lcrypto"
382 # Now test RSA support
384 AC_MSG_CHECKING([for RSA support])
385 for WANTS_RSAREF in "" 1 ; do
386 if test -z "$WANTS_RSAREF" ; then
389 LIBS="$saved_LIBS -lRSAglue -lrsaref"
393 #include <openssl/rand.h>
394 #include <openssl/rsa.h>
395 #include <openssl/bn.h>
396 #include <openssl/sha.h>
399 int num; RSA *key; static unsigned char p_in[] = "blahblah";
400 unsigned char c[256], p[256];
401 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
402 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
403 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
404 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
413 if test ! -z "$no_rsa" ; then
414 AC_MSG_RESULT(disabled)
417 if test -z "$rsa_works" ; then
418 AC_MSG_WARN([*** No RSA support found *** ])
421 if test -z "$WANTS_RSAREF" ; then
425 RSA_MSG="yes (using RSAref)"
426 AC_MSG_RESULT(using RSAref)
427 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
432 # Checks for data types
433 AC_CHECK_SIZEOF(char, 1)
434 AC_CHECK_SIZEOF(short int, 2)
435 AC_CHECK_SIZEOF(int, 4)
436 AC_CHECK_SIZEOF(long int, 4)
437 AC_CHECK_SIZEOF(long long int, 8)
439 # More checks for data types
440 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
442 [ #include <sys/types.h> ],
443 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
444 [ ac_cv_have_intxx_t="yes" ],
445 [ ac_cv_have_intxx_t="no" ]
448 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
449 AC_DEFINE(HAVE_INTXX_T)
453 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
455 [ #include <sys/types.h> ],
456 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
457 [ ac_cv_have_u_intxx_t="yes" ],
458 [ ac_cv_have_u_intxx_t="no" ]
461 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
462 AC_DEFINE(HAVE_U_INTXX_T)
467 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
468 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
470 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
473 #include <sys/bitypes.h>
476 int8_t a; int16_t b; int32_t c;
477 u_int8_t e; u_int16_t f; u_int32_t g;
478 a = b = c = e = f = g = 1;
481 AC_DEFINE(HAVE_U_INTXX_T)
482 AC_DEFINE(HAVE_INTXX_T)
489 if test -z "$have_u_intxx_t" ; then
490 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
493 #include <sys/types.h>
495 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
496 [ ac_cv_have_uintxx_t="yes" ],
497 [ ac_cv_have_uintxx_t="no" ]
500 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
501 AC_DEFINE(HAVE_UINTXX_T)
505 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
508 #include <sys/types.h>
509 #include <sys/socket.h>
511 [socklen_t foo; foo = 1235;],
512 [ ac_cv_have_socklen_t="yes" ],
513 [ ac_cv_have_socklen_t="no" ]
516 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
517 AC_DEFINE(HAVE_SOCKLEN_T)
520 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
523 #include <sys/types.h>
525 [ size_t foo; foo = 1235; ],
526 [ ac_cv_have_size_t="yes" ],
527 [ ac_cv_have_size_t="no" ]
530 if test "x$ac_cv_have_size_t" = "xyes" ; then
531 AC_DEFINE(HAVE_SIZE_T)
534 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
537 #include <sys/types.h>
539 [ ssize_t foo; foo = 1235; ],
540 [ ac_cv_have_ssize_t="yes" ],
541 [ ac_cv_have_ssize_t="no" ]
544 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
545 AC_DEFINE(HAVE_SSIZE_T)
548 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
551 #include <sys/types.h>
552 #include <sys/socket.h>
554 [ sa_family_t foo; foo = 1235; ],
555 [ ac_cv_have_sa_family_t="yes" ],
556 [ ac_cv_have_sa_family_t="no" ]
559 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
560 AC_DEFINE(HAVE_SA_FAMILY_T)
563 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
566 #include <sys/types.h>
568 [ pid_t foo; foo = 1235; ],
569 [ ac_cv_have_pid_t="yes" ],
570 [ ac_cv_have_pid_t="no" ]
573 if test "x$ac_cv_have_pid_t" = "xyes" ; then
574 AC_DEFINE(HAVE_PID_T)
577 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
580 #include <sys/types.h>
582 [ mode_t foo; foo = 1235; ],
583 [ ac_cv_have_mode_t="yes" ],
584 [ ac_cv_have_mode_t="no" ]
587 if test "x$ac_cv_have_mode_t" = "xyes" ; then
588 AC_DEFINE(HAVE_MODE_T)
592 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
595 #include <sys/types.h>
596 #include <sys/socket.h>
598 [ struct sockaddr_storage s; ],
599 [ ac_cv_have_struct_sockaddr_storage="yes" ],
600 [ ac_cv_have_struct_sockaddr_storage="no" ]
603 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
604 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
607 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
610 #include <sys/types.h>
611 #include <netinet/in.h>
613 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
614 [ ac_cv_have_struct_sockaddr_in6="yes" ],
615 [ ac_cv_have_struct_sockaddr_in6="no" ]
618 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
619 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
622 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
625 #include <sys/types.h>
626 #include <netinet/in.h>
628 [ struct in6_addr s; s.s6_addr[0] = 0; ],
629 [ ac_cv_have_struct_in6_addr="yes" ],
630 [ ac_cv_have_struct_in6_addr="no" ]
633 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
634 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
637 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
640 #include <sys/types.h>
641 #include <sys/socket.h>
644 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
645 [ ac_cv_have_struct_addrinfo="yes" ],
646 [ ac_cv_have_struct_addrinfo="no" ]
649 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
650 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
654 # Checks for structure members
656 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
657 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
658 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
659 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
660 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
661 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
662 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
663 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
664 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
665 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
666 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
667 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
668 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
669 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
670 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
671 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
672 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
674 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
675 ac_cv_have_ss_family_in_struct_ss, [
678 #include <sys/types.h>
679 #include <sys/socket.h>
681 [ struct sockaddr_storage s; s.ss_family = 1; ],
682 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
683 [ ac_cv_have_ss_family_in_struct_ss="no" ],
686 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
687 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
690 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
691 ac_cv_have___ss_family_in_struct_ss, [
694 #include <sys/types.h>
695 #include <sys/socket.h>
697 [ struct sockaddr_storage s; s.__ss_family = 1; ],
698 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
699 [ ac_cv_have___ss_family_in_struct_ss="no" ]
702 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
703 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
707 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
709 [ extern char *__progname; printf("%s", __progname); ],
710 [ ac_cv_libc_defines___progname="yes" ],
711 [ ac_cv_libc_defines___progname="no" ]
714 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
715 AC_DEFINE(HAVE___PROGNAME)
719 # Looking for programs, paths and files
721 [ --with-rsh=PATH Specify path to remote shell program ],
723 if test "x$withval" != "$no" ; then
728 AC_PATH_PROG(rsh_path, rsh)
733 [ --with-xauth=PATH Specify path to xauth program ],
735 if test "x$withval" != "$xno" ; then
740 AC_PATH_PROG(xauth_path, xauth)
741 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
742 xauth_path="/usr/openwin/bin/xauth"
747 if test ! -z "$xauth_path" ; then
748 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
750 if test ! -z "$rsh_path" ; then
751 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
754 # Check for mail directory (last resort if we cannot get it from headers)
755 if test ! -z "$MAIL" ; then
756 maildir=`dirname $MAIL`
757 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
760 if test -z "$no_dev_ptmx" ; then
761 AC_CHECK_FILE("/dev/ptmx",
763 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
768 AC_CHECK_FILE("/dev/ptc",
770 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
775 # Options from here on. Some of these are preset by platform above
777 # Check for user-specified random device, otherwise check /dev/urandom
779 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
781 if test "x$withval" != "xno" ; then
782 RANDOM_POOL="$withval";
783 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
787 # Check for random device
788 AC_CHECK_FILE("/dev/urandom",
790 RANDOM_POOL="/dev/urandom";
791 AC_SUBST(RANDOM_POOL)
792 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
798 # Check for EGD pool file
799 AC_ARG_WITH(egd-pool,
800 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
802 if test "x$withval" != "xno" ; then
803 EGD_SOCKET="$withval";
804 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
809 # detect pathnames for entropy gathering commands, if we need them
810 INSTALL_SSH_PRNG_CMDS=""
812 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
813 # Use these commands to collect entropy
814 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
815 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
816 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
817 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
818 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
819 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
820 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
821 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
822 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
823 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
824 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
825 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
826 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
827 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
828 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
830 INSTALL_SSH_PRNG_CMDS="yes"
832 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
836 [ --with-catman=man|cat Install preformatted manpages[no]],
839 if test x"$withval" != x"yes" ; then
845 if test -z "$MANTYPE" ; then
846 MANTYPE='$(TROFFMAN)'
854 # Check whether user wants Kerberos support
856 AC_ARG_WITH(kerberos4,
857 [ --with-kerberos4=PATH Enable Kerberos 4 support],
859 if test "x$withval" != "xno" ; then
861 if test "x$withval" != "$xyes" ; then
862 CFLAGS="$CFLAGS -I${withval}/include"
863 LDFLAGS="$LDFLAGS -L${withval}/lib"
864 if test ! -z "$need_dash_r" ; then
865 LDFLAGS="$LDFLAGS -R${withval}/lib"
867 if test ! -z "$blibpath" ; then
868 blibpath="$blibpath:${withval}/lib"
871 if test -d /usr/include/kerberosIV ; then
872 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
876 AC_CHECK_HEADERS(krb.h)
877 AC_CHECK_LIB(krb, main)
878 if test "$ac_cv_header_krb_h" != yes; then
879 AC_MSG_WARN([Cannot find krb.h, build may fail])
881 if test "$ac_cv_lib_krb_main" != yes; then
882 AC_MSG_WARN([Cannot find libkrb, build may fail])
886 AC_CHECK_LIB(resolv, dn_expand, , )
894 # Check whether user wants AFS support
897 [ --with-afs=PATH Enable AFS support],
899 if test "x$withval" != "xno" ; then
901 if test "x$withval" != "$xyes" ; then
902 CFLAGS="$CFLAGS -I${withval}/include"
903 LFLAGS="$LFLAGS -L${withval}/lib"
906 if test -z "$KRB4" ; then
907 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
911 if test ! -z "$AFS_LIBS" ; then
912 LIBS="$LIBS $AFS_LIBS"
921 # Check whether user wants S/Key support
924 [ --with-skey Enable S/Key support],
926 if test "x$withval" != "xno" ; then
934 # Check whether user wants TCP wrappers support
936 AC_ARG_WITH(tcp-wrappers,
937 [ --with-tcp-wrappers Enable tcpwrappers support],
939 if test "x$withval" != "xno" ; then
942 AC_MSG_CHECKING(for libwrap)
946 int deny_severity = 0, allow_severity = 0;
955 AC_MSG_ERROR([*** libwrap missing])
962 # Check whether to enable MD5 passwords
964 AC_ARG_WITH(md5-passwords,
965 [ --with-md5-passwords Enable use of MD5 passwords],
967 if test "x$withval" != "xno" ; then
968 AC_DEFINE(HAVE_MD5_PASSWORDS)
974 # Whether to disable shadow password support
976 [ --without-shadow Disable shadow password support],
978 if test "x$withval" = "xno" ; then
979 AC_DEFINE(DISABLE_SHADOW)
985 if test -z "$disable_shadow" ; then
986 AC_MSG_CHECKING([if the systems has expire shadow information])
989 #include <sys/types.h>
992 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
993 [ sp_expire_available=yes ], []
996 if test "x$sp_expire_available" = "xyes" ; then
998 AC_DEFINE(HAS_SHADOW_EXPIRE)
1004 # Use ip address instead of hostname in $DISPLAY
1005 DISPLAY_HACK_MSG="no"
1006 AC_ARG_WITH(ipaddr-display,
1007 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1009 if test "x$withval" = "xno" ; then
1010 AC_DEFINE(IPADDR_IN_DISPLAY)
1011 DISPLAY_HACK_MSG="yes"
1016 # Whether to mess with the default path
1017 SERVER_PATH_MSG="(default)"
1018 AC_ARG_WITH(default-path,
1019 [ --with-default-path=PATH Specify default \$PATH environment for server],
1021 if test "x$withval" != "xno" ; then
1022 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1023 SERVER_PATH_MSG="$withval"
1028 # Whether to force IPv4 by default (needed on broken glibc Linux)
1030 AC_ARG_WITH(ipv4-default,
1031 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1033 if test "x$withval" != "xno" ; then
1034 AC_DEFINE(IPV4_DEFAULT)
1040 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1041 IPV4_IN6_HACK_MSG="no"
1043 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1045 if test "x$withval" != "xno" ; then
1047 AC_DEFINE(IPV4_IN_IPV6)
1048 IPV4_IN6_HACK_MSG="yes"
1053 if test "x$inet6_default_4in6" = "xyes"; then
1054 AC_MSG_RESULT([yes (default)])
1055 AC_DEFINE(IPV4_IN_IPV6)
1056 IPV4_IN6_HACK_MSG="yes"
1058 AC_MSG_RESULT([no (default)])
1063 # Where to place sshd.pid
1065 AC_ARG_WITH(pid-dir,
1066 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1068 if test "x$withval" != "xno" ; then
1074 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
1077 dnl allow user to disable some login recording features
1078 AC_ARG_ENABLE(lastlog,
1079 [ --disable-lastlog disable use of lastlog even if detected [no]],
1080 [ AC_DEFINE(DISABLE_LASTLOG) ]
1083 [ --disable-utmp disable use of utmp even if detected [no]],
1084 [ AC_DEFINE(DISABLE_UTMP) ]
1086 AC_ARG_ENABLE(utmpx,
1087 [ --disable-utmpx disable use of utmpx even if detected [no]],
1088 [ AC_DEFINE(DISABLE_UTMPX) ]
1091 [ --disable-wtmp disable use of wtmp even if detected [no]],
1092 [ AC_DEFINE(DISABLE_WTMP) ]
1094 AC_ARG_ENABLE(wtmpx,
1095 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1096 [ AC_DEFINE(DISABLE_WTMPX) ]
1098 AC_ARG_ENABLE(libutil,
1099 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1100 [ AC_DEFINE(DISABLE_LOGIN) ]
1102 AC_ARG_ENABLE(pututline,
1103 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1104 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1106 AC_ARG_ENABLE(pututxline,
1107 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1108 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1110 AC_ARG_WITH(lastlog,
1111 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1112 [ conf_lastlog_location="$withval"; ],)
1114 dnl lastlog, [uw]tmpx? detection
1115 dnl NOTE: set the paths in the platform section to avoid the
1116 dnl need for command-line parameters
1117 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1119 dnl lastlog detection
1120 dnl NOTE: the code itself will detect if lastlog is a directory
1121 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1123 #include <sys/types.h>
1125 #ifdef HAVE_LASTLOG_H
1126 # include <lastlog.h>
1132 [ char *lastlog = LASTLOG_FILE; ],
1133 [ AC_MSG_RESULT(yes) ],
1136 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1138 #include <sys/types.h>
1140 #ifdef HAVE_LASTLOG_H
1141 # include <lastlog.h>
1147 [ char *lastlog = _PATH_LASTLOG; ],
1148 [ AC_MSG_RESULT(yes) ],
1151 system_lastlog_path=no
1156 if test -z "$conf_lastlog_location"; then
1157 if test x"$system_lastlog_path" = x"no" ; then
1158 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1159 if (test -d "$f" || test -f "$f") ; then
1160 conf_lastlog_location=$f
1163 if test -z "$conf_lastlog_location"; then
1164 AC_MSG_WARN([** Cannot find lastlog **])
1165 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1170 if test -n "$conf_lastlog_location"; then
1171 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1175 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1177 #include <sys/types.h>
1183 [ char *utmp = UTMP_FILE; ],
1184 [ AC_MSG_RESULT(yes) ],
1186 system_utmp_path=no ]
1188 if test -z "$conf_utmp_location"; then
1189 if test x"$system_utmp_path" = x"no" ; then
1190 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1191 if test -f $f ; then
1192 conf_utmp_location=$f
1195 if test -z "$conf_utmp_location"; then
1196 AC_DEFINE(DISABLE_UTMP)
1200 if test -n "$conf_utmp_location"; then
1201 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1205 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1207 #include <sys/types.h>
1213 [ char *wtmp = WTMP_FILE; ],
1214 [ AC_MSG_RESULT(yes) ],
1216 system_wtmp_path=no ]
1218 if test -z "$conf_wtmp_location"; then
1219 if test x"$system_wtmp_path" = x"no" ; then
1220 for f in /usr/adm/wtmp /var/log/wtmp; do
1221 if test -f $f ; then
1222 conf_wtmp_location=$f
1225 if test -z "$conf_wtmp_location"; then
1226 AC_DEFINE(DISABLE_WTMP)
1230 if test -n "$conf_wtmp_location"; then
1231 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1235 dnl utmpx detection - I don't know any system so perverse as to require
1236 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1238 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1240 #include <sys/types.h>
1249 [ char *utmpx = UTMPX_FILE; ],
1250 [ AC_MSG_RESULT(yes) ],
1252 system_utmpx_path=no ]
1254 if test -z "$conf_utmpx_location"; then
1255 if test x"$system_utmpx_path" = x"no" ; then
1256 AC_DEFINE(DISABLE_UTMPX)
1259 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1263 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1265 #include <sys/types.h>
1274 [ char *wtmpx = WTMPX_FILE; ],
1275 [ AC_MSG_RESULT(yes) ],
1277 system_wtmpx_path=no ]
1279 if test -z "$conf_wtmpx_location"; then
1280 if test x"$system_wtmpx_path" = x"no" ; then
1281 AC_DEFINE(DISABLE_WTMPX)
1284 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1288 # Change default command timeout for builtin PRNG
1290 AC_ARG_WITH(entropy-timeout,
1291 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1293 if test "x$withval" != "xno" ; then
1294 entropy_timeout=$withval
1298 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1301 if test ! -z "$blibpath" ; then
1302 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1303 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1306 AC_OUTPUT(Makefile ssh_prng_cmds)
1308 # Print summary of options
1310 if test x$MANTYPE = x'$(CATMAN)' ; then
1315 if test ! -z "$RANDOM_POOL" ; then
1316 RAND_MSG="Device ($RANDOM_POOL)"
1318 if test ! -z "$EGD_SOCKET" ; then
1319 RAND_MSG="EGD ($EGD_SOCKET)"
1321 RAND_MSG="Builtin (timeout $entropy_timeout)"
1325 # Someone please show me a better way :)
1326 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1327 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1328 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1329 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1330 E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1331 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1332 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1335 echo "OpenSSH configured has been configured with the following options."
1336 echo " User binaries: $B"
1337 echo " System binaries: $C"
1338 echo " Configuration files: $D"
1339 echo " Askpass program: $E"
1340 echo " Manual pages: $F"
1341 echo " PID file: $G"
1342 echo " Random number collection: $RAND_MSG"
1343 echo " Manpage format: $MAN_MSG"
1344 echo " PAM support: ${PAM_MSG}"
1345 echo " KerberosIV support: $KRB4_MSG"
1346 echo " AFS support: $AFS_MSG"
1347 echo " S/KEY support: $SKEY_MSG"
1348 echo " TCP Wrappers support: $TCPW_MSG"
1349 echo " MD5 password support: $MD5_MSG"
1350 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1351 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1352 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1356 echo "Compiler flags: ${CFLAGS}"
1357 echo "Linker flags: ${LDFLAGS}"
1358 echo "Libraries: ${LIBS}"