3 AC_CONFIG_HEADER(config.h)
11 AC_CHECK_PROG(AR, ar, ar)
12 AC_PATH_PROG(PERL, perl)
14 AC_PATH_PROG(ENT, ent)
17 if test -z "$LD" ; then
24 if test "$GCC" = "yes"; then
25 CFLAGS="$CFLAGS -Wall"
28 # Check for some target-specific stuff
32 CFLAGS="$CFLAGS -I/usr/local/include"
33 LDFLAGS="$LDFLAGS -L/usr/local/lib"
34 if (test "$LD" != "gcc" && test -z "$blibpath"); then
35 blibpath="/usr/lib:/lib:/usr/local/lib"
37 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
38 AC_DEFINE(BROKEN_GETADDRINFO)
41 dnl AIX handles lastlog as part of its login message
42 AC_DEFINE(DISABLE_LASTLOG)
47 if test -z "$GCC"; then
50 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
51 AC_DEFINE(IPADDR_IN_DISPLAY)
52 AC_MSG_CHECKING(for HPUX trusted system password database)
53 if test -f /tcb/files/auth/system/default; then
55 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
57 AC_MSG_WARN([This configuration is untested])
60 AC_DEFINE(DISABLE_SHADOW)
66 if test -z "$GCC"; then
69 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
70 AC_DEFINE(IPADDR_IN_DISPLAY)
71 AC_MSG_CHECKING(for HPUX trusted system password database)
72 if test -f /tcb/files/auth/system/default; then
74 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
76 AC_MSG_WARN([This configuration is untested])
79 AC_DEFINE(DISABLE_SHADOW)
85 CFLAGS="$CFLAGS -I/usr/local/include"
92 CFLAGS="$CFLAGS -I/usr/local/include"
95 AC_DEFINE(WITH_IRIX_ARRAY)
96 AC_DEFINE(WITH_IRIX_PROJECT)
97 AC_DEFINE(WITH_IRIX_AUDIT)
103 AC_DEFINE(DONT_TRY_OTHER_AF)
104 AC_DEFINE(PAM_TTY_KLUDGE)
105 inet6_default_4in6=yes
111 # hardwire lastlog location (can't detect it on some versions)
112 conf_lastlog_location="/usr/adm/lastlog"
113 conf_utmp_location=/etc/utmp
115 CFLAGS="$CFLAGS -I/usr/local/include"
117 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
118 AC_MSG_WARN([*** Expect 'scp' to fail!])
119 AC_MSG_WARN([*** Please report any problems, thanks])
122 CFLAGS="$CFLAGS -I/usr/local/include"
123 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
125 # hardwire lastlog location (can't detect it on some versions)
126 conf_lastlog_location="/var/adm/lastlog"
127 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
128 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
129 if test "$sol2ver" -ge 8; then
131 AC_DEFINE(DISABLE_UTMP)
132 AC_DEFINE(DISABLE_WTMP)
138 CFLAGS="$CFLAGS -DSUNOS4"
139 AC_CHECK_FUNCS(getpwanam)
140 conf_utmp_location=/etc/utmp
141 conf_wtmp_location=/var/adm/wtmp
142 conf_lastlog_location=/var/adm/lastlog
147 CFLAGS="$CFLAGS -I/usr/local/include"
148 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
150 AC_DEFINE(IP_TOS_IS_BROKEN)
152 LIBS="$LIBS -lgen -lnsl -lucb"
155 CFLAGS="$CFLAGS -I/usr/local/include"
156 LDFLAGS="$LDFLAGS -L/usr/local/lib"
159 LIBS="$LIBS -lgen -lsocket"
162 CFLAGS="$CFLAGS -I/usr/local/include"
163 LDFLAGS="$LDFLAGS -L/usr/local/lib"
166 LIBS="$LIBS -lgen -lsocket"
171 if test ! -z "USE_SIA" ; then
172 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
173 if test -f /etc/sia/matrix.conf; then
175 AC_DEFINE(HAVE_OSF_SIA)
176 AC_DEFINE(DISABLE_LOGIN)
177 LIBS="$LIBS -lsecurity -ldb -lm -laud"
185 # Allow user to specify flags
187 [ --with-cflags Specify additional flags to pass to compiler],
189 if test "x$withval" != "xno" ; then
190 CFLAGS="$CFLAGS $withval"
195 [ --with-ldlags Specify additional flags to pass to linker],
197 if test "x$withval" != "xno" ; then
198 LDFLAGS="$LDFLAGS $withval"
203 [ --with-libs Specify additional libraries to link with],
205 if test "x$withval" != "xno" ; then
206 LIBS="$LIBS $withval"
212 # Checks for libraries.
213 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
214 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
216 if test -z "$no_libsocket" ; then
217 AC_CHECK_LIB(nsl, yp_match, , )
219 if test -z "$no_libnsl" ; then
220 AC_CHECK_LIB(socket, main, , )
223 # Checks for header files.
224 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 usersec.h util.h utmp.h utmpx.h)
226 # Checks for library functions.
227 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage inet_aton 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)
228 dnl checks for time functions
229 AC_CHECK_FUNCS(gettimeofday time)
230 dnl checks for libutil functions
231 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
232 dnl checks for utmp functions
233 AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
234 AC_CHECK_FUNCS(utmpname)
235 dnl checks for utmpx functions
236 AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
237 AC_CHECK_FUNCS(setutxent utmpxname)
239 AC_CHECK_FUNC(getuserattr,
240 [AC_DEFINE(HAVE_GETUSERATTR)],
241 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
245 [AC_DEFINE(HAVE_LOGIN)],
246 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
249 AC_CHECK_FUNC(daemon,
250 [AC_DEFINE(HAVE_DAEMON)],
251 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
254 AC_CHECK_FUNC(getpagesize,
255 [AC_DEFINE(HAVE_GETPAGESIZE)],
256 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
259 # Check for broken snprintf
260 if test "x$ac_cv_func_snprintf" = "xyes" ; then
261 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
265 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
267 [AC_MSG_RESULT(yes)],
270 AC_DEFINE(BROKEN_SNPRINTF)
271 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
278 [ --without-pam Disable PAM support ],
280 if test "x$withval" = "xno" ; then
282 AC_DEFINE(DISABLE_PAM)
287 if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
288 AC_CHECK_LIB(dl, dlopen, , )
291 AC_CHECK_FUNCS(pam_getenvlist)
297 # Check PAM strerror arguments (old PAM)
298 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
302 #include <security/pam_appl.h>
304 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
307 AC_DEFINE(HAVE_OLD_PAM)
309 PAM_MSG="yes (old library)"
314 # The big search for OpenSSL
316 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
318 if test "x$withval" != "$xno" ; then
325 saved_LDFLAGS="$LDFLAGS"
326 saved_CFLAGS="$CFLAGS"
327 if test "x$prefix" != "xNONE" ; then
328 tryssldir="$tryssldir $prefix"
330 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
332 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
333 if test ! -z "$ssldir" ; then
334 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
335 CFLAGS="$saved_CFLAGS -I$ssldir/include"
336 if test ! -z "$need_dash_r" ; then
337 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
340 LDFLAGS="$saved_LDFLAGS"
343 LIBS="$saved_LIBS -lcrypto"
345 # Basic test to check for compatible version and correct linking
346 # *does not* test for RSA - that comes later.
350 #include <openssl/rand.h>
354 memset(a, 0, sizeof(a));
355 RAND_add(a, sizeof(a), sizeof(a));
356 return(RAND_status() <= 0);
365 if test ! -z "$found_crypto" ; then
370 if test -z "$found_crypto" ; then
371 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
373 if test -z "$ssldir" ; then
377 ac_cv_openssldir=$ssldir
380 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
381 AC_DEFINE(HAVE_OPENSSL)
382 dnl Need to recover ssldir - test above runs in subshell
383 ssldir=$ac_cv_openssldir
384 CFLAGS="$saved_CFLAGS -I$ssldir/include"
385 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
386 if test ! -z "$need_dash_r" ; then
387 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
389 if test ! -z "$blibpath" ; then
390 blibpath="$blibpath:$ssldir:$ssldir/lib"
393 LIBS="$saved_LIBS -lcrypto"
395 # Now test RSA support
397 AC_MSG_CHECKING([for RSA support])
398 for WANTS_RSAREF in "" 1 ; do
399 if test -z "$WANTS_RSAREF" ; then
402 LIBS="$saved_LIBS -lRSAglue -lrsaref"
406 #include <openssl/rand.h>
407 #include <openssl/rsa.h>
408 #include <openssl/bn.h>
409 #include <openssl/sha.h>
412 int num; RSA *key; static unsigned char p_in[] = "blahblah";
413 unsigned char c[256], p[256];
414 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
415 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
416 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
417 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
426 if test ! -z "$no_rsa" ; then
427 AC_MSG_RESULT(disabled)
430 if test -z "$rsa_works" ; then
431 AC_MSG_WARN([*** No RSA support found *** ])
434 if test -z "$WANTS_RSAREF" ; then
438 RSA_MSG="yes (using RSAref)"
439 AC_MSG_RESULT(using RSAref)
440 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
445 # Checks for data types
446 AC_CHECK_SIZEOF(char, 1)
447 AC_CHECK_SIZEOF(short int, 2)
448 AC_CHECK_SIZEOF(int, 4)
449 AC_CHECK_SIZEOF(long int, 4)
450 AC_CHECK_SIZEOF(long long int, 8)
452 # More checks for data types
453 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
455 [ #include <sys/types.h> ],
456 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
457 [ ac_cv_have_intxx_t="yes" ],
458 [ ac_cv_have_intxx_t="no" ]
461 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
462 AC_DEFINE(HAVE_INTXX_T)
466 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
468 [ #include <sys/types.h> ],
469 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
470 [ ac_cv_have_u_intxx_t="yes" ],
471 [ ac_cv_have_u_intxx_t="no" ]
474 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
475 AC_DEFINE(HAVE_U_INTXX_T)
480 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
481 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
483 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
486 #include <sys/bitypes.h>
489 int8_t a; int16_t b; int32_t c;
490 u_int8_t e; u_int16_t f; u_int32_t g;
491 a = b = c = e = f = g = 1;
494 AC_DEFINE(HAVE_U_INTXX_T)
495 AC_DEFINE(HAVE_INTXX_T)
502 if test -z "$have_u_intxx_t" ; then
503 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
506 #include <sys/types.h>
508 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
509 [ ac_cv_have_uintxx_t="yes" ],
510 [ ac_cv_have_uintxx_t="no" ]
513 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
514 AC_DEFINE(HAVE_UINTXX_T)
518 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
521 #include <sys/types.h>
522 #include <sys/socket.h>
524 [socklen_t foo; foo = 1235;],
525 [ ac_cv_have_socklen_t="yes" ],
526 [ ac_cv_have_socklen_t="no" ]
529 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
530 AC_DEFINE(HAVE_SOCKLEN_T)
533 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
536 #include <sys/types.h>
538 [ size_t foo; foo = 1235; ],
539 [ ac_cv_have_size_t="yes" ],
540 [ ac_cv_have_size_t="no" ]
543 if test "x$ac_cv_have_size_t" = "xyes" ; then
544 AC_DEFINE(HAVE_SIZE_T)
547 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
550 #include <sys/types.h>
552 [ ssize_t foo; foo = 1235; ],
553 [ ac_cv_have_ssize_t="yes" ],
554 [ ac_cv_have_ssize_t="no" ]
557 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
558 AC_DEFINE(HAVE_SSIZE_T)
561 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
564 #include <sys/types.h>
565 #include <sys/socket.h>
567 [ sa_family_t foo; foo = 1235; ],
568 [ ac_cv_have_sa_family_t="yes" ],
569 [ ac_cv_have_sa_family_t="no" ]
572 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
573 AC_DEFINE(HAVE_SA_FAMILY_T)
576 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
579 #include <sys/types.h>
581 [ pid_t foo; foo = 1235; ],
582 [ ac_cv_have_pid_t="yes" ],
583 [ ac_cv_have_pid_t="no" ]
586 if test "x$ac_cv_have_pid_t" = "xyes" ; then
587 AC_DEFINE(HAVE_PID_T)
590 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
593 #include <sys/types.h>
595 [ mode_t foo; foo = 1235; ],
596 [ ac_cv_have_mode_t="yes" ],
597 [ ac_cv_have_mode_t="no" ]
600 if test "x$ac_cv_have_mode_t" = "xyes" ; then
601 AC_DEFINE(HAVE_MODE_T)
605 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
608 #include <sys/types.h>
609 #include <sys/socket.h>
611 [ struct sockaddr_storage s; ],
612 [ ac_cv_have_struct_sockaddr_storage="yes" ],
613 [ ac_cv_have_struct_sockaddr_storage="no" ]
616 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
617 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
620 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
623 #include <sys/types.h>
624 #include <netinet/in.h>
626 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
627 [ ac_cv_have_struct_sockaddr_in6="yes" ],
628 [ ac_cv_have_struct_sockaddr_in6="no" ]
631 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
632 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
635 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
638 #include <sys/types.h>
639 #include <netinet/in.h>
641 [ struct in6_addr s; s.s6_addr[0] = 0; ],
642 [ ac_cv_have_struct_in6_addr="yes" ],
643 [ ac_cv_have_struct_in6_addr="no" ]
646 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
647 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
650 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
653 #include <sys/types.h>
654 #include <sys/socket.h>
657 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
658 [ ac_cv_have_struct_addrinfo="yes" ],
659 [ ac_cv_have_struct_addrinfo="no" ]
662 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
663 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
667 # Checks for structure members
669 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
670 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
671 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
672 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
673 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
674 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
675 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
676 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
677 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
678 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
679 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
680 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
681 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
682 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
683 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
684 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
685 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
687 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
688 ac_cv_have_ss_family_in_struct_ss, [
691 #include <sys/types.h>
692 #include <sys/socket.h>
694 [ struct sockaddr_storage s; s.ss_family = 1; ],
695 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
696 [ ac_cv_have_ss_family_in_struct_ss="no" ],
699 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
700 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
703 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
704 ac_cv_have___ss_family_in_struct_ss, [
707 #include <sys/types.h>
708 #include <sys/socket.h>
710 [ struct sockaddr_storage s; s.__ss_family = 1; ],
711 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
712 [ ac_cv_have___ss_family_in_struct_ss="no" ]
715 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
716 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
720 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
722 [ extern char *__progname; printf("%s", __progname); ],
723 [ ac_cv_libc_defines___progname="yes" ],
724 [ ac_cv_libc_defines___progname="no" ]
727 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
728 AC_DEFINE(HAVE___PROGNAME)
732 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
734 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
735 [ ac_cv_libc_defines_sys_errlist="yes" ],
736 [ ac_cv_libc_defines_sys_errlist="no" ]
739 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
740 AC_DEFINE(HAVE_SYS_ERRLIST)
744 # Looking for programs, paths and files
746 [ --with-rsh=PATH Specify path to remote shell program ],
748 if test "x$withval" != "$no" ; then
753 AC_PATH_PROG(rsh_path, rsh)
758 [ --with-xauth=PATH Specify path to xauth program ],
760 if test "x$withval" != "$xno" ; then
765 AC_PATH_PROG(xauth_path, xauth)
766 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
767 xauth_path="/usr/openwin/bin/xauth"
772 if test ! -z "$xauth_path" ; then
773 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
775 if test ! -z "$rsh_path" ; then
776 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
779 # Check for mail directory (last resort if we cannot get it from headers)
780 if test ! -z "$MAIL" ; then
781 maildir=`dirname $MAIL`
782 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
785 if test -z "$no_dev_ptmx" ; then
786 AC_CHECK_FILE("/dev/ptmx",
788 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
793 AC_CHECK_FILE("/dev/ptc",
795 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
800 # Options from here on. Some of these are preset by platform above
802 # Check for user-specified random device, otherwise check /dev/urandom
804 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
806 if test "x$withval" != "xno" ; then
807 RANDOM_POOL="$withval";
808 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
812 # Check for random device
813 AC_CHECK_FILE("/dev/urandom",
815 RANDOM_POOL="/dev/urandom";
816 AC_SUBST(RANDOM_POOL)
817 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
823 # Check for EGD pool file
824 AC_ARG_WITH(egd-pool,
825 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
827 if test "x$withval" != "xno" ; then
828 EGD_SOCKET="$withval";
829 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
834 # detect pathnames for entropy gathering commands, if we need them
835 INSTALL_SSH_PRNG_CMDS=""
837 if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
838 # Use these commands to collect entropy
839 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
840 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
841 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
842 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
843 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
844 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
845 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
846 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
847 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
848 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
849 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
850 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
851 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
852 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
853 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
855 INSTALL_SSH_PRNG_CMDS="yes"
857 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
861 [ --with-catman=man|cat Install preformatted manpages[no]],
864 if test x"$withval" != x"yes" ; then
870 if test -z "$MANTYPE" ; then
871 MANTYPE='$(TROFFMAN)'
879 # Check whether user wants Kerberos support
881 AC_ARG_WITH(kerberos4,
882 [ --with-kerberos4=PATH Enable Kerberos 4 support],
884 if test "x$withval" != "xno" ; then
886 if test "x$withval" != "$xyes" ; then
887 CFLAGS="$CFLAGS -I${withval}/include"
888 LDFLAGS="$LDFLAGS -L${withval}/lib"
889 if test ! -z "$need_dash_r" ; then
890 LDFLAGS="$LDFLAGS -R${withval}/lib"
892 if test ! -z "$blibpath" ; then
893 blibpath="$blibpath:${withval}/lib"
896 if test -d /usr/include/kerberosIV ; then
897 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
901 AC_CHECK_HEADERS(krb.h)
902 AC_CHECK_LIB(krb, main)
903 if test "$ac_cv_header_krb_h" != yes; then
904 AC_MSG_WARN([Cannot find krb.h, build may fail])
906 if test "$ac_cv_lib_krb_main" != yes; then
907 AC_MSG_WARN([Cannot find libkrb, build may fail])
911 AC_CHECK_LIB(resolv, dn_expand, , )
919 # Check whether user wants AFS support
922 [ --with-afs=PATH Enable AFS support],
924 if test "x$withval" != "xno" ; then
926 if test "x$withval" != "$xyes" ; then
927 CFLAGS="$CFLAGS -I${withval}/include"
928 LFLAGS="$LFLAGS -L${withval}/lib"
931 if test -z "$KRB4" ; then
932 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
936 if test ! -z "$AFS_LIBS" ; then
937 LIBS="$LIBS $AFS_LIBS"
946 # Check whether user wants S/Key support
949 [ --with-skey Enable S/Key support],
951 if test "x$withval" != "xno" ; then
959 # Check whether user wants TCP wrappers support
961 AC_ARG_WITH(tcp-wrappers,
962 [ --with-tcp-wrappers Enable tcpwrappers support],
964 if test "x$withval" != "xno" ; then
967 AC_MSG_CHECKING(for libwrap)
971 int deny_severity = 0, allow_severity = 0;
980 AC_MSG_ERROR([*** libwrap missing])
987 # Check whether to enable MD5 passwords
989 AC_ARG_WITH(md5-passwords,
990 [ --with-md5-passwords Enable use of MD5 passwords],
992 if test "x$withval" != "xno" ; then
993 AC_DEFINE(HAVE_MD5_PASSWORDS)
999 # Whether to disable shadow password support
1001 [ --without-shadow Disable shadow password support],
1003 if test "x$withval" = "xno" ; then
1004 AC_DEFINE(DISABLE_SHADOW)
1010 if test -z "$disable_shadow" ; then
1011 AC_MSG_CHECKING([if the systems has expire shadow information])
1014 #include <sys/types.h>
1017 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1018 [ sp_expire_available=yes ], []
1021 if test "x$sp_expire_available" = "xyes" ; then
1023 AC_DEFINE(HAS_SHADOW_EXPIRE)
1029 # Use ip address instead of hostname in $DISPLAY
1030 DISPLAY_HACK_MSG="no"
1031 AC_ARG_WITH(ipaddr-display,
1032 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1034 if test "x$withval" = "xno" ; then
1035 AC_DEFINE(IPADDR_IN_DISPLAY)
1036 DISPLAY_HACK_MSG="yes"
1041 # Whether to mess with the default path
1042 SERVER_PATH_MSG="(default)"
1043 AC_ARG_WITH(default-path,
1044 [ --with-default-path=PATH Specify default \$PATH environment for server],
1046 if test "x$withval" != "xno" ; then
1047 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1048 SERVER_PATH_MSG="$withval"
1053 # Whether to force IPv4 by default (needed on broken glibc Linux)
1055 AC_ARG_WITH(ipv4-default,
1056 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1058 if test "x$withval" != "xno" ; then
1059 AC_DEFINE(IPV4_DEFAULT)
1065 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1066 IPV4_IN6_HACK_MSG="no"
1068 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1070 if test "x$withval" != "xno" ; then
1072 AC_DEFINE(IPV4_IN_IPV6)
1073 IPV4_IN6_HACK_MSG="yes"
1078 if test "x$inet6_default_4in6" = "xyes"; then
1079 AC_MSG_RESULT([yes (default)])
1080 AC_DEFINE(IPV4_IN_IPV6)
1081 IPV4_IN6_HACK_MSG="yes"
1083 AC_MSG_RESULT([no (default)])
1088 # Where to place sshd.pid
1090 AC_ARG_WITH(pid-dir,
1091 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1093 if test "x$withval" != "xno" ; then
1099 AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
1102 dnl allow user to disable some login recording features
1103 AC_ARG_ENABLE(lastlog,
1104 [ --disable-lastlog disable use of lastlog even if detected [no]],
1105 [ AC_DEFINE(DISABLE_LASTLOG) ]
1108 [ --disable-utmp disable use of utmp even if detected [no]],
1109 [ AC_DEFINE(DISABLE_UTMP) ]
1111 AC_ARG_ENABLE(utmpx,
1112 [ --disable-utmpx disable use of utmpx even if detected [no]],
1113 [ AC_DEFINE(DISABLE_UTMPX) ]
1116 [ --disable-wtmp disable use of wtmp even if detected [no]],
1117 [ AC_DEFINE(DISABLE_WTMP) ]
1119 AC_ARG_ENABLE(wtmpx,
1120 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1121 [ AC_DEFINE(DISABLE_WTMPX) ]
1123 AC_ARG_ENABLE(libutil,
1124 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1125 [ AC_DEFINE(DISABLE_LOGIN) ]
1127 AC_ARG_ENABLE(pututline,
1128 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1129 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1131 AC_ARG_ENABLE(pututxline,
1132 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1133 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1135 AC_ARG_WITH(lastlog,
1136 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1137 [ conf_lastlog_location="$withval"; ],)
1139 dnl lastlog, [uw]tmpx? detection
1140 dnl NOTE: set the paths in the platform section to avoid the
1141 dnl need for command-line parameters
1142 dnl lastlog and [uw]tmp are subject to a file search if all else fails
1144 dnl lastlog detection
1145 dnl NOTE: the code itself will detect if lastlog is a directory
1146 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1148 #include <sys/types.h>
1150 #ifdef HAVE_LASTLOG_H
1151 # include <lastlog.h>
1157 [ char *lastlog = LASTLOG_FILE; ],
1158 [ AC_MSG_RESULT(yes) ],
1161 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1163 #include <sys/types.h>
1165 #ifdef HAVE_LASTLOG_H
1166 # include <lastlog.h>
1172 [ char *lastlog = _PATH_LASTLOG; ],
1173 [ AC_MSG_RESULT(yes) ],
1176 system_lastlog_path=no
1181 if test -z "$conf_lastlog_location"; then
1182 if test x"$system_lastlog_path" = x"no" ; then
1183 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1184 if (test -d "$f" || test -f "$f") ; then
1185 conf_lastlog_location=$f
1188 if test -z "$conf_lastlog_location"; then
1189 AC_MSG_WARN([** Cannot find lastlog **])
1190 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1195 if test -n "$conf_lastlog_location"; then
1196 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1200 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1202 #include <sys/types.h>
1208 [ char *utmp = UTMP_FILE; ],
1209 [ AC_MSG_RESULT(yes) ],
1211 system_utmp_path=no ]
1213 if test -z "$conf_utmp_location"; then
1214 if test x"$system_utmp_path" = x"no" ; then
1215 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1216 if test -f $f ; then
1217 conf_utmp_location=$f
1220 if test -z "$conf_utmp_location"; then
1221 AC_DEFINE(DISABLE_UTMP)
1225 if test -n "$conf_utmp_location"; then
1226 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1230 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1232 #include <sys/types.h>
1238 [ char *wtmp = WTMP_FILE; ],
1239 [ AC_MSG_RESULT(yes) ],
1241 system_wtmp_path=no ]
1243 if test -z "$conf_wtmp_location"; then
1244 if test x"$system_wtmp_path" = x"no" ; then
1245 for f in /usr/adm/wtmp /var/log/wtmp; do
1246 if test -f $f ; then
1247 conf_wtmp_location=$f
1250 if test -z "$conf_wtmp_location"; then
1251 AC_DEFINE(DISABLE_WTMP)
1255 if test -n "$conf_wtmp_location"; then
1256 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1260 dnl utmpx detection - I don't know any system so perverse as to require
1261 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1263 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1265 #include <sys/types.h>
1274 [ char *utmpx = UTMPX_FILE; ],
1275 [ AC_MSG_RESULT(yes) ],
1277 system_utmpx_path=no ]
1279 if test -z "$conf_utmpx_location"; then
1280 if test x"$system_utmpx_path" = x"no" ; then
1281 AC_DEFINE(DISABLE_UTMPX)
1284 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1288 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1290 #include <sys/types.h>
1299 [ char *wtmpx = WTMPX_FILE; ],
1300 [ AC_MSG_RESULT(yes) ],
1302 system_wtmpx_path=no ]
1304 if test -z "$conf_wtmpx_location"; then
1305 if test x"$system_wtmpx_path" = x"no" ; then
1306 AC_DEFINE(DISABLE_WTMPX)
1309 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1313 # Change default command timeout for builtin PRNG
1315 AC_ARG_WITH(entropy-timeout,
1316 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1318 if test "x$withval" != "xno" ; then
1319 entropy_timeout=$withval
1323 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1326 if test ! -z "$blibpath" ; then
1327 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1328 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1331 AC_OUTPUT(Makefile ssh_prng_cmds)
1333 # Print summary of options
1335 if test x$MANTYPE = x'$(CATMAN)' ; then
1340 if test ! -z "$RANDOM_POOL" ; then
1341 RAND_MSG="Device ($RANDOM_POOL)"
1343 if test ! -z "$EGD_SOCKET" ; then
1344 RAND_MSG="EGD ($EGD_SOCKET)"
1346 RAND_MSG="Builtin (timeout $entropy_timeout)"
1350 # Someone please show me a better way :)
1351 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1352 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1353 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1354 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1355 E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1356 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1357 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1360 echo "OpenSSH configured has been configured with the following options."
1361 echo " User binaries: $B"
1362 echo " System binaries: $C"
1363 echo " Configuration files: $D"
1364 echo " Askpass program: $E"
1365 echo " Manual pages: $F"
1366 echo " PID file: $G"
1367 echo " Random number collection: $RAND_MSG"
1368 echo " Manpage format: $MAN_MSG"
1369 echo " PAM support: ${PAM_MSG}"
1370 echo " KerberosIV support: $KRB4_MSG"
1371 echo " AFS support: $AFS_MSG"
1372 echo " S/KEY support: $SKEY_MSG"
1373 echo " TCP Wrappers support: $TCPW_MSG"
1374 echo " MD5 password support: $MD5_MSG"
1375 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1376 echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1377 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1381 echo "Compiler flags: ${CFLAGS}"
1382 echo "Linker flags: ${LDFLAGS}"
1383 echo "Libraries: ${LIBS}"