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)
53 AC_MSG_CHECKING(for HPUX trusted system password database)
54 if test -f /tcb/files/auth/system/default; then
56 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
58 AC_MSG_WARN([This configuration is untested])
61 AC_DEFINE(DISABLE_SHADOW)
67 if test -z "$GCC"; then
70 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
71 AC_DEFINE(IPADDR_IN_DISPLAY)
72 AC_MSG_CHECKING(for HPUX trusted system password database)
73 if test -f /tcb/files/auth/system/default; then
75 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
77 AC_MSG_WARN([This configuration is untested])
80 AC_DEFINE(DISABLE_SHADOW)
86 CFLAGS="$CFLAGS -I/usr/local/include"
91 AC_DEFINE(BROKEN_INET_NTOA)
94 CFLAGS="$CFLAGS -I/usr/local/include"
97 AC_DEFINE(WITH_IRIX_ARRAY)
98 AC_DEFINE(WITH_IRIX_PROJECT)
99 AC_DEFINE(WITH_IRIX_AUDIT)
102 AC_DEFINE(BROKEN_INET_NTOA)
106 AC_DEFINE(DONT_TRY_OTHER_AF)
107 AC_DEFINE(PAM_TTY_KLUDGE)
108 inet6_default_4in6=yes
114 # hardwire lastlog location (can't detect it on some versions)
115 conf_lastlog_location="/usr/adm/lastlog"
116 conf_utmp_location=/etc/utmp
118 CFLAGS="$CFLAGS -I/usr/local/include"
120 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
121 AC_MSG_WARN([*** Expect 'scp' to fail!])
122 AC_MSG_WARN([*** Please report any problems, thanks])
125 CFLAGS="$CFLAGS -I/usr/local/include"
126 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
128 # hardwire lastlog location (can't detect it on some versions)
129 conf_lastlog_location="/var/adm/lastlog"
130 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
131 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
132 if test "$sol2ver" -ge 8; then
134 AC_DEFINE(DISABLE_UTMP)
135 AC_DEFINE(DISABLE_WTMP)
141 CFLAGS="$CFLAGS -DSUNOS4"
142 AC_CHECK_FUNCS(getpwanam)
143 conf_utmp_location=/etc/utmp
144 conf_wtmp_location=/var/adm/wtmp
145 conf_lastlog_location=/var/adm/lastlog
151 CFLAGS="$CFLAGS -I/usr/local/include"
152 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
154 AC_DEFINE(IP_TOS_IS_BROKEN)
156 LIBS="$LIBS -lgen -lnsl -lucb"
159 CFLAGS="$CFLAGS -I/usr/local/include"
160 LDFLAGS="$LDFLAGS -L/usr/local/lib"
163 LIBS="$LIBS -lgen -lsocket"
166 CFLAGS="$CFLAGS -I/usr/local/include"
167 LDFLAGS="$LDFLAGS -L/usr/local/lib"
170 LIBS="$LIBS -lgen -lsocket"
175 if test ! -z "USE_SIA" ; then
176 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
177 if test -f /etc/sia/matrix.conf; then
179 AC_DEFINE(HAVE_OSF_SIA)
180 AC_DEFINE(DISABLE_LOGIN)
181 LIBS="$LIBS -lsecurity -ldb -lm -laud"
189 # Allow user to specify flags
191 [ --with-cflags Specify additional flags to pass to compiler],
193 if test "x$withval" != "xno" ; then
194 CFLAGS="$CFLAGS $withval"
199 [ --with-ldlags Specify additional flags to pass to linker],
201 if test "x$withval" != "xno" ; then
202 LDFLAGS="$LDFLAGS $withval"
207 [ --with-libs Specify additional libraries to link with],
209 if test "x$withval" != "xno" ; then
210 LIBS="$LIBS $withval"
216 # Checks for libraries.
217 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
218 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
220 if test -z "$no_libsocket" ; then
221 AC_CHECK_LIB(nsl, yp_match, , )
223 if test -z "$no_libnsl" ; then
224 AC_CHECK_LIB(socket, main, , )
227 # Checks for header files.
228 AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.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 ttyent.h usersec.h util.h utmp.h utmpx.h)
230 # Checks for library functions.
231 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr 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)
232 dnl checks for time functions
233 AC_CHECK_FUNCS(gettimeofday time)
234 dnl checks for libutil functions
235 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
236 dnl checks for utmp functions
237 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
238 AC_CHECK_FUNCS(utmpname)
239 dnl checks for utmpx functions
240 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
241 AC_CHECK_FUNCS(setutxent utmpxname)
243 AC_CHECK_FUNC(getuserattr,
244 [AC_DEFINE(HAVE_GETUSERATTR)],
245 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
249 [AC_DEFINE(HAVE_LOGIN)],
250 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
253 AC_CHECK_FUNC(daemon,
254 [AC_DEFINE(HAVE_DAEMON)],
255 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
258 AC_CHECK_FUNC(getpagesize,
259 [AC_DEFINE(HAVE_GETPAGESIZE)],
260 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
263 # Check for broken snprintf
264 if test "x$ac_cv_func_snprintf" = "xyes" ; then
265 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
269 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
271 [AC_MSG_RESULT(yes)],
274 AC_DEFINE(BROKEN_SNPRINTF)
275 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
282 [ --without-pam Disable PAM support ],
284 if test "x$withval" = "xno" ; then
286 AC_DEFINE(DISABLE_PAM)
291 if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
292 AC_CHECK_LIB(dl, dlopen, , )
295 AC_CHECK_FUNCS(pam_getenvlist)
301 # Check PAM strerror arguments (old PAM)
302 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
306 #include <security/pam_appl.h>
308 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
311 AC_DEFINE(HAVE_OLD_PAM)
313 PAM_MSG="yes (old library)"
318 # The big search for OpenSSL
320 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
322 if test "x$withval" != "$xno" ; then
329 saved_LDFLAGS="$LDFLAGS"
330 saved_CFLAGS="$CFLAGS"
331 if test "x$prefix" != "xNONE" ; then
332 tryssldir="$tryssldir $prefix"
334 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
336 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
337 if test ! -z "$ssldir" ; then
338 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
339 CFLAGS="$saved_CFLAGS -I$ssldir/include"
340 if test ! -z "$need_dash_r" ; then
341 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
344 LDFLAGS="$saved_LDFLAGS"
347 LIBS="$saved_LIBS -lcrypto"
349 # Basic test to check for compatible version and correct linking
350 # *does not* test for RSA - that comes later.
354 #include <openssl/rand.h>
358 memset(a, 0, sizeof(a));
359 RAND_add(a, sizeof(a), sizeof(a));
360 return(RAND_status() <= 0);
369 if test ! -z "$found_crypto" ; then
374 if test -z "$found_crypto" ; then
375 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
377 if test -z "$ssldir" ; then
381 ac_cv_openssldir=$ssldir
384 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
385 AC_DEFINE(HAVE_OPENSSL)
386 dnl Need to recover ssldir - test above runs in subshell
387 ssldir=$ac_cv_openssldir
388 CFLAGS="$saved_CFLAGS -I$ssldir/include"
389 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
390 if test ! -z "$need_dash_r" ; then
391 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
393 if test ! -z "$blibpath" ; then
394 blibpath="$blibpath:$ssldir:$ssldir/lib"
397 LIBS="$saved_LIBS -lcrypto"
399 # Now test RSA support
401 AC_MSG_CHECKING([for RSA support])
402 for WANTS_RSAREF in "" 1 ; do
403 if test -z "$WANTS_RSAREF" ; then
406 LIBS="$saved_LIBS -lRSAglue -lrsaref"
410 #include <openssl/rand.h>
411 #include <openssl/rsa.h>
412 #include <openssl/bn.h>
413 #include <openssl/sha.h>
416 int num; RSA *key; static unsigned char p_in[] = "blahblah";
417 unsigned char c[256], p[256];
418 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
419 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
420 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
421 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
430 if test ! -z "$no_rsa" ; then
431 AC_MSG_RESULT(disabled)
434 if test -z "$rsa_works" ; then
435 AC_MSG_WARN([*** No RSA support found *** ])
438 if test -z "$WANTS_RSAREF" ; then
442 RSA_MSG="yes (using RSAref)"
443 AC_MSG_RESULT(using RSAref)
444 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
449 # Checks for data types
450 AC_CHECK_SIZEOF(char, 1)
451 AC_CHECK_SIZEOF(short int, 2)
452 AC_CHECK_SIZEOF(int, 4)
453 AC_CHECK_SIZEOF(long int, 4)
454 AC_CHECK_SIZEOF(long long int, 8)
456 # More checks for data types
457 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
459 [ #include <sys/types.h> ],
460 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
461 [ ac_cv_have_intxx_t="yes" ],
462 [ ac_cv_have_intxx_t="no" ]
465 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
466 AC_DEFINE(HAVE_INTXX_T)
470 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
472 [ #include <sys/types.h> ],
473 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
474 [ ac_cv_have_u_intxx_t="yes" ],
475 [ ac_cv_have_u_intxx_t="no" ]
478 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
479 AC_DEFINE(HAVE_U_INTXX_T)
484 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
485 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
487 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
490 #include <sys/bitypes.h>
493 int8_t a; int16_t b; int32_t c;
494 u_int8_t e; u_int16_t f; u_int32_t g;
495 a = b = c = e = f = g = 1;
498 AC_DEFINE(HAVE_U_INTXX_T)
499 AC_DEFINE(HAVE_INTXX_T)
506 if test -z "$have_u_intxx_t" ; then
507 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
510 #include <sys/types.h>
512 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
513 [ ac_cv_have_uintxx_t="yes" ],
514 [ ac_cv_have_uintxx_t="no" ]
517 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
518 AC_DEFINE(HAVE_UINTXX_T)
522 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
525 #include <sys/types.h>
526 #include <sys/socket.h>
528 [socklen_t foo; foo = 1235;],
529 [ ac_cv_have_socklen_t="yes" ],
530 [ ac_cv_have_socklen_t="no" ]
533 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
534 AC_DEFINE(HAVE_SOCKLEN_T)
537 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
540 #include <sys/types.h>
542 [ size_t foo; foo = 1235; ],
543 [ ac_cv_have_size_t="yes" ],
544 [ ac_cv_have_size_t="no" ]
547 if test "x$ac_cv_have_size_t" = "xyes" ; then
548 AC_DEFINE(HAVE_SIZE_T)
551 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
554 #include <sys/types.h>
556 [ ssize_t foo; foo = 1235; ],
557 [ ac_cv_have_ssize_t="yes" ],
558 [ ac_cv_have_ssize_t="no" ]
561 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
562 AC_DEFINE(HAVE_SSIZE_T)
565 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
568 #include <sys/types.h>
569 #include <sys/socket.h>
571 [ sa_family_t foo; foo = 1235; ],
572 [ ac_cv_have_sa_family_t="yes" ],
573 [ ac_cv_have_sa_family_t="no" ]
576 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
577 AC_DEFINE(HAVE_SA_FAMILY_T)
580 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
583 #include <sys/types.h>
585 [ pid_t foo; foo = 1235; ],
586 [ ac_cv_have_pid_t="yes" ],
587 [ ac_cv_have_pid_t="no" ]
590 if test "x$ac_cv_have_pid_t" = "xyes" ; then
591 AC_DEFINE(HAVE_PID_T)
594 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
597 #include <sys/types.h>
599 [ mode_t foo; foo = 1235; ],
600 [ ac_cv_have_mode_t="yes" ],
601 [ ac_cv_have_mode_t="no" ]
604 if test "x$ac_cv_have_mode_t" = "xyes" ; then
605 AC_DEFINE(HAVE_MODE_T)
609 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
612 #include <sys/types.h>
613 #include <sys/socket.h>
615 [ struct sockaddr_storage s; ],
616 [ ac_cv_have_struct_sockaddr_storage="yes" ],
617 [ ac_cv_have_struct_sockaddr_storage="no" ]
620 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
621 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
624 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
627 #include <sys/types.h>
628 #include <netinet/in.h>
630 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
631 [ ac_cv_have_struct_sockaddr_in6="yes" ],
632 [ ac_cv_have_struct_sockaddr_in6="no" ]
635 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
636 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
639 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
642 #include <sys/types.h>
643 #include <netinet/in.h>
645 [ struct in6_addr s; s.s6_addr[0] = 0; ],
646 [ ac_cv_have_struct_in6_addr="yes" ],
647 [ ac_cv_have_struct_in6_addr="no" ]
650 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
651 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
654 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
657 #include <sys/types.h>
658 #include <sys/socket.h>
661 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
662 [ ac_cv_have_struct_addrinfo="yes" ],
663 [ ac_cv_have_struct_addrinfo="no" ]
666 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
667 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
671 # Checks for structure members
673 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
674 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
675 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
676 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
677 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
678 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
679 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
680 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
681 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
682 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
683 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
684 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
685 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
686 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
687 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
688 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
689 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
691 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
692 ac_cv_have_sun_len_in_struct_sockaddr_un, [
695 #include <sys/types.h>
696 #include <sys/socket.h>
698 [ struct sockaddr_un s; s.sun_len = 1; ],
699 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
700 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
703 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
704 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
707 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
708 ac_cv_have_ss_family_in_struct_ss, [
711 #include <sys/types.h>
712 #include <sys/socket.h>
714 [ struct sockaddr_storage s; s.ss_family = 1; ],
715 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
716 [ ac_cv_have_ss_family_in_struct_ss="no" ],
719 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
720 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
723 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
724 ac_cv_have___ss_family_in_struct_ss, [
727 #include <sys/types.h>
728 #include <sys/socket.h>
730 [ struct sockaddr_storage s; s.__ss_family = 1; ],
731 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
732 [ ac_cv_have___ss_family_in_struct_ss="no" ]
735 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
736 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
740 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
742 [ extern char *__progname; printf("%s", __progname); ],
743 [ ac_cv_libc_defines___progname="yes" ],
744 [ ac_cv_libc_defines___progname="no" ]
747 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
748 AC_DEFINE(HAVE___PROGNAME)
752 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
754 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
755 [ ac_cv_libc_defines_sys_errlist="yes" ],
756 [ ac_cv_libc_defines_sys_errlist="no" ]
759 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
760 AC_DEFINE(HAVE_SYS_ERRLIST)
764 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
766 [ extern int sys_nerr; printf("%i", sys_nerr);],
767 [ ac_cv_libc_defines_sys_nerr="yes" ],
768 [ ac_cv_libc_defines_sys_nerr="no" ]
771 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
772 AC_DEFINE(HAVE_SYS_NERR)
776 # Looking for programs, paths and files
778 [ --with-rsh=PATH Specify path to remote shell program ],
780 if test "x$withval" != "$no" ; then
785 AC_PATH_PROG(rsh_path, rsh)
790 [ --with-xauth=PATH Specify path to xauth program ],
792 if test "x$withval" != "$xno" ; then
797 AC_PATH_PROG(xauth_path, xauth)
798 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
799 xauth_path="/usr/openwin/bin/xauth"
804 if test ! -z "$xauth_path" ; then
805 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
807 if test ! -z "$rsh_path" ; then
808 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
811 # Check for mail directory (last resort if we cannot get it from headers)
812 if test ! -z "$MAIL" ; then
813 maildir=`dirname $MAIL`
814 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
817 if test -z "$no_dev_ptmx" ; then
818 AC_CHECK_FILE("/dev/ptmx",
820 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
825 AC_CHECK_FILE("/dev/ptc",
827 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
832 # Options from here on. Some of these are preset by platform above
834 # Check for user-specified random device, otherwise check /dev/urandom
836 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
838 if test "x$withval" != "xno" ; then
839 RANDOM_POOL="$withval";
840 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
844 # Check for random device
845 AC_CHECK_FILE("/dev/urandom",
847 RANDOM_POOL="/dev/urandom";
848 AC_SUBST(RANDOM_POOL)
849 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
855 # Check for EGD pool file
856 AC_ARG_WITH(egd-pool,
857 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
859 if test "x$withval" != "xno" ; then
860 EGD_SOCKET="$withval";
861 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
866 # detect pathnames for entropy gathering commands, if we need them
867 INSTALL_SSH_PRNG_CMDS=""
869 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
870 # Use these commands to collect entropy
871 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
872 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
873 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
874 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
875 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
876 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
877 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
878 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
879 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
880 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
881 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
882 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
883 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
884 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
885 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
887 INSTALL_SSH_PRNG_CMDS="yes"
889 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
893 [ --with-catman=man|cat Install preformatted manpages[no]],
896 if test x"$withval" != x"yes" ; then
902 if test -z "$MANTYPE" ; then
903 MANTYPE='$(TROFFMAN)'
911 # Check whether user wants Kerberos support
913 AC_ARG_WITH(kerberos4,
914 [ --with-kerberos4=PATH Enable Kerberos 4 support],
916 if test "x$withval" != "xno" ; then
918 if test "x$withval" != "$xyes" ; then
919 CFLAGS="$CFLAGS -I${withval}/include"
920 LDFLAGS="$LDFLAGS -L${withval}/lib"
921 if test ! -z "$need_dash_r" ; then
922 LDFLAGS="$LDFLAGS -R${withval}/lib"
924 if test ! -z "$blibpath" ; then
925 blibpath="$blibpath:${withval}/lib"
928 if test -d /usr/include/kerberosIV ; then
929 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
933 AC_CHECK_HEADERS(krb.h)
934 AC_CHECK_LIB(krb, main)
935 if test "$ac_cv_header_krb_h" != yes; then
936 AC_MSG_WARN([Cannot find krb.h, build may fail])
938 if test "$ac_cv_lib_krb_main" != yes; then
939 AC_MSG_WARN([Cannot find libkrb, build may fail])
943 AC_CHECK_LIB(resolv, dn_expand, , )
951 # Check whether user wants AFS support
954 [ --with-afs=PATH Enable AFS support],
956 if test "x$withval" != "xno" ; then
958 if test "x$withval" != "$xyes" ; then
959 CFLAGS="$CFLAGS -I${withval}/include"
960 LFLAGS="$LFLAGS -L${withval}/lib"
963 if test -z "$KRB4" ; then
964 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
968 if test ! -z "$AFS_LIBS" ; then
969 LIBS="$LIBS $AFS_LIBS"
978 # Check whether user wants S/Key support
981 [ --with-skey Enable S/Key support],
983 if test "x$withval" != "xno" ; then
991 # Check whether user wants TCP wrappers support
993 AC_ARG_WITH(tcp-wrappers,
994 [ --with-tcp-wrappers Enable tcpwrappers support],
996 if test "x$withval" != "xno" ; then
999 AC_MSG_CHECKING(for libwrap)
1003 int deny_severity = 0, allow_severity = 0;
1012 AC_MSG_ERROR([*** libwrap missing])
1019 # Check whether to enable MD5 passwords
1021 AC_ARG_WITH(md5-passwords,
1022 [ --with-md5-passwords Enable use of MD5 passwords],
1024 if test "x$withval" != "xno" ; then
1025 AC_DEFINE(HAVE_MD5_PASSWORDS)
1031 # Whether to disable shadow password support
1033 [ --without-shadow Disable shadow password support],
1035 if test "x$withval" = "xno" ; then
1036 AC_DEFINE(DISABLE_SHADOW)
1042 if test -z "$disable_shadow" ; then
1043 AC_MSG_CHECKING([if the systems has expire shadow information])
1046 #include <sys/types.h>
1049 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1050 [ sp_expire_available=yes ], []
1053 if test "x$sp_expire_available" = "xyes" ; then
1055 AC_DEFINE(HAS_SHADOW_EXPIRE)
1061 # Use ip address instead of hostname in $DISPLAY
1062 DISPLAY_HACK_MSG="no"
1063 AC_ARG_WITH(ipaddr-display,
1064 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1066 if test "x$withval" != "xno" ; then
1067 AC_DEFINE(IPADDR_IN_DISPLAY)
1068 DISPLAY_HACK_MSG="yes"
1073 # Whether to mess with the default path
1074 SERVER_PATH_MSG="(default)"
1075 AC_ARG_WITH(default-path,
1076 [ --with-default-path=PATH Specify default \$PATH environment for server],
1078 if test "x$withval" != "xno" ; then
1079 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1080 SERVER_PATH_MSG="$withval"
1085 # Whether to force IPv4 by default (needed on broken glibc Linux)
1087 AC_ARG_WITH(ipv4-default,
1088 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1090 if test "x$withval" != "xno" ; then
1091 AC_DEFINE(IPV4_DEFAULT)
1097 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1098 IPV4_IN6_HACK_MSG="no"
1100 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1102 if test "x$withval" != "xno" ; then
1104 AC_DEFINE(IPV4_IN_IPV6)
1105 IPV4_IN6_HACK_MSG="yes"
1110 if test "x$inet6_default_4in6" = "xyes"; then
1111 AC_MSG_RESULT([yes (default)])
1112 AC_DEFINE(IPV4_IN_IPV6)
1113 IPV4_IN6_HACK_MSG="yes"
1115 AC_MSG_RESULT([no (default)])
1120 # Where to place sshd.pid
1122 AC_ARG_WITH(pid-dir,
1123 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1125 if test "x$withval" != "xno" ; then
1131 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
1134 dnl allow user to disable some login recording features
1135 AC_ARG_ENABLE(lastlog,
1136 [ --disable-lastlog disable use of lastlog even if detected [no]],
1137 [ AC_DEFINE(DISABLE_LASTLOG) ]
1140 [ --disable-utmp disable use of utmp even if detected [no]],
1141 [ AC_DEFINE(DISABLE_UTMP) ]
1143 AC_ARG_ENABLE(utmpx,
1144 [ --disable-utmpx disable use of utmpx even if detected [no]],
1145 [ AC_DEFINE(DISABLE_UTMPX) ]
1148 [ --disable-wtmp disable use of wtmp even if detected [no]],
1149 [ AC_DEFINE(DISABLE_WTMP) ]
1151 AC_ARG_ENABLE(wtmpx,
1152 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1153 [ AC_DEFINE(DISABLE_WTMPX) ]
1155 AC_ARG_ENABLE(libutil,
1156 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1157 [ AC_DEFINE(DISABLE_LOGIN) ]
1159 AC_ARG_ENABLE(pututline,
1160 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1161 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1163 AC_ARG_ENABLE(pututxline,
1164 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1165 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1167 AC_ARG_WITH(lastlog,
1168 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1169 [ conf_lastlog_location="$withval"; ],)
1171 dnl lastlog, [uw]tmpx? detection
1172 dnl NOTE: set the paths in the platform section to avoid the
1173 dnl need for command-line parameters
1174 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1176 dnl lastlog detection
1177 dnl NOTE: the code itself will detect if lastlog is a directory
1178 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1180 #include <sys/types.h>
1182 #ifdef HAVE_LASTLOG_H
1183 # include <lastlog.h>
1189 [ char *lastlog = LASTLOG_FILE; ],
1190 [ AC_MSG_RESULT(yes) ],
1193 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1195 #include <sys/types.h>
1197 #ifdef HAVE_LASTLOG_H
1198 # include <lastlog.h>
1204 [ char *lastlog = _PATH_LASTLOG; ],
1205 [ AC_MSG_RESULT(yes) ],
1208 system_lastlog_path=no
1213 if test -z "$conf_lastlog_location"; then
1214 if test x"$system_lastlog_path" = x"no" ; then
1215 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1216 if (test -d "$f" || test -f "$f") ; then
1217 conf_lastlog_location=$f
1220 if test -z "$conf_lastlog_location"; then
1221 AC_MSG_WARN([** Cannot find lastlog **])
1222 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1227 if test -n "$conf_lastlog_location"; then
1228 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1232 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1234 #include <sys/types.h>
1240 [ char *utmp = UTMP_FILE; ],
1241 [ AC_MSG_RESULT(yes) ],
1243 system_utmp_path=no ]
1245 if test -z "$conf_utmp_location"; then
1246 if test x"$system_utmp_path" = x"no" ; then
1247 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1248 if test -f $f ; then
1249 conf_utmp_location=$f
1252 if test -z "$conf_utmp_location"; then
1253 AC_DEFINE(DISABLE_UTMP)
1257 if test -n "$conf_utmp_location"; then
1258 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1262 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1264 #include <sys/types.h>
1270 [ char *wtmp = WTMP_FILE; ],
1271 [ AC_MSG_RESULT(yes) ],
1273 system_wtmp_path=no ]
1275 if test -z "$conf_wtmp_location"; then
1276 if test x"$system_wtmp_path" = x"no" ; then
1277 for f in /usr/adm/wtmp /var/log/wtmp; do
1278 if test -f $f ; then
1279 conf_wtmp_location=$f
1282 if test -z "$conf_wtmp_location"; then
1283 AC_DEFINE(DISABLE_WTMP)
1287 if test -n "$conf_wtmp_location"; then
1288 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1292 dnl utmpx detection - I don't know any system so perverse as to require
1293 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1295 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1297 #include <sys/types.h>
1306 [ char *utmpx = UTMPX_FILE; ],
1307 [ AC_MSG_RESULT(yes) ],
1309 system_utmpx_path=no ]
1311 if test -z "$conf_utmpx_location"; then
1312 if test x"$system_utmpx_path" = x"no" ; then
1313 AC_DEFINE(DISABLE_UTMPX)
1316 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1320 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1322 #include <sys/types.h>
1331 [ char *wtmpx = WTMPX_FILE; ],
1332 [ AC_MSG_RESULT(yes) ],
1334 system_wtmpx_path=no ]
1336 if test -z "$conf_wtmpx_location"; then
1337 if test x"$system_wtmpx_path" = x"no" ; then
1338 AC_DEFINE(DISABLE_WTMPX)
1341 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1345 # Change default command timeout for builtin PRNG
1347 AC_ARG_WITH(entropy-timeout,
1348 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1350 if test "x$withval" != "xno" ; then
1351 entropy_timeout=$withval
1355 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1358 if test ! -z "$blibpath" ; then
1359 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1360 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1363 AC_OUTPUT(Makefile ssh_prng_cmds)
1365 # Print summary of options
1367 if test x$MANTYPE = x'$(CATMAN)' ; then
1372 if test ! -z "$RANDOM_POOL" ; then
1373 RAND_MSG="Device ($RANDOM_POOL)"
1375 if test ! -z "$EGD_SOCKET" ; then
1376 RAND_MSG="EGD ($EGD_SOCKET)"
1378 RAND_MSG="Builtin (timeout $entropy_timeout)"
1382 # Someone please show me a better way :)
1383 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1384 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1385 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1386 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1387 E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1388 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1389 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1392 echo "OpenSSH configured has been configured with the following options."
1393 echo " User binaries: $B"
1394 echo " System binaries: $C"
1395 echo " Configuration files: $D"
1396 echo " Askpass program: $E"
1397 echo " Manual pages: $F"
1398 echo " PID file: $G"
1399 echo " Random number collection: $RAND_MSG"
1400 echo " Manpage format: $MAN_MSG"
1401 echo " PAM support: ${PAM_MSG}"
1402 echo " KerberosIV support: $KRB4_MSG"
1403 echo " AFS support: $AFS_MSG"
1404 echo " S/KEY support: $SKEY_MSG"
1405 echo " TCP Wrappers support: $TCPW_MSG"
1406 echo " MD5 password support: $MD5_MSG"
1407 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1408 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1409 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1413 echo "Compiler flags: ${CFLAGS}"
1414 echo "Linker flags: ${LDFLAGS}"
1415 echo "Libraries: ${LIBS}"