4 AC_CONFIG_SRCDIR([ssh.c])
6 AC_CONFIG_HEADER(config.h)
11 # Checks for programs.
16 AC_PATH_PROGS(PERL, perl5 perl)
17 AC_PATH_PROG(SED, sed)
19 AC_PATH_PROG(ENT, ent)
21 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
29 if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
33 # Use LOGIN_PROGRAM from environment if possible
34 if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
44 if test -z "$LD" ; then
50 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
54 # Check for some target-specific stuff
57 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
58 LDFLAGS="$LDFLAGS -L/usr/local/lib"
59 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
60 if (test -z "$blibpath"); then
61 blibpath="/usr/lib:/lib:/usr/local/lib"
63 saved_LDFLAGS="$LDFLAGS"
64 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
65 if (test -z "$blibflags"); then
66 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
67 AC_TRY_LINK([], [], [blibflags=$tryflags])
70 if (test -z "$blibflags"); then
71 AC_MSG_RESULT(not found)
72 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
74 AC_MSG_RESULT($blibflags)
76 LDFLAGS="$saved_LDFLAGS"
77 dnl Check for authenticate. Might be in libs.a on older AIXes
78 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
79 [AC_CHECK_LIB(s,authenticate,
80 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
84 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
85 AC_CHECK_DECL(loginfailed,
86 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
88 [#include <usersec.h>],
89 [(void)loginfailed("user","host","tty",0);],
91 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
95 [#include <usersec.h>]
97 AC_CHECK_FUNCS(setauthdb)
98 AC_DEFINE(BROKEN_GETADDRINFO)
99 AC_DEFINE(BROKEN_REALPATH)
100 dnl AIX handles lastlog as part of its login message
101 AC_DEFINE(DISABLE_LASTLOG)
102 AC_DEFINE(LOGIN_NEEDS_UTMPX)
103 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
106 check_for_libcrypt_later=1
107 LIBS="$LIBS /usr/lib/textmode.o"
108 AC_DEFINE(HAVE_CYGWIN)
110 AC_DEFINE(DISABLE_SHADOW)
111 AC_DEFINE(IP_TOS_IS_BROKEN)
112 AC_DEFINE(NO_X11_UNIX_SOCKETS)
113 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
114 AC_DEFINE(DISABLE_FD_PASSING)
115 AC_DEFINE(SETGROUPS_NOOP)
118 AC_DEFINE(IP_TOS_IS_BROKEN)
121 AC_MSG_CHECKING(if we have working getaddrinfo)
122 AC_TRY_RUN([#include <mach-o/dyld.h>
123 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
127 }], [AC_MSG_RESULT(working)],
128 [AC_MSG_RESULT(buggy)
129 AC_DEFINE(BROKEN_GETADDRINFO)],
130 [AC_MSG_RESULT(assume it is working)])
133 if test -z "$GCC"; then
136 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
137 IPADDR_IN_DISPLAY=yes
138 AC_DEFINE(HAVE_SECUREWARE)
140 AC_DEFINE(LOGIN_NO_ENDOPT)
141 AC_DEFINE(LOGIN_NEEDS_UTMPX)
142 AC_DEFINE(DISABLE_SHADOW)
143 AC_DEFINE(DISABLE_UTMP)
144 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
145 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
146 LIBS="$LIBS -lsec -lsecpw"
147 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
148 disable_ptmx_check=yes
151 if test -z "$GCC"; then
154 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
155 IPADDR_IN_DISPLAY=yes
157 AC_DEFINE(LOGIN_NO_ENDOPT)
158 AC_DEFINE(LOGIN_NEEDS_UTMPX)
159 AC_DEFINE(DISABLE_SHADOW)
160 AC_DEFINE(DISABLE_UTMP)
161 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
162 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
164 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
167 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
168 IPADDR_IN_DISPLAY=yes
169 AC_DEFINE(PAM_SUN_CODEBASE)
171 AC_DEFINE(LOGIN_NO_ENDOPT)
172 AC_DEFINE(LOGIN_NEEDS_UTMPX)
173 AC_DEFINE(DISABLE_SHADOW)
174 AC_DEFINE(DISABLE_UTMP)
175 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
176 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
178 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
183 PATH="$PATH:/usr/etc"
184 AC_DEFINE(BROKEN_INET_NTOA)
185 AC_DEFINE(WITH_ABBREV_NO_TTY)
186 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
189 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
191 PATH="$PATH:/usr/etc"
192 AC_DEFINE(WITH_IRIX_ARRAY)
193 AC_DEFINE(WITH_IRIX_PROJECT)
194 AC_DEFINE(WITH_IRIX_AUDIT)
195 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
196 AC_DEFINE(BROKEN_INET_NTOA)
197 AC_DEFINE(WITH_ABBREV_NO_TTY)
198 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
202 check_for_libcrypt_later=1
203 check_for_openpty_ctty_bug=1
204 AC_DEFINE(DONT_TRY_OTHER_AF)
205 AC_DEFINE(PAM_TTY_KLUDGE)
206 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
207 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
208 inet6_default_4in6=yes
211 AC_DEFINE(BROKEN_CMSG_TYPE)
215 mips-sony-bsd|mips-sony-newsos4)
216 AC_DEFINE(HAVE_NEWS4)
220 check_for_libcrypt_before=1
224 check_for_libcrypt_later=1
227 conf_lastlog_location="/usr/adm/lastlog"
228 conf_utmp_location=/etc/utmp
229 conf_wtmp_location=/usr/adm/wtmp
232 AC_DEFINE(BROKEN_REALPATH)
234 AC_DEFINE(BROKEN_SAVED_UIDS)
235 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
239 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
240 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
242 AC_DEFINE(PAM_SUN_CODEBASE)
243 AC_DEFINE(LOGIN_NEEDS_UTMPX)
244 AC_DEFINE(LOGIN_NEEDS_TERM)
245 AC_DEFINE(PAM_TTY_KLUDGE)
246 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
247 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
248 AC_DEFINE(SSHD_ACQUIRES_CTTY)
249 # hardwire lastlog location (can't detect it on some versions)
250 conf_lastlog_location="/var/adm/lastlog"
251 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
252 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
253 if test "$sol2ver" -ge 8; then
255 AC_DEFINE(DISABLE_UTMP)
256 AC_DEFINE(DISABLE_WTMP)
262 CPPFLAGS="$CPPFLAGS -DSUNOS4"
263 AC_CHECK_FUNCS(getpwanam)
264 AC_DEFINE(PAM_SUN_CODEBASE)
265 conf_utmp_location=/etc/utmp
266 conf_wtmp_location=/var/adm/wtmp
267 conf_lastlog_location=/var/adm/lastlog
271 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
272 LDFLAGS="$LDFLAGS -L/usr/local/lib"
275 AC_DEFINE(SSHD_ACQUIRES_CTTY)
278 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
279 # /usr/ucblib MUST NOT be searched on ReliantUNIX
280 LDFLAGS="$LDFLAGS -L/usr/local/lib"
281 IPADDR_IN_DISPLAY=yes
283 AC_DEFINE(IP_TOS_IS_BROKEN)
284 AC_DEFINE(SSHD_ACQUIRES_CTTY)
285 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
286 # Attention: always take care to bind libsocket and libnsl before libc,
287 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
290 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
291 LDFLAGS="$LDFLAGS -L/usr/local/lib"
295 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
296 LDFLAGS="$LDFLAGS -L/usr/local/lib"
300 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
301 LDFLAGS="$LDFLAGS -L/usr/local/lib"
304 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
305 LDFLAGS="$LDFLAGS -L/usr/local/lib"
306 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
309 AC_DEFINE(BROKEN_SYS_TERMIO_H)
311 AC_DEFINE(HAVE_SECUREWARE)
312 AC_DEFINE(DISABLE_SHADOW)
313 AC_DEFINE(BROKEN_SAVED_UIDS)
314 AC_CHECK_FUNCS(getluid setluid)
316 do_sco3_extra_lib_check=yes
319 if test -z "$GCC"; then
320 CFLAGS="$CFLAGS -belf"
322 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
323 LDFLAGS="$LDFLAGS -L/usr/local/lib"
324 LIBS="$LIBS -lprot -lx -ltinfo -lm"
327 AC_DEFINE(HAVE_SECUREWARE)
328 AC_DEFINE(DISABLE_SHADOW)
329 AC_DEFINE(DISABLE_FD_PASSING)
330 AC_CHECK_FUNCS(getluid setluid)
335 AC_DEFINE(DISABLE_FD_PASSING)
337 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
342 AC_DEFINE(DISABLE_FD_PASSING)
343 AC_DEFINE(NO_SSH_LASTLOG)
344 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
345 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
349 AC_MSG_CHECKING(for Digital Unix SIA)
352 [ --with-osfsia Enable Digital Unix SIA],
354 if test "x$withval" = "xno" ; then
355 AC_MSG_RESULT(disabled)
360 if test -z "$no_osfsia" ; then
361 if test -f /etc/sia/matrix.conf; then
363 AC_DEFINE(HAVE_OSF_SIA)
364 AC_DEFINE(DISABLE_LOGIN)
365 AC_DEFINE(DISABLE_FD_PASSING)
366 LIBS="$LIBS -lsecurity -ldb -lm -laud"
371 AC_DEFINE(DISABLE_FD_PASSING)
372 AC_DEFINE(BROKEN_GETADDRINFO)
373 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
378 AC_DEFINE(NO_X11_UNIX_SOCKETS)
379 AC_DEFINE(MISSING_NFDBITS)
380 AC_DEFINE(MISSING_HOWMANY)
381 AC_DEFINE(MISSING_FD_MASK)
385 # Allow user to specify flags
387 [ --with-cflags Specify additional flags to pass to compiler],
389 if test "x$withval" != "xno" ; then
390 CFLAGS="$CFLAGS $withval"
394 AC_ARG_WITH(cppflags,
395 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
397 if test "x$withval" != "xno"; then
398 CPPFLAGS="$CPPFLAGS $withval"
403 [ --with-ldflags Specify additional flags to pass to linker],
405 if test "x$withval" != "xno" ; then
406 LDFLAGS="$LDFLAGS $withval"
411 [ --with-libs Specify additional libraries to link with],
413 if test "x$withval" != "xno" ; then
414 LIBS="$LIBS $withval"
419 AC_MSG_CHECKING(compiler and flags for sanity)
424 [ AC_MSG_RESULT(yes) ],
427 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
431 # Checks for header files.
432 AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
433 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
434 login_cap.h maillock.h netdb.h netgroup.h \
435 netinet/in_systm.h paths.h pty.h readpassphrase.h \
436 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
437 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
438 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
439 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
440 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
441 util.h utime.h utmp.h utmpx.h)
443 # Checks for libraries.
444 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
445 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
447 dnl SCO OS3 needs this for libwrap
448 if test "x$with_tcp_wrappers" != "xno" ; then
449 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
450 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
454 AC_CHECK_FUNC(getspnam, ,
455 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
458 [ --without-rpath Disable auto-added -R linker paths],
460 if test "x$withval" = "xno" ; then
463 if test "x$withval" = "xyes" ; then
471 [ --with-zlib=PATH Use zlib in PATH],
473 if test "x$withval" = "xno" ; then
474 AC_MSG_ERROR([*** zlib is required ***])
476 if test -d "$withval/lib"; then
477 if test -n "${need_dash_r}"; then
478 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
480 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
483 if test -n "${need_dash_r}"; then
484 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
486 LDFLAGS="-L${withval} ${LDFLAGS}"
489 if test -d "$withval/include"; then
490 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
492 CPPFLAGS="-I${withval} ${CPPFLAGS}"
497 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
500 AC_CHECK_FUNC(strcasecmp,
501 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
503 AC_CHECK_FUNC(utimes,
504 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
505 LIBS="$LIBS -lc89"]) ]
508 dnl Checks for libutil functions
509 AC_CHECK_HEADERS(libutil.h)
510 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
511 AC_CHECK_FUNCS(logout updwtmp logwtmp)
515 # Check for ALTDIRFUNC glob() extension
516 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
517 AC_EGREP_CPP(FOUNDIT,
520 #ifdef GLOB_ALTDIRFUNC
525 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
533 # Check for g.gl_matchc glob() extension
534 AC_MSG_CHECKING(for gl_matchc field in glob_t)
535 AC_EGREP_CPP(FOUNDIT,
538 int main(void){glob_t g; g.gl_matchc = 1;}
541 AC_DEFINE(GLOB_HAS_GL_MATCHC)
549 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
552 #include <sys/types.h>
554 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
556 [AC_MSG_RESULT(yes)],
559 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
563 # Check whether user wants S/Key support
566 [ --with-skey[[=PATH]] Enable S/Key support
567 (optionally in PATH)],
569 if test "x$withval" != "xno" ; then
571 if test "x$withval" != "xyes" ; then
572 CPPFLAGS="$CPPFLAGS -I${withval}/include"
573 LDFLAGS="$LDFLAGS -L${withval}/lib"
580 AC_MSG_CHECKING([for s/key support])
585 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
587 [AC_MSG_RESULT(yes)],
590 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
596 # Check whether user wants TCP wrappers support
598 AC_ARG_WITH(tcp-wrappers,
599 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
600 (optionally in PATH)],
602 if test "x$withval" != "xno" ; then
604 saved_LDFLAGS="$LDFLAGS"
605 saved_CPPFLAGS="$CPPFLAGS"
606 if test -n "${withval}" -a "${withval}" != "yes"; then
607 if test -d "${withval}/lib"; then
608 if test -n "${need_dash_r}"; then
609 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
611 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
614 if test -n "${need_dash_r}"; then
615 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
617 LDFLAGS="-L${withval} ${LDFLAGS}"
620 if test -d "${withval}/include"; then
621 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
623 CPPFLAGS="-I${withval} ${CPPFLAGS}"
627 LIBS="$LIBWRAP $LIBS"
628 AC_MSG_CHECKING(for libwrap)
632 int deny_severity = 0, allow_severity = 0;
642 AC_MSG_ERROR([*** libwrap missing])
650 dnl Checks for library functions. Please keep in alphabetical order
652 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
653 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
654 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
655 getpeereid _getpty getrlimit getttyent glob inet_aton \
656 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
657 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
658 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
659 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
660 setproctitle setregid setresgid setresuid setreuid setrlimit \
661 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
662 strlcat strlcpy strmode strnvis sysconf tcgetpgrp tcsendbreak \
663 truncate utimes vhangup vsnprintf waitpid \
666 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
667 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
669 dnl Make sure prototypes are defined for these before using them.
670 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
671 AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
673 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
674 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
675 AC_CHECK_LIB(gen, dirname,[
676 AC_CACHE_CHECK([for broken dirname],
677 ac_cv_have_broken_dirname, [
685 int main(int argc, char **argv) {
688 strncpy(buf,"/etc", 32);
690 if (!s || strncmp(s, "/", 32) != 0) {
697 [ ac_cv_have_broken_dirname="no" ],
698 [ ac_cv_have_broken_dirname="yes" ]
702 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
704 AC_DEFINE(HAVE_DIRNAME)
705 AC_CHECK_HEADERS(libgen.h)
710 dnl Checks for time functions
711 AC_CHECK_FUNCS(gettimeofday time)
712 dnl Checks for utmp functions
713 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
714 AC_CHECK_FUNCS(utmpname)
715 dnl Checks for utmpx functions
716 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
717 AC_CHECK_FUNCS(setutxent utmpxname)
719 AC_CHECK_FUNC(daemon,
720 [AC_DEFINE(HAVE_DAEMON)],
721 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
724 AC_CHECK_FUNC(getpagesize,
725 [AC_DEFINE(HAVE_GETPAGESIZE)],
726 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
729 # Check for broken snprintf
730 if test "x$ac_cv_func_snprintf" = "xyes" ; then
731 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
735 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
737 [AC_MSG_RESULT(yes)],
740 AC_DEFINE(BROKEN_SNPRINTF)
741 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
746 dnl see whether mkstemp() requires XXXXXX
747 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
748 AC_MSG_CHECKING([for (overly) strict mkstemp])
752 main() { char template[]="conftest.mkstemp-test";
753 if (mkstemp(template) == -1)
755 unlink(template); exit(0);
763 AC_DEFINE(HAVE_STRICT_MKSTEMP)
767 AC_DEFINE(HAVE_STRICT_MKSTEMP)
772 dnl make sure that openpty does not reacquire controlling terminal
773 if test ! -z "$check_for_openpty_ctty_bug"; then
774 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
778 #include <sys/fcntl.h>
779 #include <sys/types.h>
780 #include <sys/wait.h>
786 int fd, ptyfd, ttyfd, status;
789 if (pid < 0) { /* failed */
791 } else if (pid > 0) { /* parent */
792 waitpid(pid, &status, 0);
793 if (WIFEXITED(status))
794 exit(WEXITSTATUS(status));
798 close(0); close(1); close(2);
800 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
801 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
803 exit(3); /* Acquired ctty: broken */
805 exit(0); /* Did not acquire ctty: OK */
814 AC_DEFINE(SSHD_ACQUIRES_CTTY)
824 [ --with-pam Enable PAM support ],
826 if test "x$withval" != "xno" ; then
827 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
828 AC_MSG_ERROR([PAM headers not found])
831 AC_CHECK_LIB(dl, dlopen, , )
832 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
833 AC_CHECK_FUNCS(pam_getenvlist)
839 if test $ac_cv_lib_dl_dlopen = yes; then
849 # Check for older PAM
850 if test "x$PAM_MSG" = "xyes" ; then
851 # Check PAM strerror arguments (old PAM)
852 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
856 #include <security/pam_appl.h>
858 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
861 AC_DEFINE(HAVE_OLD_PAM)
863 PAM_MSG="yes (old library)"
868 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
869 # because the system crypt() is more featureful.
870 if test "x$check_for_libcrypt_before" = "x1"; then
871 AC_CHECK_LIB(crypt, crypt)
875 saved_CPPFLAGS="$CPPFLAGS"
876 saved_LDFLAGS="$LDFLAGS"
878 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
880 if test "x$withval" != "xno" ; then
881 if test -d "$withval/lib"; then
882 if test -n "${need_dash_r}"; then
883 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
885 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
888 if test -n "${need_dash_r}"; then
889 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
891 LDFLAGS="-L${withval} ${LDFLAGS}"
894 if test -d "$withval/include"; then
895 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
897 CPPFLAGS="-I${withval} ${CPPFLAGS}"
902 LIBS="$LIBS -lcrypto"
903 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
905 dnl Check default openssl install dir
906 if test -n "${need_dash_r}"; then
907 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
909 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
911 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
912 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
914 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
920 # Determine OpenSSL header version
921 AC_MSG_CHECKING([OpenSSL header version])
926 #include <openssl/opensslv.h>
927 #define DATA "conftest.sslincver"
932 fd = fopen(DATA,"w");
936 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
943 ssl_header_ver=`cat conftest.sslincver`
944 AC_MSG_RESULT($ssl_header_ver)
947 AC_MSG_RESULT(not found)
948 AC_MSG_ERROR(OpenSSL version header not found.)
952 # Determine OpenSSL library version
953 AC_MSG_CHECKING([OpenSSL library version])
958 #include <openssl/opensslv.h>
959 #include <openssl/crypto.h>
960 #define DATA "conftest.ssllibver"
965 fd = fopen(DATA,"w");
969 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
976 ssl_library_ver=`cat conftest.ssllibver`
977 AC_MSG_RESULT($ssl_library_ver)
980 AC_MSG_RESULT(not found)
981 AC_MSG_ERROR(OpenSSL library not found.)
985 # Sanity check OpenSSL headers
986 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
990 #include <openssl/opensslv.h>
991 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
998 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
999 Check config.log for details.
1000 Also see contrib/findssl.sh for help identifying header/library mismatches.])
1004 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1005 # version in OpenSSL. Skip this for PAM
1006 if test "x$check_for_libcrypt_later" = "x1"; then
1007 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
1011 ### Configure cryptographic random number support
1013 # Check wheter OpenSSL seeds itself
1014 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1018 #include <openssl/rand.h>
1019 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
1022 OPENSSL_SEEDS_ITSELF=yes
1027 # Default to use of the rand helper if OpenSSL doesn't
1034 # Do we want to force the use of the rand helper?
1035 AC_ARG_WITH(rand-helper,
1036 [ --with-rand-helper Use subprocess to gather strong randomness ],
1038 if test "x$withval" = "xno" ; then
1039 # Force use of OpenSSL's internal RNG, even if
1040 # the previous test showed it to be unseeded.
1041 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1042 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1043 OPENSSL_SEEDS_ITSELF=yes
1052 # Which randomness source do we use?
1053 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1055 AC_DEFINE(OPENSSL_PRNG_ONLY)
1056 RAND_MSG="OpenSSL internal ONLY"
1057 INSTALL_SSH_RAND_HELPER=""
1058 elif test ! -z "$USE_RAND_HELPER" ; then
1059 # install rand helper
1060 RAND_MSG="ssh-rand-helper"
1061 INSTALL_SSH_RAND_HELPER="yes"
1063 AC_SUBST(INSTALL_SSH_RAND_HELPER)
1065 ### Configuration of ssh-rand-helper
1068 AC_ARG_WITH(prngd-port,
1069 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1078 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1081 if test ! -z "$withval" ; then
1082 PRNGD_PORT="$withval"
1083 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1088 # PRNGD Unix domain socket
1089 AC_ARG_WITH(prngd-socket,
1090 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1094 withval="/var/run/egd-pool"
1102 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1106 if test ! -z "$withval" ; then
1107 if test ! -z "$PRNGD_PORT" ; then
1108 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1110 if test ! -r "$withval" ; then
1111 AC_MSG_WARN(Entropy socket is not readable)
1113 PRNGD_SOCKET="$withval"
1114 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1118 # Check for existing socket only if we don't have a random device already
1119 if test "$USE_RAND_HELPER" = yes ; then
1120 AC_MSG_CHECKING(for PRNGD/EGD socket)
1121 # Insert other locations here
1122 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1123 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1124 PRNGD_SOCKET="$sock"
1125 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1129 if test ! -z "$PRNGD_SOCKET" ; then
1130 AC_MSG_RESULT($PRNGD_SOCKET)
1132 AC_MSG_RESULT(not found)
1138 # Change default command timeout for hashing entropy source
1140 AC_ARG_WITH(entropy-timeout,
1141 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1143 if test "x$withval" != "xno" ; then
1144 entropy_timeout=$withval
1148 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1150 SSH_PRIVSEP_USER=sshd
1151 AC_ARG_WITH(privsep-user,
1152 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1154 if test -n "$withval"; then
1155 SSH_PRIVSEP_USER=$withval
1159 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1160 AC_SUBST(SSH_PRIVSEP_USER)
1162 # We do this little dance with the search path to insure
1163 # that programs that we select for use by installed programs
1164 # (which may be run by the super-user) come from trusted
1165 # locations before they come from the user's private area.
1166 # This should help avoid accidentally configuring some
1167 # random version of a program in someone's personal bin.
1171 test -h /bin 2> /dev/null && PATH=/usr/bin
1172 test -d /sbin && PATH=$PATH:/sbin
1173 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1174 PATH=$PATH:/etc:$OPATH
1176 # These programs are used by the command hashing source to gather entropy
1177 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1178 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1179 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1180 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1181 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1182 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1183 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1184 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1185 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1186 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1187 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1188 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1189 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1190 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1191 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1192 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1196 # Where does ssh-rand-helper get its randomness from?
1197 INSTALL_SSH_PRNG_CMDS=""
1198 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1199 if test ! -z "$PRNGD_PORT" ; then
1200 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1201 elif test ! -z "$PRNGD_SOCKET" ; then
1202 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1204 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1205 RAND_HELPER_CMDHASH=yes
1206 INSTALL_SSH_PRNG_CMDS="yes"
1209 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1212 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1213 if test ! -z "$SONY" ; then
1214 LIBS="$LIBS -liberty";
1217 # Checks for data types
1218 AC_CHECK_SIZEOF(char, 1)
1219 AC_CHECK_SIZEOF(short int, 2)
1220 AC_CHECK_SIZEOF(int, 4)
1221 AC_CHECK_SIZEOF(long int, 4)
1222 AC_CHECK_SIZEOF(long long int, 8)
1224 # Sanity check long long for some platforms (AIX)
1225 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1226 ac_cv_sizeof_long_long_int=0
1229 # More checks for data types
1230 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1232 [ #include <sys/types.h> ],
1234 [ ac_cv_have_u_int="yes" ],
1235 [ ac_cv_have_u_int="no" ]
1238 if test "x$ac_cv_have_u_int" = "xyes" ; then
1239 AC_DEFINE(HAVE_U_INT)
1243 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1245 [ #include <sys/types.h> ],
1246 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1247 [ ac_cv_have_intxx_t="yes" ],
1248 [ ac_cv_have_intxx_t="no" ]
1251 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1252 AC_DEFINE(HAVE_INTXX_T)
1256 if (test -z "$have_intxx_t" && \
1257 test "x$ac_cv_header_stdint_h" = "xyes")
1259 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1261 [ #include <stdint.h> ],
1262 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1264 AC_DEFINE(HAVE_INTXX_T)
1267 [ AC_MSG_RESULT(no) ]
1271 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1274 #include <sys/types.h>
1275 #ifdef HAVE_STDINT_H
1276 # include <stdint.h>
1278 #include <sys/socket.h>
1279 #ifdef HAVE_SYS_BITYPES_H
1280 # include <sys/bitypes.h>
1283 [ int64_t a; a = 1;],
1284 [ ac_cv_have_int64_t="yes" ],
1285 [ ac_cv_have_int64_t="no" ]
1288 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1289 AC_DEFINE(HAVE_INT64_T)
1292 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1294 [ #include <sys/types.h> ],
1295 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1296 [ ac_cv_have_u_intxx_t="yes" ],
1297 [ ac_cv_have_u_intxx_t="no" ]
1300 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1301 AC_DEFINE(HAVE_U_INTXX_T)
1305 if test -z "$have_u_intxx_t" ; then
1306 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1308 [ #include <sys/socket.h> ],
1309 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1311 AC_DEFINE(HAVE_U_INTXX_T)
1314 [ AC_MSG_RESULT(no) ]
1318 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1320 [ #include <sys/types.h> ],
1321 [ u_int64_t a; a = 1;],
1322 [ ac_cv_have_u_int64_t="yes" ],
1323 [ ac_cv_have_u_int64_t="no" ]
1326 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1327 AC_DEFINE(HAVE_U_INT64_T)
1331 if test -z "$have_u_int64_t" ; then
1332 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1334 [ #include <sys/bitypes.h> ],
1335 [ u_int64_t a; a = 1],
1337 AC_DEFINE(HAVE_U_INT64_T)
1340 [ AC_MSG_RESULT(no) ]
1344 if test -z "$have_u_intxx_t" ; then
1345 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1348 #include <sys/types.h>
1350 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1351 [ ac_cv_have_uintxx_t="yes" ],
1352 [ ac_cv_have_uintxx_t="no" ]
1355 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1356 AC_DEFINE(HAVE_UINTXX_T)
1360 if test -z "$have_uintxx_t" ; then
1361 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1363 [ #include <stdint.h> ],
1364 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1366 AC_DEFINE(HAVE_UINTXX_T)
1369 [ AC_MSG_RESULT(no) ]
1373 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1374 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1376 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1379 #include <sys/bitypes.h>
1382 int8_t a; int16_t b; int32_t c;
1383 u_int8_t e; u_int16_t f; u_int32_t g;
1384 a = b = c = e = f = g = 1;
1387 AC_DEFINE(HAVE_U_INTXX_T)
1388 AC_DEFINE(HAVE_INTXX_T)
1396 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1399 #include <sys/types.h>
1401 [ u_char foo; foo = 125; ],
1402 [ ac_cv_have_u_char="yes" ],
1403 [ ac_cv_have_u_char="no" ]
1406 if test "x$ac_cv_have_u_char" = "xyes" ; then
1407 AC_DEFINE(HAVE_U_CHAR)
1412 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1414 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1417 #include <sys/types.h>
1419 [ size_t foo; foo = 1235; ],
1420 [ ac_cv_have_size_t="yes" ],
1421 [ ac_cv_have_size_t="no" ]
1424 if test "x$ac_cv_have_size_t" = "xyes" ; then
1425 AC_DEFINE(HAVE_SIZE_T)
1428 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1431 #include <sys/types.h>
1433 [ ssize_t foo; foo = 1235; ],
1434 [ ac_cv_have_ssize_t="yes" ],
1435 [ ac_cv_have_ssize_t="no" ]
1438 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1439 AC_DEFINE(HAVE_SSIZE_T)
1442 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1447 [ clock_t foo; foo = 1235; ],
1448 [ ac_cv_have_clock_t="yes" ],
1449 [ ac_cv_have_clock_t="no" ]
1452 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1453 AC_DEFINE(HAVE_CLOCK_T)
1456 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1459 #include <sys/types.h>
1460 #include <sys/socket.h>
1462 [ sa_family_t foo; foo = 1235; ],
1463 [ ac_cv_have_sa_family_t="yes" ],
1466 #include <sys/types.h>
1467 #include <sys/socket.h>
1468 #include <netinet/in.h>
1470 [ sa_family_t foo; foo = 1235; ],
1471 [ ac_cv_have_sa_family_t="yes" ],
1473 [ ac_cv_have_sa_family_t="no" ]
1477 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1478 AC_DEFINE(HAVE_SA_FAMILY_T)
1481 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1484 #include <sys/types.h>
1486 [ pid_t foo; foo = 1235; ],
1487 [ ac_cv_have_pid_t="yes" ],
1488 [ ac_cv_have_pid_t="no" ]
1491 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1492 AC_DEFINE(HAVE_PID_T)
1495 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1498 #include <sys/types.h>
1500 [ mode_t foo; foo = 1235; ],
1501 [ ac_cv_have_mode_t="yes" ],
1502 [ ac_cv_have_mode_t="no" ]
1505 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1506 AC_DEFINE(HAVE_MODE_T)
1510 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1513 #include <sys/types.h>
1514 #include <sys/socket.h>
1516 [ struct sockaddr_storage s; ],
1517 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1518 [ ac_cv_have_struct_sockaddr_storage="no" ]
1521 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1522 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1525 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1528 #include <sys/types.h>
1529 #include <netinet/in.h>
1531 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1532 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1533 [ ac_cv_have_struct_sockaddr_in6="no" ]
1536 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1537 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1540 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1543 #include <sys/types.h>
1544 #include <netinet/in.h>
1546 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1547 [ ac_cv_have_struct_in6_addr="yes" ],
1548 [ ac_cv_have_struct_in6_addr="no" ]
1551 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1552 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1555 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1558 #include <sys/types.h>
1559 #include <sys/socket.h>
1562 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1563 [ ac_cv_have_struct_addrinfo="yes" ],
1564 [ ac_cv_have_struct_addrinfo="no" ]
1567 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1568 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1571 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1573 [ #include <sys/time.h> ],
1574 [ struct timeval tv; tv.tv_sec = 1;],
1575 [ ac_cv_have_struct_timeval="yes" ],
1576 [ ac_cv_have_struct_timeval="no" ]
1579 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1580 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1581 have_struct_timeval=1
1584 AC_CHECK_TYPES(struct timespec)
1586 # We need int64_t or else certian parts of the compile will fail.
1587 if test "x$ac_cv_have_int64_t" = "xno" -a \
1588 "x$ac_cv_sizeof_long_int" != "x8" -a \
1589 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1590 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1591 echo "an alternative compiler (I.E., GCC) before continuing."
1595 dnl test snprintf (broken on SCO w/gcc)
1600 #ifdef HAVE_SNPRINTF
1604 char expected_out[50];
1606 #if (SIZEOF_LONG_INT == 8)
1607 long int num = 0x7fffffffffffffff;
1609 long long num = 0x7fffffffffffffffll;
1611 strcpy(expected_out, "9223372036854775807");
1612 snprintf(buf, mazsize, "%lld", num);
1613 if(strcmp(buf, expected_out) != 0)
1620 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1624 dnl Checks for structure members
1625 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1626 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1627 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1628 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1629 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1630 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1631 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1632 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1633 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1634 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1635 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1636 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1637 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1638 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1639 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1640 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1641 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1643 AC_CHECK_MEMBERS([struct stat.st_blksize])
1645 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1646 ac_cv_have_ss_family_in_struct_ss, [
1649 #include <sys/types.h>
1650 #include <sys/socket.h>
1652 [ struct sockaddr_storage s; s.ss_family = 1; ],
1653 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1654 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1657 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1658 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1661 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1662 ac_cv_have___ss_family_in_struct_ss, [
1665 #include <sys/types.h>
1666 #include <sys/socket.h>
1668 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1669 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1670 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1673 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1674 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1677 AC_CACHE_CHECK([for pw_class field in struct passwd],
1678 ac_cv_have_pw_class_in_struct_passwd, [
1683 [ struct passwd p; p.pw_class = 0; ],
1684 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1685 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1688 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1689 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1692 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1693 ac_cv_have_pw_expire_in_struct_passwd, [
1698 [ struct passwd p; p.pw_expire = 0; ],
1699 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1700 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1703 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1704 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1707 AC_CACHE_CHECK([for pw_change field in struct passwd],
1708 ac_cv_have_pw_change_in_struct_passwd, [
1713 [ struct passwd p; p.pw_change = 0; ],
1714 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1715 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1718 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1719 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1722 dnl make sure we're using the real structure members and not defines
1723 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1724 ac_cv_have_accrights_in_msghdr, [
1727 #include <sys/types.h>
1728 #include <sys/socket.h>
1729 #include <sys/uio.h>
1731 #ifdef msg_accrights
1735 m.msg_accrights = 0;
1739 [ ac_cv_have_accrights_in_msghdr="yes" ],
1740 [ ac_cv_have_accrights_in_msghdr="no" ]
1743 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1744 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1747 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1748 ac_cv_have_control_in_msghdr, [
1751 #include <sys/types.h>
1752 #include <sys/socket.h>
1753 #include <sys/uio.h>
1763 [ ac_cv_have_control_in_msghdr="yes" ],
1764 [ ac_cv_have_control_in_msghdr="no" ]
1767 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1768 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1771 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1773 [ extern char *__progname; printf("%s", __progname); ],
1774 [ ac_cv_libc_defines___progname="yes" ],
1775 [ ac_cv_libc_defines___progname="no" ]
1778 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1779 AC_DEFINE(HAVE___PROGNAME)
1782 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1786 [ printf("%s", __FUNCTION__); ],
1787 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1788 [ ac_cv_cc_implements___FUNCTION__="no" ]
1791 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1792 AC_DEFINE(HAVE___FUNCTION__)
1795 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1799 [ printf("%s", __func__); ],
1800 [ ac_cv_cc_implements___func__="yes" ],
1801 [ ac_cv_cc_implements___func__="no" ]
1804 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1805 AC_DEFINE(HAVE___func__)
1808 AC_CACHE_CHECK([whether getopt has optreset support],
1809 ac_cv_have_getopt_optreset, [
1814 [ extern int optreset; optreset = 0; ],
1815 [ ac_cv_have_getopt_optreset="yes" ],
1816 [ ac_cv_have_getopt_optreset="no" ]
1819 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1820 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1823 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1825 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1826 [ ac_cv_libc_defines_sys_errlist="yes" ],
1827 [ ac_cv_libc_defines_sys_errlist="no" ]
1830 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1831 AC_DEFINE(HAVE_SYS_ERRLIST)
1835 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1837 [ extern int sys_nerr; printf("%i", sys_nerr);],
1838 [ ac_cv_libc_defines_sys_nerr="yes" ],
1839 [ ac_cv_libc_defines_sys_nerr="no" ]
1842 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1843 AC_DEFINE(HAVE_SYS_NERR)
1847 # Check whether user wants sectok support
1849 [ --with-sectok Enable smartcard support using libsectok],
1851 if test "x$withval" != "xno" ; then
1852 if test "x$withval" != "xyes" ; then
1853 CPPFLAGS="$CPPFLAGS -I${withval}"
1854 LDFLAGS="$LDFLAGS -L${withval}"
1855 if test ! -z "$need_dash_r" ; then
1856 LDFLAGS="$LDFLAGS -R${withval}"
1858 if test ! -z "$blibpath" ; then
1859 blibpath="$blibpath:${withval}"
1862 AC_CHECK_HEADERS(sectok.h)
1863 if test "$ac_cv_header_sectok_h" != yes; then
1864 AC_MSG_ERROR(Can't find sectok.h)
1866 AC_CHECK_LIB(sectok, sectok_open)
1867 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1868 AC_MSG_ERROR(Can't find libsectok)
1870 AC_DEFINE(SMARTCARD)
1871 AC_DEFINE(USE_SECTOK)
1872 SCARD_MSG="yes, using sectok"
1877 # Check whether user wants OpenSC support
1879 AC_HELP_STRING([--with-opensc=PFX],
1880 [Enable smartcard support using OpenSC]),
1881 opensc_config_prefix="$withval", opensc_config_prefix="")
1882 if test x$opensc_config_prefix != x ; then
1883 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1884 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1885 if test "$OPENSC_CONFIG" != "no"; then
1886 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1887 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1888 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1889 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1890 AC_DEFINE(SMARTCARD)
1891 AC_DEFINE(USE_OPENSC)
1892 SCARD_MSG="yes, using OpenSC"
1896 # Check whether user wants DNS support
1899 [ --with-dns Support for fetching keys from DNS (experimental)],
1901 if test "x$withval" != "xno" ; then
1904 AC_SEARCH_LIBS(getrrsetbyname, resolv,
1905 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1907 # Needed by our getrrsetbyname()
1908 AC_SEARCH_LIBS(res_query, resolv)
1909 AC_SEARCH_LIBS(dn_expand, resolv)
1915 # Check whether user wants Kerberos 5 support
1917 AC_ARG_WITH(kerberos5,
1918 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1920 if test "x$withval" != "xno" ; then
1921 if test "x$withval" = "xyes" ; then
1922 KRB5ROOT="/usr/local"
1926 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1927 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1930 AC_MSG_CHECKING(whether we are using Heimdal)
1931 AC_TRY_COMPILE([ #include <krb5.h> ],
1932 [ char *tmp = heimdal_version; ],
1933 [ AC_MSG_RESULT(yes)
1935 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1938 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1941 if test ! -z "$need_dash_r" ; then
1942 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1944 if test ! -z "$blibpath" ; then
1945 blibpath="$blibpath:${KRB5ROOT}/lib"
1947 AC_SEARCH_LIBS(dn_expand, resolv)
1953 LIBS="$LIBS $K5LIBS"
1955 # Looking for programs, paths and files
1957 PRIVSEP_PATH=/var/empty
1958 AC_ARG_WITH(privsep-path,
1959 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
1961 if test "x$withval" != "$no" ; then
1962 PRIVSEP_PATH=$withval
1966 AC_SUBST(PRIVSEP_PATH)
1969 [ --with-xauth=PATH Specify path to xauth program ],
1971 if test "x$withval" != "xno" ; then
1977 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1978 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1979 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1980 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1981 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
1982 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
1983 xauth_path="/usr/openwin/bin/xauth"
1989 AC_ARG_ENABLE(strip,
1990 [ --disable-strip Disable calling strip(1) on install],
1992 if test "x$enableval" = "xno" ; then
1999 if test -z "$xauth_path" ; then
2000 XAUTH_PATH="undefined"
2001 AC_SUBST(XAUTH_PATH)
2003 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
2004 XAUTH_PATH=$xauth_path
2005 AC_SUBST(XAUTH_PATH)
2008 # Check for mail directory (last resort if we cannot get it from headers)
2009 if test ! -z "$MAIL" ; then
2010 maildir=`dirname $MAIL`
2011 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2014 if test -z "$no_dev_ptmx" ; then
2015 if test "x$disable_ptmx_check" != "xyes" ; then
2016 AC_CHECK_FILE("/dev/ptmx",
2018 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2024 AC_CHECK_FILE("/dev/ptc",
2026 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2031 # Options from here on. Some of these are preset by platform above
2032 AC_ARG_WITH(mantype,
2033 [ --with-mantype=man|cat|doc Set man page type],
2040 AC_MSG_ERROR(invalid man type: $withval)
2045 if test -z "$MANTYPE"; then
2046 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2047 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
2048 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2050 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2057 if test "$MANTYPE" = "doc"; then
2064 # Check whether to enable MD5 passwords
2066 AC_ARG_WITH(md5-passwords,
2067 [ --with-md5-passwords Enable use of MD5 passwords],
2069 if test "x$withval" != "xno" ; then
2070 AC_DEFINE(HAVE_MD5_PASSWORDS)
2076 # Whether to disable shadow password support
2078 [ --without-shadow Disable shadow password support],
2080 if test "x$withval" = "xno" ; then
2081 AC_DEFINE(DISABLE_SHADOW)
2087 if test -z "$disable_shadow" ; then
2088 AC_MSG_CHECKING([if the systems has expire shadow information])
2091 #include <sys/types.h>
2094 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2095 [ sp_expire_available=yes ], []
2098 if test "x$sp_expire_available" = "xyes" ; then
2100 AC_DEFINE(HAS_SHADOW_EXPIRE)
2106 # Use ip address instead of hostname in $DISPLAY
2107 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2108 DISPLAY_HACK_MSG="yes"
2109 AC_DEFINE(IPADDR_IN_DISPLAY)
2111 DISPLAY_HACK_MSG="no"
2112 AC_ARG_WITH(ipaddr-display,
2113 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2115 if test "x$withval" != "xno" ; then
2116 AC_DEFINE(IPADDR_IN_DISPLAY)
2117 DISPLAY_HACK_MSG="yes"
2123 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2124 if test $ac_cv_func_login_getcapbool = "yes" -a \
2125 $ac_cv_header_login_cap_h = "yes" ; then
2128 # Whether to mess with the default path
2129 SERVER_PATH_MSG="(default)"
2130 AC_ARG_WITH(default-path,
2131 [ --with-default-path= Specify default \$PATH environment for server],
2133 if test "$USES_LOGIN_CONF" = "yes" ; then
2135 --with-default-path=PATH has no effect on this system.
2136 Edit /etc/login.conf instead.])
2137 elif test "x$withval" != "xno" ; then
2138 user_path="$withval"
2139 SERVER_PATH_MSG="$withval"
2142 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2143 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2147 /* find out what STDPATH is */
2152 #ifndef _PATH_STDPATH
2153 # ifdef _PATH_USERPATH /* Irix */
2154 # define _PATH_STDPATH _PATH_USERPATH
2156 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2159 #include <sys/types.h>
2160 #include <sys/stat.h>
2162 #define DATA "conftest.stdpath"
2169 fd = fopen(DATA,"w");
2173 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2178 ], [ user_path=`cat conftest.stdpath` ],
2179 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2180 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2182 # make sure $bindir is in USER_PATH so scp will work
2183 t_bindir=`eval echo ${bindir}`
2185 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2188 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2190 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2191 if test $? -ne 0 ; then
2192 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2193 if test $? -ne 0 ; then
2194 user_path=$user_path:$t_bindir
2195 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2200 if test "$USES_LOGIN_CONF" != "yes" ; then
2201 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2205 # Set superuser path separately to user path
2206 AC_ARG_WITH(superuser-path,
2207 [ --with-superuser-path= Specify different path for super-user],
2209 if test "x$withval" != "xno" ; then
2210 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2211 superuser_path=$withval
2217 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2218 IPV4_IN6_HACK_MSG="no"
2220 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2222 if test "x$withval" != "xno" ; then
2224 AC_DEFINE(IPV4_IN_IPV6)
2225 IPV4_IN6_HACK_MSG="yes"
2230 if test "x$inet6_default_4in6" = "xyes"; then
2231 AC_MSG_RESULT([yes (default)])
2232 AC_DEFINE(IPV4_IN_IPV6)
2233 IPV4_IN6_HACK_MSG="yes"
2235 AC_MSG_RESULT([no (default)])
2240 # Whether to enable BSD auth support
2242 AC_ARG_WITH(bsd-auth,
2243 [ --with-bsd-auth Enable BSD auth support],
2245 if test "x$withval" != "xno" ; then
2252 # Where to place sshd.pid
2254 # make sure the directory exists
2255 if test ! -d $piddir ; then
2256 piddir=`eval echo ${sysconfdir}`
2258 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2262 AC_ARG_WITH(pid-dir,
2263 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2265 if test "x$withval" != "xno" ; then
2267 if test ! -d $piddir ; then
2268 AC_MSG_WARN([** no $piddir directory on this system **])
2274 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2277 dnl allow user to disable some login recording features
2278 AC_ARG_ENABLE(lastlog,
2279 [ --disable-lastlog disable use of lastlog even if detected [no]],
2281 if test "x$enableval" = "xno" ; then
2282 AC_DEFINE(DISABLE_LASTLOG)
2287 [ --disable-utmp disable use of utmp even if detected [no]],
2289 if test "x$enableval" = "xno" ; then
2290 AC_DEFINE(DISABLE_UTMP)
2294 AC_ARG_ENABLE(utmpx,
2295 [ --disable-utmpx disable use of utmpx even if detected [no]],
2297 if test "x$enableval" = "xno" ; then
2298 AC_DEFINE(DISABLE_UTMPX)
2303 [ --disable-wtmp disable use of wtmp even if detected [no]],
2305 if test "x$enableval" = "xno" ; then
2306 AC_DEFINE(DISABLE_WTMP)
2310 AC_ARG_ENABLE(wtmpx,
2311 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2313 if test "x$enableval" = "xno" ; then
2314 AC_DEFINE(DISABLE_WTMPX)
2318 AC_ARG_ENABLE(libutil,
2319 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2321 if test "x$enableval" = "xno" ; then
2322 AC_DEFINE(DISABLE_LOGIN)
2326 AC_ARG_ENABLE(pututline,
2327 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2329 if test "x$enableval" = "xno" ; then
2330 AC_DEFINE(DISABLE_PUTUTLINE)
2334 AC_ARG_ENABLE(pututxline,
2335 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2337 if test "x$enableval" = "xno" ; then
2338 AC_DEFINE(DISABLE_PUTUTXLINE)
2342 AC_ARG_WITH(lastlog,
2343 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2345 if test "x$withval" = "xno" ; then
2346 AC_DEFINE(DISABLE_LASTLOG)
2348 conf_lastlog_location=$withval
2353 dnl lastlog, [uw]tmpx? detection
2354 dnl NOTE: set the paths in the platform section to avoid the
2355 dnl need for command-line parameters
2356 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2358 dnl lastlog detection
2359 dnl NOTE: the code itself will detect if lastlog is a directory
2360 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2362 #include <sys/types.h>
2364 #ifdef HAVE_LASTLOG_H
2365 # include <lastlog.h>
2374 [ char *lastlog = LASTLOG_FILE; ],
2375 [ AC_MSG_RESULT(yes) ],
2378 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2380 #include <sys/types.h>
2382 #ifdef HAVE_LASTLOG_H
2383 # include <lastlog.h>
2389 [ char *lastlog = _PATH_LASTLOG; ],
2390 [ AC_MSG_RESULT(yes) ],
2393 system_lastlog_path=no
2398 if test -z "$conf_lastlog_location"; then
2399 if test x"$system_lastlog_path" = x"no" ; then
2400 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2401 if (test -d "$f" || test -f "$f") ; then
2402 conf_lastlog_location=$f
2405 if test -z "$conf_lastlog_location"; then
2406 AC_MSG_WARN([** Cannot find lastlog **])
2407 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2412 if test -n "$conf_lastlog_location"; then
2413 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2417 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2419 #include <sys/types.h>
2425 [ char *utmp = UTMP_FILE; ],
2426 [ AC_MSG_RESULT(yes) ],
2428 system_utmp_path=no ]
2430 if test -z "$conf_utmp_location"; then
2431 if test x"$system_utmp_path" = x"no" ; then
2432 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2433 if test -f $f ; then
2434 conf_utmp_location=$f
2437 if test -z "$conf_utmp_location"; then
2438 AC_DEFINE(DISABLE_UTMP)
2442 if test -n "$conf_utmp_location"; then
2443 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2447 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2449 #include <sys/types.h>
2455 [ char *wtmp = WTMP_FILE; ],
2456 [ AC_MSG_RESULT(yes) ],
2458 system_wtmp_path=no ]
2460 if test -z "$conf_wtmp_location"; then
2461 if test x"$system_wtmp_path" = x"no" ; then
2462 for f in /usr/adm/wtmp /var/log/wtmp; do
2463 if test -f $f ; then
2464 conf_wtmp_location=$f
2467 if test -z "$conf_wtmp_location"; then
2468 AC_DEFINE(DISABLE_WTMP)
2472 if test -n "$conf_wtmp_location"; then
2473 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2477 dnl utmpx detection - I don't know any system so perverse as to require
2478 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2480 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2482 #include <sys/types.h>
2491 [ char *utmpx = UTMPX_FILE; ],
2492 [ AC_MSG_RESULT(yes) ],
2494 system_utmpx_path=no ]
2496 if test -z "$conf_utmpx_location"; then
2497 if test x"$system_utmpx_path" = x"no" ; then
2498 AC_DEFINE(DISABLE_UTMPX)
2501 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2505 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2507 #include <sys/types.h>
2516 [ char *wtmpx = WTMPX_FILE; ],
2517 [ AC_MSG_RESULT(yes) ],
2519 system_wtmpx_path=no ]
2521 if test -z "$conf_wtmpx_location"; then
2522 if test x"$system_wtmpx_path" = x"no" ; then
2523 AC_DEFINE(DISABLE_WTMPX)
2526 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2530 if test ! -z "$blibpath" ; then
2531 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2532 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
2535 dnl remove pam and dl because they are in $LIBPAM
2536 if test "$PAM_MSG" = yes ; then
2537 LIBS=`echo $LIBS | sed 's/-lpam //'`
2539 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2540 LIBS=`echo $LIBS | sed 's/-ldl //'`
2544 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2547 # Print summary of options
2549 # Someone please show me a better way :)
2550 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2551 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2552 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2553 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2554 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2555 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2556 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2557 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2558 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2559 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2562 echo "OpenSSH has been configured with the following options:"
2563 echo " User binaries: $B"
2564 echo " System binaries: $C"
2565 echo " Configuration files: $D"
2566 echo " Askpass program: $E"
2567 echo " Manual pages: $F"
2568 echo " PID file: $G"
2569 echo " Privilege separation chroot path: $H"
2570 if test "$USES_LOGIN_CONF" = "yes" ; then
2571 echo " At runtime, sshd will use the path defined in /etc/login.conf"
2573 echo " sshd default user PATH: $I"
2575 if test ! -z "$superuser_path" ; then
2576 echo " sshd superuser user PATH: $J"
2578 echo " Manpage format: $MANTYPE"
2579 echo " DNS support: $DNS_MSG"
2580 echo " PAM support: $PAM_MSG"
2581 echo " KerberosV support: $KRB5_MSG"
2582 echo " Smartcard support: $SCARD_MSG"
2583 echo " S/KEY support: $SKEY_MSG"
2584 echo " TCP Wrappers support: $TCPW_MSG"
2585 echo " MD5 password support: $MD5_MSG"
2586 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2587 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2588 echo " BSD Auth support: $BSD_AUTH_MSG"
2589 echo " Random number source: $RAND_MSG"
2590 if test ! -z "$USE_RAND_HELPER" ; then
2591 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2596 echo " Host: ${host}"
2597 echo " Compiler: ${CC}"
2598 echo " Compiler flags: ${CFLAGS}"
2599 echo "Preprocessor flags: ${CPPFLAGS}"
2600 echo " Linker flags: ${LDFLAGS}"
2601 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2605 if test "x$PAM_MSG" = "xyes" ; then
2606 echo "PAM is enabled. You may need to install a PAM control file "
2607 echo "for sshd, otherwise password authentication may fail. "
2608 echo "Example PAM control files can be found in the contrib/ "
2613 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2614 echo "WARNING: you are using the builtin random number collection "
2615 echo "service. Please read WARNING.RNG and request that your OS "
2616 echo "vendor includes kernel-based random number collection in "
2617 echo "future versions of your OS."