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 if test ! -z "USE_SIA" ; then
156 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
157 if test -f /etc/sia/matrix.conf; then
159 AC_DEFINE(HAVE_OSF_SIA)
160 AC_DEFINE(DISABLE_LOGIN)
161 LIBS="$LIBS -lsecurity -ldb -lm -laud"
169 # Allow user to specify flags
171 [ --with-cflags Specify additional flags to pass to compiler],
173 if test "x$withval" != "xno" ; then
174 CFLAGS="$CFLAGS $withval"
179 [ --with-ldlags Specify additional flags to pass to linker],
181 if test "x$withval" != "xno" ; then
182 LDFLAGS="$LDFLAGS $withval"
187 [ --with-libs Specify additional libraries to link with],
189 if test "x$withval" != "xno" ; then
190 LIBS="$LIBS $withval"
196 # Checks for libraries.
197 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
198 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
200 if test -z "$no_libsocket" ; then
201 AC_CHECK_LIB(nsl, yp_match, , )
203 if test -z "$no_libnsl" ; then
204 AC_CHECK_LIB(socket, main, , )
207 # Checks for header files.
208 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)
210 # Checks for library functions.
211 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)
212 dnl checks for time functions
213 AC_CHECK_FUNCS(gettimeofday time)
214 dnl checks for libutil functions
215 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
216 dnl checks for utmp functions
217 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
218 AC_CHECK_FUNCS(utmpname)
219 dnl checks for utmpx functions
220 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
221 AC_CHECK_FUNCS(setutxent utmpxname)
224 [AC_DEFINE(HAVE_LOGIN)],
225 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
228 AC_CHECK_FUNC(daemon,
229 [AC_DEFINE(HAVE_DAEMON)],
230 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
233 AC_CHECK_FUNC(getpagesize,
234 [AC_DEFINE(HAVE_GETPAGESIZE)],
235 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
238 # Check for broken snprintf
239 if test "x$ac_cv_func_snprintf" = "xyes" ; then
240 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
244 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
246 [AC_MSG_RESULT(yes)],
249 AC_DEFINE(BROKEN_SNPRINTF)
250 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
257 [ --without-pam Disable PAM support ],
259 if test "x$withval" = "xno" ; then
261 AC_DEFINE(DISABLE_PAM)
266 if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
267 AC_CHECK_LIB(dl, dlopen, , )
270 AC_CHECK_FUNCS(pam_getenvlist)
276 # Check PAM strerror arguments (old PAM)
277 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
281 #include <security/pam_appl.h>
283 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
286 AC_DEFINE(HAVE_OLD_PAM)
288 PAM_MSG="yes (old library)"
293 # The big search for OpenSSL
295 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
297 if test "x$withval" != "$xno" ; then
304 saved_LDFLAGS="$LDFLAGS"
305 saved_CFLAGS="$CFLAGS"
306 if test "x$prefix" != "xNONE" ; then
307 tryssldir="$tryssldir $prefix"
309 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
311 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
312 if test ! -z "$ssldir" ; then
313 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
314 CFLAGS="$saved_CFLAGS -I$ssldir/include"
315 if test ! -z "$need_dash_r" ; then
316 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
319 LDFLAGS="$saved_LDFLAGS"
322 LIBS="$saved_LIBS -lcrypto"
324 # Basic test to check for compatible version and correct linking
325 # *does not* test for RSA - that comes later.
329 #include <openssl/rand.h>
333 memset(a, 0, sizeof(a));
334 RAND_add(a, sizeof(a), sizeof(a));
335 return(RAND_status() <= 0);
344 if test ! -z "$found_crypto" ; then
349 if test -z "$found_crypto" ; then
350 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
352 if test -z "$ssldir" ; then
356 ac_cv_openssldir=$ssldir
359 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
360 AC_DEFINE(HAVE_OPENSSL)
361 dnl Need to recover ssldir - test above runs in subshell
362 ssldir=$ac_cv_openssldir
363 CFLAGS="$saved_CFLAGS -I$ssldir/include"
364 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
365 if test ! -z "$need_dash_r" ; then
366 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
368 if test ! -z "$blibpath" ; then
369 blibpath="$blibpath:$ssldir:$ssldir/lib"
372 LIBS="$saved_LIBS -lcrypto"
374 # Now test RSA support
376 AC_MSG_CHECKING([for RSA support])
377 for WANTS_RSAREF in "" 1 ; do
378 if test -z "$WANTS_RSAREF" ; then
381 LIBS="$saved_LIBS -lRSAglue -lrsaref"
385 #include <openssl/rand.h>
386 #include <openssl/rsa.h>
387 #include <openssl/bn.h>
388 #include <openssl/sha.h>
391 int num; RSA *key; static unsigned char p_in[] = "blahblah";
392 unsigned char c[256], p[256];
393 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
394 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
395 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
396 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
405 if test ! -z "$no_rsa" ; then
406 AC_MSG_RESULT(disabled)
409 if test -z "$rsa_works" ; then
410 AC_MSG_WARN([*** No RSA support found *** ])
413 if test -z "$WANTS_RSAREF" ; then
417 RSA_MSG="yes (using RSAref)"
418 AC_MSG_RESULT(using RSAref)
419 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
424 # Checks for data types
425 AC_CHECK_SIZEOF(char, 1)
426 AC_CHECK_SIZEOF(short int, 2)
427 AC_CHECK_SIZEOF(int, 4)
428 AC_CHECK_SIZEOF(long int, 4)
429 AC_CHECK_SIZEOF(long long int, 8)
431 # More checks for data types
432 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
434 [ #include <sys/types.h> ],
435 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
436 [ ac_cv_have_intxx_t="yes" ],
437 [ ac_cv_have_intxx_t="no" ]
440 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
441 AC_DEFINE(HAVE_INTXX_T)
445 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
447 [ #include <sys/types.h> ],
448 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
449 [ ac_cv_have_u_intxx_t="yes" ],
450 [ ac_cv_have_u_intxx_t="no" ]
453 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
454 AC_DEFINE(HAVE_U_INTXX_T)
459 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
460 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
462 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
465 #include <sys/bitypes.h>
468 int8_t a; int16_t b; int32_t c;
469 u_int8_t e; u_int16_t f; u_int32_t g;
470 a = b = c = e = f = g = 1;
473 AC_DEFINE(HAVE_U_INTXX_T)
474 AC_DEFINE(HAVE_INTXX_T)
481 if test -z "$have_u_intxx_t" ; then
482 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
485 #include <sys/types.h>
487 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
488 [ ac_cv_have_uintxx_t="yes" ],
489 [ ac_cv_have_uintxx_t="no" ]
492 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
493 AC_DEFINE(HAVE_UINTXX_T)
497 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
500 #include <sys/types.h>
501 #include <sys/socket.h>
503 [socklen_t foo; foo = 1235;],
504 [ ac_cv_have_socklen_t="yes" ],
505 [ ac_cv_have_socklen_t="no" ]
508 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
509 AC_DEFINE(HAVE_SOCKLEN_T)
512 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
515 #include <sys/types.h>
517 [ size_t foo; foo = 1235; ],
518 [ ac_cv_have_size_t="yes" ],
519 [ ac_cv_have_size_t="no" ]
522 if test "x$ac_cv_have_size_t" = "xyes" ; then
523 AC_DEFINE(HAVE_SIZE_T)
526 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
529 #include <sys/types.h>
531 [ ssize_t foo; foo = 1235; ],
532 [ ac_cv_have_ssize_t="yes" ],
533 [ ac_cv_have_ssize_t="no" ]
536 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
537 AC_DEFINE(HAVE_SSIZE_T)
540 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
543 #include <sys/types.h>
544 #include <sys/socket.h>
546 [ sa_family_t foo; foo = 1235; ],
547 [ ac_cv_have_sa_family_t="yes" ],
548 [ ac_cv_have_sa_family_t="no" ]
551 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
552 AC_DEFINE(HAVE_SA_FAMILY_T)
555 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
558 #include <sys/types.h>
560 [ pid_t foo; foo = 1235; ],
561 [ ac_cv_have_pid_t="yes" ],
562 [ ac_cv_have_pid_t="no" ]
565 if test "x$ac_cv_have_pid_t" = "xyes" ; then
566 AC_DEFINE(HAVE_PID_T)
569 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
572 #include <sys/types.h>
574 [ mode_t foo; foo = 1235; ],
575 [ ac_cv_have_mode_t="yes" ],
576 [ ac_cv_have_mode_t="no" ]
579 if test "x$ac_cv_have_mode_t" = "xyes" ; then
580 AC_DEFINE(HAVE_MODE_T)
584 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
587 #include <sys/types.h>
588 #include <sys/socket.h>
590 [ struct sockaddr_storage s; ],
591 [ ac_cv_have_struct_sockaddr_storage="yes" ],
592 [ ac_cv_have_struct_sockaddr_storage="no" ]
595 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
596 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
599 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
602 #include <sys/types.h>
603 #include <netinet/in.h>
605 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
606 [ ac_cv_have_struct_sockaddr_in6="yes" ],
607 [ ac_cv_have_struct_sockaddr_in6="no" ]
610 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
611 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
614 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
617 #include <sys/types.h>
618 #include <netinet/in.h>
620 [ struct in6_addr s; s.s6_addr[0] = 0; ],
621 [ ac_cv_have_struct_in6_addr="yes" ],
622 [ ac_cv_have_struct_in6_addr="no" ]
625 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
626 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
629 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
632 #include <sys/types.h>
633 #include <sys/socket.h>
636 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
637 [ ac_cv_have_struct_addrinfo="yes" ],
638 [ ac_cv_have_struct_addrinfo="no" ]
641 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
642 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
646 # Checks for structure members
648 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
649 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
650 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
651 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
652 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
653 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
654 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
655 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
656 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
657 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
658 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
659 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
660 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
661 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
662 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
663 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
664 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
666 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
667 ac_cv_have_ss_family_in_struct_ss, [
670 #include <sys/types.h>
671 #include <sys/socket.h>
673 [ struct sockaddr_storage s; s.ss_family = 1; ],
674 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
675 [ ac_cv_have_ss_family_in_struct_ss="no" ],
678 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
679 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
682 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
683 ac_cv_have___ss_family_in_struct_ss, [
686 #include <sys/types.h>
687 #include <sys/socket.h>
689 [ struct sockaddr_storage s; s.__ss_family = 1; ],
690 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
691 [ ac_cv_have___ss_family_in_struct_ss="no" ]
694 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
695 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
699 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
701 [ extern char *__progname; printf("%s", __progname); ],
702 [ ac_cv_libc_defines___progname="yes" ],
703 [ ac_cv_libc_defines___progname="no" ]
706 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
707 AC_DEFINE(HAVE___PROGNAME)
711 # Looking for programs, paths and files
713 [ --with-rsh=PATH Specify path to remote shell program ],
715 if test "x$withval" != "$no" ; then
720 AC_PATH_PROG(rsh_path, rsh)
725 [ --with-xauth=PATH Specify path to xauth program ],
727 if test "x$withval" != "$xno" ; then
732 AC_PATH_PROG(xauth_path, xauth)
733 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
734 xauth_path="/usr/openwin/bin/xauth"
739 if test ! -z "$xauth_path" ; then
740 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
742 if test ! -z "$rsh_path" ; then
743 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
746 # Check for mail directory (last resort if we cannot get it from headers)
747 if test ! -z "$MAIL" ; then
748 maildir=`dirname $MAIL`
749 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
752 if test -z "$no_dev_ptmx" ; then
753 AC_CHECK_FILE("/dev/ptmx",
755 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
760 AC_CHECK_FILE("/dev/ptc",
762 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
767 # Options from here on. Some of these are preset by platform above
769 # Check for user-specified random device, otherwise check /dev/urandom
771 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
773 if test "x$withval" != "xno" ; then
774 RANDOM_POOL="$withval";
775 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
779 # Check for random device
780 AC_CHECK_FILE("/dev/urandom",
782 RANDOM_POOL="/dev/urandom";
783 AC_SUBST(RANDOM_POOL)
784 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
790 # Check for EGD pool file
791 AC_ARG_WITH(egd-pool,
792 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
794 if test "x$withval" != "xno" ; then
795 EGD_SOCKET="$withval";
796 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
801 # detect pathnames for entropy gathering commands, if we need them
802 INSTALL_SSH_PRNG_CMDS=""
804 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
805 # Use these commands to collect entropy
806 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
807 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
808 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
809 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
810 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
811 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
812 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
813 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
814 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
815 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
816 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
817 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
818 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
819 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
820 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
822 INSTALL_SSH_PRNG_CMDS="yes"
824 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
828 [ --with-catman=man|cat Install preformatted manpages[no]],
831 if test x"$withval" != x"yes" ; then
837 if test -z "$MANTYPE" ; then
838 MANTYPE='$(TROFFMAN)'
846 # Check whether user wants Kerberos support
848 AC_ARG_WITH(kerberos4,
849 [ --with-kerberos4=PATH Enable Kerberos 4 support],
851 if test "x$withval" != "xno" ; then
853 if test "x$withval" != "$xyes" ; then
854 CFLAGS="$CFLAGS -I${withval}/include"
855 LDFLAGS="$LDFLAGS -L${withval}/lib"
856 if test ! -z "$need_dash_r" ; then
857 LDFLAGS="$LDFLAGS -R${withval}/lib"
859 if test ! -z "$blibpath" ; then
860 blibpath="$blibpath:${withval}/lib"
863 if test -d /usr/include/kerberosIV ; then
864 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
868 AC_CHECK_HEADERS(krb.h)
869 AC_CHECK_LIB(krb, main)
870 if test "$ac_cv_header_krb_h" != yes; then
871 AC_MSG_WARN([Cannot find krb.h, build may fail])
873 if test "$ac_cv_lib_krb_main" != yes; then
874 AC_MSG_WARN([Cannot find libkrb, build may fail])
878 AC_CHECK_LIB(resolv, dn_expand, , )
886 # Check whether user wants AFS support
889 [ --with-afs=PATH Enable AFS support],
891 if test "x$withval" != "xno" ; then
893 if test "x$withval" != "$xyes" ; then
894 CFLAGS="$CFLAGS -I${withval}/include"
895 LFLAGS="$LFLAGS -L${withval}/lib"
898 if test -z "$KRB4" ; then
899 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
903 if test ! -z "$AFS_LIBS" ; then
904 LIBS="$LIBS $AFS_LIBS"
913 # Check whether user wants S/Key support
916 [ --with-skey Enable S/Key support],
918 if test "x$withval" != "xno" ; then
926 # Check whether user wants TCP wrappers support
928 AC_ARG_WITH(tcp-wrappers,
929 [ --with-tcp-wrappers Enable tcpwrappers support],
931 if test "x$withval" != "xno" ; then
934 AC_MSG_CHECKING(for libwrap)
938 int deny_severity = 0, allow_severity = 0;
947 AC_MSG_ERROR([*** libwrap missing])
954 # Check whether to enable MD5 passwords
956 AC_ARG_WITH(md5-passwords,
957 [ --with-md5-passwords Enable use of MD5 passwords],
959 if test "x$withval" != "xno" ; then
960 AC_DEFINE(HAVE_MD5_PASSWORDS)
966 # Whether to disable shadow password support
968 [ --without-shadow Disable shadow password support],
970 if test "x$withval" = "xno" ; then
971 AC_DEFINE(DISABLE_SHADOW)
977 if test -z "$disable_shadow" ; then
978 AC_MSG_CHECKING([if the systems has expire shadow information])
981 #include <sys/types.h>
984 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
985 [ sp_expire_available=yes ], []
988 if test "x$sp_expire_available" = "xyes" ; then
990 AC_DEFINE(HAS_SHADOW_EXPIRE)
996 # Use ip address instead of hostname in $DISPLAY
997 DISPLAY_HACK_MSG="no"
998 AC_ARG_WITH(ipaddr-display,
999 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1001 if test "x$withval" = "xno" ; then
1002 AC_DEFINE(IPADDR_IN_DISPLAY)
1003 DISPLAY_HACK_MSG="yes"
1008 # Whether to mess with the default path
1009 SERVER_PATH_MSG="(default)"
1010 AC_ARG_WITH(default-path,
1011 [ --with-default-path=PATH Specify default \$PATH environment for server],
1013 if test "x$withval" != "xno" ; then
1014 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1015 SERVER_PATH_MSG="$withval"
1020 # Whether to force IPv4 by default (needed on broken glibc Linux)
1022 AC_ARG_WITH(ipv4-default,
1023 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1025 if test "x$withval" != "xno" ; then
1026 AC_DEFINE(IPV4_DEFAULT)
1032 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1033 IPV4_IN6_HACK_MSG="no"
1035 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1037 if test "x$withval" != "xno" ; then
1039 AC_DEFINE(IPV4_IN_IPV6)
1040 IPV4_IN6_HACK_MSG="yes"
1045 if test "x$inet6_default_4in6" = "xyes"; then
1046 AC_MSG_RESULT([yes (default)])
1047 AC_DEFINE(IPV4_IN_IPV6)
1048 IPV4_IN6_HACK_MSG="yes"
1050 AC_MSG_RESULT([no (default)])
1055 # Where to place sshd.pid
1057 AC_ARG_WITH(pid-dir,
1058 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1060 if test "x$withval" != "xno" ; then
1066 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
1069 dnl allow user to disable some login recording features
1070 AC_ARG_ENABLE(lastlog,
1071 [ --disable-lastlog disable use of lastlog even if detected [no]],
1072 [ AC_DEFINE(DISABLE_LASTLOG) ]
1075 [ --disable-utmp disable use of utmp even if detected [no]],
1076 [ AC_DEFINE(DISABLE_UTMP) ]
1078 AC_ARG_ENABLE(utmpx,
1079 [ --disable-utmpx disable use of utmpx even if detected [no]],
1080 [ AC_DEFINE(DISABLE_UTMPX) ]
1083 [ --disable-wtmp disable use of wtmp even if detected [no]],
1084 [ AC_DEFINE(DISABLE_WTMP) ]
1086 AC_ARG_ENABLE(wtmpx,
1087 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1088 [ AC_DEFINE(DISABLE_WTMPX) ]
1090 AC_ARG_ENABLE(libutil,
1091 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1092 [ AC_DEFINE(DISABLE_LOGIN) ]
1094 AC_ARG_ENABLE(pututline,
1095 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1096 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1098 AC_ARG_ENABLE(pututxline,
1099 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1100 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1102 AC_ARG_WITH(lastlog,
1103 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1104 [ conf_lastlog_location="$withval"; ],)
1106 dnl lastlog, [uw]tmpx? detection
1107 dnl NOTE: set the paths in the platform section to avoid the
1108 dnl need for command-line parameters
1109 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1111 dnl lastlog detection
1112 dnl NOTE: the code itself will detect if lastlog is a directory
1113 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1115 #include <sys/types.h>
1117 #ifdef HAVE_LASTLOG_H
1118 # include <lastlog.h>
1124 [ char *lastlog = LASTLOG_FILE; ],
1125 [ AC_MSG_RESULT(yes) ],
1128 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1130 #include <sys/types.h>
1132 #ifdef HAVE_LASTLOG_H
1133 # include <lastlog.h>
1139 [ char *lastlog = _PATH_LASTLOG; ],
1140 [ AC_MSG_RESULT(yes) ],
1143 system_lastlog_path=no
1148 if test -z "$conf_lastlog_location"; then
1149 if test x"$system_lastlog_path" = x"no" ; then
1150 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1151 if (test -d "$f" || test -f "$f") ; then
1152 conf_lastlog_location=$f
1155 if test -z "$conf_lastlog_location"; then
1156 AC_MSG_WARN([** Cannot find lastlog **])
1157 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1162 if test -n "$conf_lastlog_location"; then
1163 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1167 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1169 #include <sys/types.h>
1175 [ char *utmp = UTMP_FILE; ],
1176 [ AC_MSG_RESULT(yes) ],
1178 system_utmp_path=no ]
1180 if test -z "$conf_utmp_location"; then
1181 if test x"$system_utmp_path" = x"no" ; then
1182 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1183 if test -f $f ; then
1184 conf_utmp_location=$f
1187 if test -z "$conf_utmp_location"; then
1188 AC_DEFINE(DISABLE_UTMP)
1192 if test -n "$conf_utmp_location"; then
1193 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1197 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1199 #include <sys/types.h>
1205 [ char *wtmp = WTMP_FILE; ],
1206 [ AC_MSG_RESULT(yes) ],
1208 system_wtmp_path=no ]
1210 if test -z "$conf_wtmp_location"; then
1211 if test x"$system_wtmp_path" = x"no" ; then
1212 for f in /usr/adm/wtmp /var/log/wtmp; do
1213 if test -f $f ; then
1214 conf_wtmp_location=$f
1217 if test -z "$conf_wtmp_location"; then
1218 AC_DEFINE(DISABLE_WTMP)
1222 if test -n "$conf_wtmp_location"; then
1223 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1227 dnl utmpx detection - I don't know any system so perverse as to require
1228 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1230 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1232 #include <sys/types.h>
1241 [ char *utmpx = UTMPX_FILE; ],
1242 [ AC_MSG_RESULT(yes) ],
1244 system_utmpx_path=no ]
1246 if test -z "$conf_utmpx_location"; then
1247 if test x"$system_utmpx_path" = x"no" ; then
1248 AC_DEFINE(DISABLE_UTMPX)
1251 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1255 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1257 #include <sys/types.h>
1266 [ char *wtmpx = WTMPX_FILE; ],
1267 [ AC_MSG_RESULT(yes) ],
1269 system_wtmpx_path=no ]
1271 if test -z "$conf_wtmpx_location"; then
1272 if test x"$system_wtmpx_path" = x"no" ; then
1273 AC_DEFINE(DISABLE_WTMPX)
1276 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1280 # Change default command timeout for builtin PRNG
1282 AC_ARG_WITH(entropy-timeout,
1283 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1285 if test "x$withval" != "xno" ; then
1286 entropy_timeout=$withval
1290 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1293 if test ! -z "$blibpath" ; then
1294 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1295 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1298 AC_OUTPUT(Makefile ssh_prng_cmds)
1300 # Print summary of options
1302 if test x$MANTYPE = x'$(CATMAN)' ; then
1307 if test ! -z "$RANDOM_POOL" ; then
1308 RAND_MSG="Device ($RANDOM_POOL)"
1310 if test ! -z "$EGD_SOCKET" ; then
1311 RAND_MSG="EGD ($EGD_SOCKET)"
1313 RAND_MSG="Builtin (timeout $entropy_timeout)"
1317 # Someone please show me a better way :)
1318 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1319 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1320 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1321 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1322 E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1323 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1324 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1327 echo "OpenSSH configured has been configured with the following options."
1328 echo " User binaries: $B"
1329 echo " System binaries: $C"
1330 echo " Configuration files: $D"
1331 echo " Askpass program: $E"
1332 echo " Manual pages: $F"
1333 echo " PID file: $G"
1334 echo " Random number collection: $RAND_MSG"
1335 echo " Manpage format: $MAN_MSG"
1336 echo " PAM support: ${PAM_MSG}"
1337 echo " KerberosIV support: $KRB4_MSG"
1338 echo " AFS support: $AFS_MSG"
1339 echo " S/KEY support: $SKEY_MSG"
1340 echo " TCP Wrappers support: $TCPW_MSG"
1341 echo " MD5 password support: $MD5_MSG"
1342 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1343 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1344 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1348 echo "Compiler flags: ${CFLAGS}"
1349 echo "Linker flags: ${LDFLAGS}"
1350 echo "Libraries: ${LIBS}"