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 # Use LOGIN_PROGRAM from environment if possible
18 if test ! -z "$LOGIN_PROGRAM" ; then
19 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
22 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
23 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
24 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
28 if test -z "$LD" ; then
35 if test "$GCC" = "yes"; then
36 CFLAGS="$CFLAGS -Wall"
39 # Check for some target-specific stuff
43 CFLAGS="$CFLAGS -I/usr/local/include"
44 LDFLAGS="$LDFLAGS -L/usr/local/lib"
45 if (test "$LD" != "gcc" && test -z "$blibpath"); then
46 blibpath="/usr/lib:/lib:/usr/local/lib"
48 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
49 AC_DEFINE(BROKEN_GETADDRINFO)
52 dnl AIX handles lastlog as part of its login message
53 AC_DEFINE(DISABLE_LASTLOG)
58 LIBS="$LIBS /usr/lib/textmode.o"
59 AC_DEFINE(HAVE_CYGWIN)
60 AC_DEFINE(DISABLE_PAM)
61 AC_DEFINE(DISABLE_SHADOW)
62 AC_DEFINE(IPV4_DEFAULT)
63 AC_DEFINE(IP_TOS_IS_BROKEN)
64 AC_DEFINE(BROKEN_VHANGUP)
70 if test -z "$GCC"; then
73 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
76 AC_DEFINE(DISABLE_SHADOW)
82 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
85 AC_DEFINE(DISABLE_SHADOW)
91 CFLAGS="$CFLAGS -I/usr/local/include"
96 AC_DEFINE(BROKEN_INET_NTOA)
99 CFLAGS="$CFLAGS -I/usr/local/include"
102 AC_DEFINE(WITH_IRIX_ARRAY)
103 AC_DEFINE(WITH_IRIX_PROJECT)
104 AC_DEFINE(WITH_IRIX_AUDIT)
107 AC_DEFINE(BROKEN_INET_NTOA)
111 AC_DEFINE(DONT_TRY_OTHER_AF)
112 AC_DEFINE(PAM_TTY_KLUDGE)
113 inet6_default_4in6=yes
119 conf_lastlog_location="/usr/adm/lastlog"
120 conf_utmp_location=/etc/utmp
121 conf_wtmp_location=/usr/adm/wtmp
124 CFLAGS="$CFLAGS -I/usr/local/include"
127 CFLAGS="$CFLAGS -I/usr/local/include"
128 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
130 # hardwire lastlog location (can't detect it on some versions)
131 conf_lastlog_location="/var/adm/lastlog"
132 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
133 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
134 if test "$sol2ver" -ge 8; then
136 AC_DEFINE(DISABLE_UTMP)
137 AC_DEFINE(DISABLE_WTMP)
143 CFLAGS="$CFLAGS -DSUNOS4"
144 AC_CHECK_FUNCS(getpwanam)
145 conf_utmp_location=/etc/utmp
146 conf_wtmp_location=/var/adm/wtmp
147 conf_lastlog_location=/var/adm/lastlog
153 CFLAGS="$CFLAGS -I/usr/local/include"
154 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
156 AC_DEFINE(IP_TOS_IS_BROKEN)
158 LIBS="$LIBS -lgen -lnsl -lucb"
161 CFLAGS="$CFLAGS -I/usr/local/include"
162 LDFLAGS="$LDFLAGS -L/usr/local/lib"
165 LIBS="$LIBS -lgen -lsocket"
169 CFLAGS="$CFLAGS -I/usr/local/include"
170 LDFLAGS="$LDFLAGS -L/usr/local/lib"
173 LIBS="$LIBS -lgen -lsocket"
178 if test ! -z "USE_SIA" ; then
179 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
180 if test -f /etc/sia/matrix.conf; then
182 AC_DEFINE(HAVE_OSF_SIA)
183 AC_DEFINE(DISABLE_LOGIN)
184 LIBS="$LIBS -lsecurity -ldb -lm -laud"
192 # Allow user to specify flags
194 [ --with-cflags Specify additional flags to pass to compiler],
196 if test "x$withval" != "xno" ; then
197 CFLAGS="$CFLAGS $withval"
202 [ --with-ldlags Specify additional flags to pass to linker],
204 if test "x$withval" != "xno" ; then
205 LDFLAGS="$LDFLAGS $withval"
210 [ --with-libs Specify additional libraries to link with],
212 if test "x$withval" != "xno" ; then
213 LIBS="$LIBS $withval"
219 # Checks for libraries.
220 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
221 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
223 if test -z "$no_libsocket" ; then
224 AC_CHECK_LIB(nsl, yp_match, , )
226 if test -z "$no_libnsl" ; then
227 AC_CHECK_LIB(socket, main, , )
230 # Checks for header files.
231 AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.h login_cap.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 ttyent.h usersec.h util.h utmp.h utmpx.h)
233 dnl Checks for library functions.
234 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo futimes gai_strerror getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid sigaction sigvec snprintf strerror strlcat strlcpy strsep vsnprintf vhangup _getpty __b64_ntop)
235 dnl Checks for time functions
236 AC_CHECK_FUNCS(gettimeofday time)
237 dnl Checks for libutil functions
238 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
239 dnl Checks for utmp functions
240 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
241 AC_CHECK_FUNCS(utmpname)
242 dnl Checks for utmpx functions
243 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
244 AC_CHECK_FUNCS(setutxent utmpxname)
246 AC_CHECK_FUNC(getuserattr,
247 [AC_DEFINE(HAVE_GETUSERATTR)],
248 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
252 [AC_DEFINE(HAVE_LOGIN)],
253 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
256 AC_CHECK_FUNC(daemon,
257 [AC_DEFINE(HAVE_DAEMON)],
258 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
261 AC_CHECK_FUNC(getpagesize,
262 [AC_DEFINE(HAVE_GETPAGESIZE)],
263 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
266 # Check for broken snprintf
267 if test "x$ac_cv_func_snprintf" = "xyes" ; then
268 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
272 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
274 [AC_MSG_RESULT(yes)],
277 AC_DEFINE(BROKEN_SNPRINTF)
278 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
287 [ --without-pam Disable PAM support ],
289 if test "x$withval" = "xno" ; then
291 AC_DEFINE(DISABLE_PAM)
296 if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
297 AC_CHECK_LIB(dl, dlopen, , )
300 AC_CHECK_FUNCS(pam_getenvlist)
306 # Check PAM strerror arguments (old PAM)
307 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
311 #include <security/pam_appl.h>
313 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
316 AC_DEFINE(HAVE_OLD_PAM)
318 PAM_MSG="yes (old library)"
323 # The big search for OpenSSL
325 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
327 if test "x$withval" != "$xno" ; then
334 saved_LDFLAGS="$LDFLAGS"
335 saved_CFLAGS="$CFLAGS"
336 if test "x$prefix" != "xNONE" ; then
337 tryssldir="$tryssldir $prefix"
339 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
341 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
342 if test ! -z "$ssldir" ; then
343 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
344 CFLAGS="$saved_CFLAGS -I$ssldir/include"
345 if test ! -z "$need_dash_r" ; then
346 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
349 LDFLAGS="$saved_LDFLAGS"
352 LIBS="$saved_LIBS -lcrypto"
354 # Basic test to check for compatible version and correct linking
355 # *does not* test for RSA - that comes later.
359 #include <openssl/rand.h>
363 memset(a, 0, sizeof(a));
364 RAND_add(a, sizeof(a), sizeof(a));
365 return(RAND_status() <= 0);
374 if test ! -z "$found_crypto" ; then
379 if test -z "$found_crypto" ; then
380 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
382 if test -z "$ssldir" ; then
386 ac_cv_openssldir=$ssldir
389 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
390 AC_DEFINE(HAVE_OPENSSL)
391 dnl Need to recover ssldir - test above runs in subshell
392 ssldir=$ac_cv_openssldir
393 CFLAGS="$saved_CFLAGS -I$ssldir/include"
394 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
395 if test ! -z "$need_dash_r" ; then
396 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
398 if test ! -z "$blibpath" ; then
399 blibpath="$blibpath:$ssldir:$ssldir/lib"
402 LIBS="$saved_LIBS -lcrypto"
404 # Now test RSA support
406 AC_MSG_CHECKING([for RSA support])
407 for WANTS_RSAREF in "" 1 ; do
408 if test -z "$WANTS_RSAREF" ; then
411 LIBS="$saved_LIBS -lRSAglue -lrsaref"
415 #include <openssl/rand.h>
416 #include <openssl/rsa.h>
417 #include <openssl/bn.h>
418 #include <openssl/sha.h>
421 int num; RSA *key; static unsigned char p_in[] = "blahblah";
422 unsigned char c[256], p[256];
423 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
424 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
425 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
426 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
435 if test ! -z "$no_rsa" ; then
436 AC_MSG_RESULT(disabled)
439 if test -z "$rsa_works" ; then
440 AC_MSG_WARN([*** No RSA support found *** ])
443 if test -z "$WANTS_RSAREF" ; then
447 RSA_MSG="yes (using RSAref)"
448 AC_MSG_RESULT(using RSAref)
449 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
454 # Checks for data types
455 AC_CHECK_SIZEOF(char, 1)
456 AC_CHECK_SIZEOF(short int, 2)
457 AC_CHECK_SIZEOF(int, 4)
458 AC_CHECK_SIZEOF(long int, 4)
459 AC_CHECK_SIZEOF(long long int, 8)
461 # More checks for data types
462 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
464 [ #include <sys/types.h> ],
466 [ ac_cv_have_u_int="yes" ],
467 [ ac_cv_have_u_int="no" ]
470 if test "x$ac_cv_have_u_int" = "xyes" ; then
471 AC_DEFINE(HAVE_U_INT)
475 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
477 [ #include <sys/types.h> ],
478 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
479 [ ac_cv_have_intxx_t="yes" ],
480 [ ac_cv_have_intxx_t="no" ]
483 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
484 AC_DEFINE(HAVE_INTXX_T)
488 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
490 [ #include <sys/types.h> ],
491 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
492 [ ac_cv_have_u_intxx_t="yes" ],
493 [ ac_cv_have_u_intxx_t="no" ]
496 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
497 AC_DEFINE(HAVE_U_INTXX_T)
501 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
502 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
504 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
507 #include <sys/bitypes.h>
510 int8_t a; int16_t b; int32_t c;
511 u_int8_t e; u_int16_t f; u_int32_t g;
512 a = b = c = e = f = g = 1;
515 AC_DEFINE(HAVE_U_INTXX_T)
516 AC_DEFINE(HAVE_INTXX_T)
523 if test -z "$have_u_intxx_t" ; then
524 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
527 #include <sys/types.h>
529 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
530 [ ac_cv_have_uintxx_t="yes" ],
531 [ ac_cv_have_uintxx_t="no" ]
534 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
535 AC_DEFINE(HAVE_UINTXX_T)
539 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
542 #include <sys/types.h>
543 #include <sys/socket.h>
545 [socklen_t foo; foo = 1235;],
546 [ ac_cv_have_socklen_t="yes" ],
547 [ ac_cv_have_socklen_t="no" ]
550 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
551 AC_DEFINE(HAVE_SOCKLEN_T)
554 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
557 #include <sys/types.h>
559 [ size_t foo; foo = 1235; ],
560 [ ac_cv_have_size_t="yes" ],
561 [ ac_cv_have_size_t="no" ]
564 if test "x$ac_cv_have_size_t" = "xyes" ; then
565 AC_DEFINE(HAVE_SIZE_T)
568 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
571 #include <sys/types.h>
573 [ ssize_t foo; foo = 1235; ],
574 [ ac_cv_have_ssize_t="yes" ],
575 [ ac_cv_have_ssize_t="no" ]
578 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
579 AC_DEFINE(HAVE_SSIZE_T)
582 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
585 #include <sys/types.h>
586 #include <sys/socket.h>
588 [ sa_family_t foo; foo = 1235; ],
589 [ ac_cv_have_sa_family_t="yes" ],
590 [ ac_cv_have_sa_family_t="no" ]
593 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
594 AC_DEFINE(HAVE_SA_FAMILY_T)
597 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
600 #include <sys/types.h>
602 [ pid_t foo; foo = 1235; ],
603 [ ac_cv_have_pid_t="yes" ],
604 [ ac_cv_have_pid_t="no" ]
607 if test "x$ac_cv_have_pid_t" = "xyes" ; then
608 AC_DEFINE(HAVE_PID_T)
611 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
614 #include <sys/types.h>
616 [ mode_t foo; foo = 1235; ],
617 [ ac_cv_have_mode_t="yes" ],
618 [ ac_cv_have_mode_t="no" ]
621 if test "x$ac_cv_have_mode_t" = "xyes" ; then
622 AC_DEFINE(HAVE_MODE_T)
626 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
629 #include <sys/types.h>
630 #include <sys/socket.h>
632 [ struct sockaddr_storage s; ],
633 [ ac_cv_have_struct_sockaddr_storage="yes" ],
634 [ ac_cv_have_struct_sockaddr_storage="no" ]
637 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
638 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
641 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
644 #include <sys/types.h>
645 #include <netinet/in.h>
647 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
648 [ ac_cv_have_struct_sockaddr_in6="yes" ],
649 [ ac_cv_have_struct_sockaddr_in6="no" ]
652 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
653 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
656 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
659 #include <sys/types.h>
660 #include <netinet/in.h>
662 [ struct in6_addr s; s.s6_addr[0] = 0; ],
663 [ ac_cv_have_struct_in6_addr="yes" ],
664 [ ac_cv_have_struct_in6_addr="no" ]
667 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
668 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
671 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
674 #include <sys/types.h>
675 #include <sys/socket.h>
678 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
679 [ ac_cv_have_struct_addrinfo="yes" ],
680 [ ac_cv_have_struct_addrinfo="no" ]
683 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
684 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
688 # Checks for structure members
690 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
691 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
692 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
693 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
694 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
695 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
696 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
697 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
698 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
699 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
700 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
701 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
702 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
703 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
704 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
705 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
706 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
708 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
709 ac_cv_have_sun_len_in_struct_sockaddr_un, [
712 #include <sys/types.h>
713 #include <sys/socket.h>
715 [ struct sockaddr_un s; s.sun_len = 1; ],
716 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
717 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
720 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
721 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
724 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
725 ac_cv_have_ss_family_in_struct_ss, [
728 #include <sys/types.h>
729 #include <sys/socket.h>
731 [ struct sockaddr_storage s; s.ss_family = 1; ],
732 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
733 [ ac_cv_have_ss_family_in_struct_ss="no" ],
736 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
737 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
740 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
741 ac_cv_have___ss_family_in_struct_ss, [
744 #include <sys/types.h>
745 #include <sys/socket.h>
747 [ struct sockaddr_storage s; s.__ss_family = 1; ],
748 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
749 [ ac_cv_have___ss_family_in_struct_ss="no" ]
752 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
753 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
756 AC_CACHE_CHECK([for pw_class field in struct passwd],
757 ac_cv_have_pw_class_in_struct_passwd, [
760 #include <sys/types.h>
763 [ struct passwd p s; p.pw_class = NULL; ],
764 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
765 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
768 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
769 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
773 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
775 [ extern char *__progname; printf("%s", __progname); ],
776 [ ac_cv_libc_defines___progname="yes" ],
777 [ ac_cv_libc_defines___progname="no" ]
780 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
781 AC_DEFINE(HAVE___PROGNAME)
785 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
787 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
788 [ ac_cv_libc_defines_sys_errlist="yes" ],
789 [ ac_cv_libc_defines_sys_errlist="no" ]
792 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
793 AC_DEFINE(HAVE_SYS_ERRLIST)
797 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
799 [ extern int sys_nerr; printf("%i", sys_nerr);],
800 [ ac_cv_libc_defines_sys_nerr="yes" ],
801 [ ac_cv_libc_defines_sys_nerr="no" ]
804 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
805 AC_DEFINE(HAVE_SYS_NERR)
809 # Looking for programs, paths and files
811 [ --with-rsh=PATH Specify path to remote shell program ],
813 if test "x$withval" != "$no" ; then
818 AC_PATH_PROG(rsh_path, rsh)
823 [ --with-xauth=PATH Specify path to xauth program ],
825 if test "x$withval" != "$xno" ; then
830 AC_PATH_PROG(xauth_path, xauth)
831 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
832 xauth_path="/usr/openwin/bin/xauth"
837 if test ! -z "$xauth_path" ; then
838 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
840 if test ! -z "$rsh_path" ; then
841 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
844 # Check for mail directory (last resort if we cannot get it from headers)
845 if test ! -z "$MAIL" ; then
846 maildir=`dirname $MAIL`
847 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
850 if test -z "$no_dev_ptmx" ; then
851 AC_CHECK_FILE("/dev/ptmx",
853 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
858 AC_CHECK_FILE("/dev/ptc",
860 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
865 # Options from here on. Some of these are preset by platform above
867 # Check for user-specified random device, otherwise check /dev/urandom
869 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
871 if test "x$withval" != "xno" ; then
872 RANDOM_POOL="$withval";
873 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
877 # Check for random device
878 AC_CHECK_FILE("/dev/urandom",
880 RANDOM_POOL="/dev/urandom";
881 AC_SUBST(RANDOM_POOL)
882 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
888 # Check for EGD pool file
889 AC_ARG_WITH(egd-pool,
890 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
892 if test "x$withval" != "xno" ; then
893 EGD_SOCKET="$withval";
894 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
899 # detect pathnames for entropy gathering commands, if we need them
900 INSTALL_SSH_PRNG_CMDS=""
902 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
903 # Use these commands to collect entropy
904 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
905 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
906 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
907 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
908 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
909 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
910 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
911 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
912 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
913 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
914 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
915 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
916 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
917 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
918 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
920 INSTALL_SSH_PRNG_CMDS="yes"
922 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
926 [ --with-catman=man|cat Install preformatted manpages[no]],
929 if test x"$withval" != x"yes" ; then
935 if test -z "$MANTYPE" ; then
936 MANTYPE='$(TROFFMAN)'
944 # Check whether user wants Kerberos support
946 AC_ARG_WITH(kerberos4,
947 [ --with-kerberos4=PATH Enable Kerberos 4 support],
949 if test "x$withval" != "xno" ; then
951 if test "x$withval" != "$xyes" ; then
952 CFLAGS="$CFLAGS -I${withval}/include"
953 LDFLAGS="$LDFLAGS -L${withval}/lib"
954 if test ! -z "$need_dash_r" ; then
955 LDFLAGS="$LDFLAGS -R${withval}/lib"
957 if test ! -z "$blibpath" ; then
958 blibpath="$blibpath:${withval}/lib"
961 if test -d /usr/include/kerberosIV ; then
962 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
966 AC_CHECK_HEADERS(krb.h)
967 AC_CHECK_LIB(krb, main)
968 if test "$ac_cv_header_krb_h" != yes; then
969 AC_MSG_WARN([Cannot find krb.h, build may fail])
971 if test "$ac_cv_lib_krb_main" != yes; then
972 AC_MSG_WARN([Cannot find libkrb, build may fail])
976 AC_CHECK_LIB(resolv, dn_expand, , )
984 # Check whether user wants AFS support
987 [ --with-afs=PATH Enable AFS support],
989 if test "x$withval" != "xno" ; then
991 if test "x$withval" != "$xyes" ; then
992 CFLAGS="$CFLAGS -I${withval}/include"
993 LFLAGS="$LFLAGS -L${withval}/lib"
996 if test -z "$KRB4" ; then
997 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1001 if test ! -z "$AFS_LIBS" ; then
1002 LIBS="$LIBS $AFS_LIBS"
1011 # Check whether user wants S/Key support
1014 [ --with-skey Enable S/Key support],
1016 if test "x$withval" != "xno" ; then
1024 # Check whether user wants TCP wrappers support
1026 AC_ARG_WITH(tcp-wrappers,
1027 [ --with-tcp-wrappers Enable tcpwrappers support],
1029 if test "x$withval" != "xno" ; then
1032 AC_MSG_CHECKING(for libwrap)
1036 int deny_severity = 0, allow_severity = 0;
1045 AC_MSG_ERROR([*** libwrap missing])
1052 # Check whether to enable MD5 passwords
1054 AC_ARG_WITH(md5-passwords,
1055 [ --with-md5-passwords Enable use of MD5 passwords],
1057 if test "x$withval" != "xno" ; then
1058 AC_DEFINE(HAVE_MD5_PASSWORDS)
1064 # Whether to disable shadow password support
1066 [ --without-shadow Disable shadow password support],
1068 if test "x$withval" = "xno" ; then
1069 AC_DEFINE(DISABLE_SHADOW)
1075 if test -z "$disable_shadow" ; then
1076 AC_MSG_CHECKING([if the systems has expire shadow information])
1079 #include <sys/types.h>
1082 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1083 [ sp_expire_available=yes ], []
1086 if test "x$sp_expire_available" = "xyes" ; then
1088 AC_DEFINE(HAS_SHADOW_EXPIRE)
1094 # Use ip address instead of hostname in $DISPLAY
1095 if test ! -z "$IPADDR_IN_DISPLAY" ; then
1096 DISPLAY_HACK_MSG="yes"
1097 AC_DEFINE(IPADDR_IN_DISPLAY)
1099 DISPLAY_HACK_MSG="no"
1100 AC_ARG_WITH(ipaddr-display,
1101 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1103 if test "x$withval" != "xno" ; then
1104 AC_DEFINE(IPADDR_IN_DISPLAY)
1105 DISPLAY_HACK_MSG="yes"
1111 # Whether to mess with the default path
1112 SERVER_PATH_MSG="(default)"
1113 AC_ARG_WITH(default-path,
1114 [ --with-default-path=PATH Specify default \$PATH environment for server],
1116 if test "x$withval" != "xno" ; then
1117 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1118 SERVER_PATH_MSG="$withval"
1123 # Whether to force IPv4 by default (needed on broken glibc Linux)
1125 AC_ARG_WITH(ipv4-default,
1126 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1128 if test "x$withval" != "xno" ; then
1129 AC_DEFINE(IPV4_DEFAULT)
1135 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1136 IPV4_IN6_HACK_MSG="no"
1138 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1140 if test "x$withval" != "xno" ; then
1142 AC_DEFINE(IPV4_IN_IPV6)
1143 IPV4_IN6_HACK_MSG="yes"
1148 if test "x$inet6_default_4in6" = "xyes"; then
1149 AC_MSG_RESULT([yes (default)])
1150 AC_DEFINE(IPV4_IN_IPV6)
1151 IPV4_IN6_HACK_MSG="yes"
1153 AC_MSG_RESULT([no (default)])
1158 # Where to place sshd.pid
1160 AC_ARG_WITH(pid-dir,
1161 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1163 if test "x$withval" != "xno" ; then
1169 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
1172 dnl allow user to disable some login recording features
1173 AC_ARG_ENABLE(lastlog,
1174 [ --disable-lastlog disable use of lastlog even if detected [no]],
1175 [ AC_DEFINE(DISABLE_LASTLOG) ]
1178 [ --disable-utmp disable use of utmp even if detected [no]],
1179 [ AC_DEFINE(DISABLE_UTMP) ]
1181 AC_ARG_ENABLE(utmpx,
1182 [ --disable-utmpx disable use of utmpx even if detected [no]],
1183 [ AC_DEFINE(DISABLE_UTMPX) ]
1186 [ --disable-wtmp disable use of wtmp even if detected [no]],
1187 [ AC_DEFINE(DISABLE_WTMP) ]
1189 AC_ARG_ENABLE(wtmpx,
1190 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1191 [ AC_DEFINE(DISABLE_WTMPX) ]
1193 AC_ARG_ENABLE(libutil,
1194 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1195 [ AC_DEFINE(DISABLE_LOGIN) ]
1197 AC_ARG_ENABLE(pututline,
1198 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1199 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1201 AC_ARG_ENABLE(pututxline,
1202 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1203 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1205 AC_ARG_WITH(lastlog,
1206 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1207 [ conf_lastlog_location="$withval"; ],)
1209 dnl lastlog, [uw]tmpx? detection
1210 dnl NOTE: set the paths in the platform section to avoid the
1211 dnl need for command-line parameters
1212 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1214 dnl lastlog detection
1215 dnl NOTE: the code itself will detect if lastlog is a directory
1216 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1218 #include <sys/types.h>
1220 #ifdef HAVE_LASTLOG_H
1221 # include <lastlog.h>
1227 [ char *lastlog = LASTLOG_FILE; ],
1228 [ AC_MSG_RESULT(yes) ],
1231 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1233 #include <sys/types.h>
1235 #ifdef HAVE_LASTLOG_H
1236 # include <lastlog.h>
1242 [ char *lastlog = _PATH_LASTLOG; ],
1243 [ AC_MSG_RESULT(yes) ],
1246 system_lastlog_path=no
1251 if test -z "$conf_lastlog_location"; then
1252 if test x"$system_lastlog_path" = x"no" ; then
1253 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1254 if (test -d "$f" || test -f "$f") ; then
1255 conf_lastlog_location=$f
1258 if test -z "$conf_lastlog_location"; then
1259 AC_MSG_WARN([** Cannot find lastlog **])
1260 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1265 if test -n "$conf_lastlog_location"; then
1266 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1270 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1272 #include <sys/types.h>
1278 [ char *utmp = UTMP_FILE; ],
1279 [ AC_MSG_RESULT(yes) ],
1281 system_utmp_path=no ]
1283 if test -z "$conf_utmp_location"; then
1284 if test x"$system_utmp_path" = x"no" ; then
1285 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1286 if test -f $f ; then
1287 conf_utmp_location=$f
1290 if test -z "$conf_utmp_location"; then
1291 AC_DEFINE(DISABLE_UTMP)
1295 if test -n "$conf_utmp_location"; then
1296 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1300 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1302 #include <sys/types.h>
1308 [ char *wtmp = WTMP_FILE; ],
1309 [ AC_MSG_RESULT(yes) ],
1311 system_wtmp_path=no ]
1313 if test -z "$conf_wtmp_location"; then
1314 if test x"$system_wtmp_path" = x"no" ; then
1315 for f in /usr/adm/wtmp /var/log/wtmp; do
1316 if test -f $f ; then
1317 conf_wtmp_location=$f
1320 if test -z "$conf_wtmp_location"; then
1321 AC_DEFINE(DISABLE_WTMP)
1325 if test -n "$conf_wtmp_location"; then
1326 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1330 dnl utmpx detection - I don't know any system so perverse as to require
1331 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1333 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1335 #include <sys/types.h>
1344 [ char *utmpx = UTMPX_FILE; ],
1345 [ AC_MSG_RESULT(yes) ],
1347 system_utmpx_path=no ]
1349 if test -z "$conf_utmpx_location"; then
1350 if test x"$system_utmpx_path" = x"no" ; then
1351 AC_DEFINE(DISABLE_UTMPX)
1354 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1358 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1360 #include <sys/types.h>
1369 [ char *wtmpx = WTMPX_FILE; ],
1370 [ AC_MSG_RESULT(yes) ],
1372 system_wtmpx_path=no ]
1374 if test -z "$conf_wtmpx_location"; then
1375 if test x"$system_wtmpx_path" = x"no" ; then
1376 AC_DEFINE(DISABLE_WTMPX)
1379 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1383 # Change default command timeout for builtin PRNG
1385 AC_ARG_WITH(entropy-timeout,
1386 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1388 if test "x$withval" != "xno" ; then
1389 entropy_timeout=$withval
1393 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1396 if test ! -z "$blibpath" ; then
1397 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1398 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1403 AC_OUTPUT(Makefile ssh_prng_cmds)
1405 # Print summary of options
1407 if test x$MANTYPE = x'$(CATMAN)' ; then
1412 if test ! -z "$RANDOM_POOL" ; then
1413 RAND_MSG="Device ($RANDOM_POOL)"
1415 if test ! -z "$EGD_SOCKET" ; then
1416 RAND_MSG="EGD ($EGD_SOCKET)"
1418 RAND_MSG="Builtin (timeout $entropy_timeout)"
1422 # Someone please show me a better way :)
1423 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1424 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1425 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1426 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1427 E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1428 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1429 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1432 echo "OpenSSH configured has been configured with the following options."
1433 echo " User binaries: $B"
1434 echo " System binaries: $C"
1435 echo " Configuration files: $D"
1436 echo " Askpass program: $E"
1437 echo " Manual pages: $F"
1438 echo " PID file: $G"
1439 echo " Random number collection: $RAND_MSG"
1440 echo " Manpage format: $MAN_MSG"
1441 echo " PAM support: ${PAM_MSG}"
1442 echo " KerberosIV support: $KRB4_MSG"
1443 echo " AFS support: $AFS_MSG"
1444 echo " S/KEY support: $SKEY_MSG"
1445 echo " TCP Wrappers support: $TCPW_MSG"
1446 echo " MD5 password support: $MD5_MSG"
1447 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1448 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1449 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1453 echo "Compiler flags: ${CFLAGS}"
1454 echo "Linker flags: ${LDFLAGS}"
1455 echo "Libraries: ${LIBS}"