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 CFLAGS="$CFLAGS -I/usr/local/include"
107 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
109 # hardwire lastlog location (can't detect it on some versions)
110 conf_lastlog_location="/var/adm/lastlog"
111 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
112 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
113 if test "$sol2ver" -ge 8; then
115 AC_DEFINE(DISABLE_UTMP)
116 AC_DEFINE(DISABLE_WTMP)
122 CFLAGS="$CFLAGS -DSUNOS4"
123 AC_CHECK_FUNCS(getpwanam)
126 CFLAGS="$CFLAGS -I/usr/local/include"
127 LDFLAGS="$LDFLAGS -L/usr/local/lib"
130 LIBS="$LIBS -lgen -lsocket"
133 CFLAGS="$CFLAGS -I/usr/local/include"
134 LDFLAGS="$LDFLAGS -L/usr/local/lib"
137 LIBS="$LIBS -lgen -lsocket"
142 # Allow user to specify flags
144 [ --with-cflags Specify additional flags to pass to compiler],
146 if test "x$withval" != "xno" ; then
147 CFLAGS="$CFLAGS $withval"
152 [ --with-ldlags Specify additional flags to pass to linker],
154 if test "x$withval" != "xno" ; then
155 LDFLAGS="$LDFLAGS $withval"
160 [ --with-libs Specify additional libraries to link with],
162 if test "x$withval" != "xno" ; then
163 LIBS="$LIBS $withval"
169 # Checks for libraries.
170 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
171 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
173 if test -z "$no_libsocket" ; then
174 AC_CHECK_LIB(nsl, yp_match, , )
176 if test -z "$no_libnsl" ; then
177 AC_CHECK_LIB(socket, main, , )
180 # Checks for header files.
181 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/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h util.h utmp.h utmpx.h)
183 # Checks for library functions.
184 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)
185 dnl checks for time functions
186 AC_CHECK_FUNCS(gettimeofday time)
187 dnl checks for libutil functions
188 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
189 dnl checks for utmp functions
190 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
191 AC_CHECK_FUNCS(utmpname)
192 dnl checks for utmpx functions
193 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
194 AC_CHECK_FUNCS(setutxent utmpxname)
197 [AC_DEFINE(HAVE_LOGIN)],
198 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
201 AC_CHECK_FUNC(daemon,
202 [AC_DEFINE(HAVE_DAEMON)],
203 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
206 AC_CHECK_FUNC(getpagesize,
207 [AC_DEFINE(HAVE_GETPAGESIZE)],
208 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
212 [ --without-pam Disable PAM support ],
214 if test "x$withval" = "xno" ; then
216 AC_DEFINE(DISABLE_PAM)
220 if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
221 AC_CHECK_LIB(dl, dlopen, , )
224 AC_CHECK_FUNCS(pam_getenvlist)
226 # Check PAM strerror arguments (old PAM)
227 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
231 #include <security/pam_appl.h>
233 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
236 AC_DEFINE(HAVE_OLD_PAM)
242 # The big search for OpenSSL
244 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
246 if test "x$withval" != "$xno" ; then
253 saved_LDFLAGS="$LDFLAGS"
254 saved_CFLAGS="$CFLAGS"
255 if test "x$prefix" != "xNONE" ; then
256 tryssldir="$tryssldir $prefix"
258 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
260 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
261 if test ! -z "$ssldir" ; then
262 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
263 CFLAGS="$saved_CFLAGS -I$ssldir/include"
264 if test ! -z "$need_dash_r" ; then
265 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
268 LDFLAGS="$saved_LDFLAGS"
271 LIBS="$saved_LIBS -lcrypto"
273 # Basic test to check for compatible version and correct linking
274 # *does not* test for RSA - that comes later.
278 #include <openssl/rand.h>
282 memset(a, 0, sizeof(a));
283 RAND_add(a, sizeof(a), sizeof(a));
284 return(RAND_status() <= 0);
293 if test ! -z "$found_crypto" ; then
298 if test -z "$found_crypto" ; then
299 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
301 if test -z "$ssldir" ; then
305 ac_cv_openssldir=$ssldir
308 if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
309 AC_DEFINE(HAVE_OPENSSL)
310 dnl Need to recover ssldir - test above runs in subshell
311 ssldir=$ac_cv_openssldir
312 CFLAGS="$saved_CFLAGS -I$ssldir/include"
313 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
314 if test ! -z "$need_dash_r" ; then
315 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
317 if test ! -z "$blibpath" ; then
318 blibpath="$blibpath:$ssldir:$ssldir/lib"
321 LIBS="$saved_LIBS -lcrypto"
323 # Now test RSA support
325 AC_MSG_CHECKING([for RSA support])
326 for WANTS_RSAREF in "" 1 ; do
327 if test -z "$WANTS_RSAREF" ; then
330 LIBS="$saved_LIBS -lRSAglue -lrsaref"
334 #include <openssl/rand.h>
335 #include <openssl/rsa.h>
336 #include <openssl/bn.h>
337 #include <openssl/sha.h>
340 int num; RSA *key; static unsigned char p_in[] = "blahblah";
341 unsigned char c[256], p[256];
342 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
343 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
344 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
345 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
354 if test ! -z "$no_rsa" ; then
355 AC_MSG_RESULT(disabled)
357 if test -z "$rsa_works" ; then
358 AC_MSG_WARN([*** No RSA support found *** ])
360 if test -z "$WANTS_RSAREF" ; then
363 AC_MSG_RESULT(using RSAref)
364 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
369 # Checks for data types
370 AC_CHECK_SIZEOF(char, 1)
371 AC_CHECK_SIZEOF(short int, 2)
372 AC_CHECK_SIZEOF(int, 4)
373 AC_CHECK_SIZEOF(long int, 4)
374 AC_CHECK_SIZEOF(long long int, 8)
376 # More checks for data types
377 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
379 [ #include <sys/types.h> ],
380 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
381 [ ac_cv_have_intxx_t="yes" ],
382 [ ac_cv_have_intxx_t="no" ]
385 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
386 AC_DEFINE(HAVE_INTXX_T)
390 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
392 [ #include <sys/types.h> ],
393 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
394 [ ac_cv_have_u_intxx_t="yes" ],
395 [ ac_cv_have_u_intxx_t="no" ]
398 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
399 AC_DEFINE(HAVE_U_INTXX_T)
404 if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
405 "x$ac_cv_header_sys_bitypes_h" = "xyes"
407 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
410 #include <sys/bitypes.h>
413 int8_t a; int16_t b; int32_t c;
414 u_int8_t e; u_int16_t f; u_int32_t g;
415 a = b = c = e = f = g = 1;
418 AC_DEFINE(HAVE_U_INTXX_T)
419 AC_DEFINE(HAVE_INTXX_T)
426 if test -z "$have_u_intxx_t" ; then
427 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
430 #include <sys/types.h>
432 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
433 [ ac_cv_have_uintxx_t="yes" ],
434 [ ac_cv_have_uintxx_t="no" ]
437 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
438 AC_DEFINE(HAVE_UINTXX_T)
442 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
445 #include <sys/types.h>
446 #include <sys/socket.h>
448 [socklen_t foo; foo = 1235;],
449 [ ac_cv_have_socklen_t="yes" ],
450 [ ac_cv_have_socklen_t="no" ]
453 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
454 AC_DEFINE(HAVE_SOCKLEN_T)
457 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
460 #include <sys/types.h>
462 [ size_t foo; foo = 1235; ],
463 [ ac_cv_have_size_t="yes" ],
464 [ ac_cv_have_size_t="no" ]
467 if test "x$ac_cv_have_size_t" = "xyes" ; then
468 AC_DEFINE(HAVE_SIZE_T)
471 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
474 #include <sys/types.h>
476 [ ssize_t foo; foo = 1235; ],
477 [ ac_cv_have_ssize_t="yes" ],
478 [ ac_cv_have_ssize_t="no" ]
481 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
482 AC_DEFINE(HAVE_SSIZE_T)
486 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
489 #include <sys/types.h>
490 #include <sys/socket.h>
492 [ struct sockaddr_storage s; ],
493 [ ac_cv_have_struct_sockaddr_storage="yes" ],
494 [ ac_cv_have_struct_sockaddr_storage="no" ]
497 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
498 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
501 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
504 #include <netinet/in.h>
506 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
507 [ ac_cv_have_struct_sockaddr_in6="yes" ],
508 [ ac_cv_have_struct_sockaddr_in6="no" ]
511 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
512 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
515 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
518 #include <netinet/in.h>
520 [ struct in6_addr s; s.s6_addr[0] = 0; ],
521 [ ac_cv_have_struct_in6_addr="yes" ],
522 [ ac_cv_have_struct_in6_addr="no" ]
525 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
526 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
529 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
532 #include <sys/types.h>
533 #include <sys/socket.h>
536 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
537 [ ac_cv_have_struct_addrinfo="yes" ],
538 [ ac_cv_have_struct_addrinfo="no" ]
541 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
542 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
546 # Checks for structure members
548 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
549 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
550 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
551 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
552 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
553 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
554 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
555 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
556 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
557 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
558 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
559 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
560 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
561 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
562 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
563 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
567 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
568 ac_cv_have_ss_family_in_struct_ss, [
571 #include <sys/types.h>
572 #include <sys/socket.h>
574 [ struct sockaddr_storage s; s.ss_family = 1; ],
575 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
576 [ ac_cv_have_ss_family_in_struct_ss="no" ],
579 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
580 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
584 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
585 ac_cv_have___ss_family_in_struct_ss, [
588 #include <sys/types.h>
589 #include <sys/socket.h>
591 [ struct sockaddr_storage s; s.__ss_family = 1; ],
592 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
593 [ ac_cv_have___ss_family_in_struct_ss="no" ]
596 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
597 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
601 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
603 [ extern char *__progname; printf("%s", __progname); ],
604 [ ac_cv_libc_defines___progname="yes" ],
605 [ ac_cv_libc_defines___progname="no" ]
608 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
609 AC_DEFINE(HAVE___PROGNAME)
613 # Looking for programs, paths and files
615 [ --with-rsh=PATH Specify path to remote shell program ],
617 if test "x$withval" != "$no" ; then
618 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
622 AC_PATH_PROG(rsh_path, rsh)
627 [ --with-xauth=PATH Specify path to xauth program ],
629 if test "x$withval" != "$xno" ; then
630 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval")
634 AC_PATH_PROG(xauth_path, xauth)
635 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
636 xauth_path="/usr/openwin/bin/xauth"
641 if test ! -z "$xauth_path" ; then
642 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
644 if test ! -z "$rsh_path" ; then
645 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
648 # Check for mail directory (last resort if we cannot get it from headers)
649 if test ! -z "$MAIL" ; then
650 maildir=`dirname $MAIL`
651 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
654 if test -z "$no_dev_ptmx" ; then
655 AC_CHECK_FILE("/dev/ptmx",
657 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
662 AC_CHECK_FILE("/dev/ptc",
664 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
669 # Options from here on. Some of these are preset by platform above
671 # Check for user-specified random device, otherwise check /dev/urandom
673 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
675 if test "x$withval" != "xno" ; then
676 RANDOM_POOL="$withval";
677 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
681 # Check for random device
682 AC_CHECK_FILE("/dev/urandom",
684 RANDOM_POOL="/dev/urandom";
685 AC_SUBST(RANDOM_POOL)
686 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
692 # Check for EGD pool file
693 AC_ARG_WITH(egd-pool,
694 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
696 if test "x$withval" != "xno" ; then
697 EGD_SOCKET="$withval";
698 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
703 # detect pathnames for entropy gathering commands, if we need them
704 INSTALL_SSH_PRNG_CMDS=""
706 if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
707 # Use these commands to collect entropy
708 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
709 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
710 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
711 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
712 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
713 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
714 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
715 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
716 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
717 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
718 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
719 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
720 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
721 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
722 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
724 INSTALL_SSH_PRNG_CMDS="yes"
726 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
730 [ --with-catman=man|cat Install preformatted manpages[no]],
733 if test x"$withval" != x"yes" ; then
739 if test -z "$MANTYPE" ; then
740 MANTYPE='$(TROFFMAN)'
748 # Check whether user wants Kerberos support
749 AC_ARG_WITH(kerberos4,
750 [ --with-kerberos4=PATH Enable Kerberos 4 support],
752 if test "x$withval" != "xno" ; then
754 if test "x$withval" != "$xyes" ; then
755 CFLAGS="$CFLAGS -I${withval}/include"
756 LDFLAGS="$LDFLAGS -L${withval}/lib"
757 if test ! -z "$need_dash_r" ; then
758 LDFLAGS="$LDFLAGS -R${withval}/lib"
760 if test ! -z "$blibpath" ; then
761 blibpath="$blibpath:${withval}/lib"
764 if test -d /usr/include/kerberosIV ; then
765 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
769 AC_CHECK_HEADERS(krb.h)
770 AC_CHECK_LIB(krb, main)
771 if test "$ac_cv_header_krb_h" != yes; then
772 AC_MSG_WARN([Cannot find krb.h, build may fail])
774 if test "$ac_cv_lib_krb_main" != yes; then
775 AC_MSG_WARN([Cannot find libkrb, build may fail])
779 AC_CHECK_LIB(resolv, dn_expand, , )
786 # Check whether user wants AFS support
788 [ --with-afs=PATH Enable AFS support],
790 if test "x$withval" != "xno" ; then
792 if test "x$withval" != "$xyes" ; then
793 CFLAGS="$CFLAGS -I${withval}/include"
794 LFLAGS="$LFLAGS -L${withval}/lib"
797 if test -z "$KRB4" ; then
798 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
802 if test ! -z "$AFS_LIBS" ; then
803 LIBS="$LIBS $AFS_LIBS"
811 # Check whether user wants S/Key support
813 [ --with-skey Enable S/Key support],
815 if test "x$withval" != "xno" ; then
822 # Check whether user wants TCP wrappers support
823 AC_ARG_WITH(tcp-wrappers,
824 [ --with-tcp-wrappers Enable tcpwrappers support],
826 if test "x$withval" != "xno" ; then
829 AC_MSG_CHECKING(for libwrap)
833 int deny_severity = 0, allow_severity = 0;
842 AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***])
850 # Check whether to enable MD5 passwords
851 AC_ARG_WITH(md5-passwords,
852 [ --with-md5-passwords Enable use of MD5 passwords],
854 if test "x$withval" != "xno" ; then
855 AC_DEFINE(HAVE_MD5_PASSWORDS)
860 # Whether to disable shadow password support
862 [ --without-shadow Disable shadow password support],
864 if test "x$withval" = "xno" ; then
865 AC_DEFINE(DISABLE_SHADOW)
870 # Use ip address instead of hostname in $DISPLAY
871 AC_ARG_WITH(ipaddr-display,
872 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
874 if test "x$withval" = "xno" ; then
875 AC_DEFINE(IPADDR_IN_DISPLAY)
880 # Whether to mess with the default path
881 AC_ARG_WITH(default-path,
882 [ --with-default-path=PATH Specify default \$PATH environment for server],
884 if test "x$withval" != "xno" ; then
885 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
890 # Whether to force IPv4 by default (needed on broken glibc Linux)
891 AC_ARG_WITH(ipv4-default,
892 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
894 if test "x$withval" != "xno" ; then
895 AC_DEFINE(IPV4_DEFAULT)
900 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
902 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
904 if test "x$withval" != "xno" ; then
906 AC_DEFINE(IPV4_IN_IPV6)
911 if test "x$inet6_default_4in6" = "xyes"; then
912 AC_MSG_RESULT([yes (default)])
913 AC_DEFINE(IPV4_IN_IPV6)
915 AC_MSG_RESULT([no (default)])
920 # Where to place sshd.pid
923 [ --with-pid-dir=PATH Specify location of ssh.pid file],
925 if test "x$withval" != "xno" ; then
931 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
934 dnl allow user to disable some login recording features
935 AC_ARG_ENABLE(lastlog,
936 [ --disable-lastlog disable use of lastlog even if detected [no]],
937 [ AC_DEFINE(DISABLE_LASTLOG) ]
940 [ --disable-utmp disable use of utmp even if detected [no]],
941 [ AC_DEFINE(DISABLE_UTMP) ]
944 [ --disable-utmpx disable use of utmpx even if detected [no]],
945 [ AC_DEFINE(DISABLE_UTMPX) ]
948 [ --disable-wtmp disable use of wtmp even if detected [no]],
949 [ AC_DEFINE(DISABLE_WTMP) ]
952 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
953 [ AC_DEFINE(DISABLE_WTMPX) ]
955 AC_ARG_ENABLE(libutil,
956 [ --disable-libutil disable use of libutil (login() etc.) [no]],
957 [ AC_DEFINE(DISABLE_LOGIN) ]
959 AC_ARG_ENABLE(pututline,
960 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
961 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
963 AC_ARG_ENABLE(pututxline,
964 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
965 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
968 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
969 [ conf_lastlog_location="$withval"; ],)
971 dnl lastlog, [uw]tmpx? detection
972 dnl NOTE: set the paths in the platform section to avoid the
973 dnl need for command-line parameters
974 dnl lastlog and [uw]tmp are subject to a file search if all else fails
976 dnl lastlog detection
977 dnl NOTE: the code itself will detect if lastlog is a directory
978 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
980 #include <sys/types.h>
982 #ifdef HAVE_LASTLOG_H
983 # include <lastlog.h>
989 [ char *lastlog = LASTLOG_FILE; ],
990 [ AC_MSG_RESULT(yes) ],
993 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
995 #include <sys/types.h>
997 #ifdef HAVE_LASTLOG_H
998 # include <lastlog.h>
1004 [ char *lastlog = _PATH_LASTLOG; ],
1005 [ AC_MSG_RESULT(yes) ],
1008 system_lastlog_path=no
1013 if test -z "$conf_lastlog_location"; then
1014 if test x"$system_lastlog_path" = x"no" ; then
1015 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1016 if test -d "$f" -o -f "$f" ; then
1017 conf_lastlog_location=$f
1020 if test -z "$conf_lastlog_location"; then
1021 AC_MSG_WARN([** Cannot find lastlog **])
1022 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1027 if test -n "$conf_lastlog_location"; then
1028 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1032 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1034 #include <sys/types.h>
1040 [ char *utmp = UTMP_FILE; ],
1041 [ AC_MSG_RESULT(yes) ],
1043 system_utmp_path=no ]
1045 if test -z "$conf_utmp_location"; then
1046 if test x"$system_utmp_path" = x"no" ; then
1047 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1048 if test -f $f ; then
1049 conf_utmp_location=$f
1052 if test -z "$conf_utmp_location"; then
1053 AC_DEFINE(DISABLE_UTMP)
1057 if test -n "$conf_utmp_location"; then
1058 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1062 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1064 #include <sys/types.h>
1070 [ char *wtmp = WTMP_FILE; ],
1071 [ AC_MSG_RESULT(yes) ],
1073 system_wtmp_path=no ]
1075 if test -z "$conf_wtmp_location"; then
1076 if test x"$system_wtmp_path" = x"no" ; then
1077 for f in /usr/adm/wtmp /var/log/wtmp; do
1078 if test -f $f ; then
1079 conf_wtmp_location=$f
1082 if test -z "$conf_wtmp_location"; then
1083 AC_DEFINE(DISABLE_WTMP)
1087 if test -n "$conf_wtmp_location"; then
1088 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1092 dnl utmpx detection - I don't know any system so perverse as to require
1093 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1095 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1097 #include <sys/types.h>
1106 [ char *utmpx = UTMPX_FILE; ],
1107 [ AC_MSG_RESULT(yes) ],
1109 system_utmpx_path=no ]
1111 if test -z "$conf_utmpx_location"; then
1112 if test x"$system_utmpx_path" = x"no" ; then
1113 AC_DEFINE(DISABLE_UTMPX)
1116 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1120 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1122 #include <sys/types.h>
1131 [ char *wtmpx = WTMPX_FILE; ],
1132 [ AC_MSG_RESULT(yes) ],
1134 system_wtmpx_path=no ]
1136 if test -z "$conf_wtmpx_location"; then
1137 if test x"$system_wtmpx_path" = x"no" ; then
1138 AC_DEFINE(DISABLE_WTMPX)
1141 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1145 # Change default command timeout for builtin PRNG
1147 AC_ARG_WITH(entropy-timeout,
1148 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1150 if test "x$withval" != "xno" ; then
1151 entropy_timeout=$withval
1155 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1158 if test ! -z "$blibpath" ; then
1159 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1160 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1163 AC_OUTPUT(Makefile ssh_prng_cmds)