blob: 94d127299ce7f7e85dd957d4a33b3f913d502e28 [file] [log] [blame]
Darren Tucker38049032005-02-26 10:07:37 +11001# $Id: configure.ac,v 1.248 2005/02/25 23:07:38 dtucker Exp $
Damien Miller4fefe242004-03-11 14:20:10 +11002#
3# Copyright (c) 1999-2004 Damien Miller
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Damien Millere9cf3572001-02-09 12:55:35 +110016
Darren Tucker59f79c42004-09-30 21:17:08 +100017AC_INIT(OpenSSH, Portable)
Tim Rice13aae5e2001-10-21 17:53:58 -070018AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +100019
20AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +110021AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +110022AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +110023AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100024
Damien Millera22ba012000-03-02 23:09:20 +110025# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100026AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110027AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100028AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110029AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000030AC_PATH_PROG(AR, ar)
Tim Rice5af9db92004-06-19 19:31:06 -070031AC_PATH_PROG(CAT, cat)
32AC_PATH_PROG(KILL, kill)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070033AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080034AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110035AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100036AC_PATH_PROG(ENT, ent)
37AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110038AC_PATH_PROG(TEST_MINUS_S_SH, bash)
39AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
40AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070041AC_PATH_PROG(SH, sh)
Tim Ricef7ba8f62004-06-20 10:37:32 -070042AC_SUBST(TEST_SHELL,sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110043
Tim Rice6f1f7582004-05-30 21:38:51 -070044dnl for buildpkg.sh
45AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
46 [/usr/sbin${PATH_SEPARATOR}/etc])
47AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd,
48 [/usr/sbin${PATH_SEPARATOR}/etc])
49AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no)
50
Damien Millere8bb4502001-09-25 16:39:35 +100051# System features
52AC_SYS_LARGEFILE
53
Damien Miller3f62aba2000-11-29 11:56:35 +110054if test -z "$AR" ; then
55 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
56fi
57
Damien Millerad833b32000-08-23 10:46:23 +100058# Use LOGIN_PROGRAM from environment if possible
59if test ! -z "$LOGIN_PROGRAM" ; then
60 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
61else
62 # Search for login
63 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
64 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
65 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
66 fi
67fi
68
Darren Tucker23bc8d02004-02-06 16:24:31 +110069AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
70if test ! -z "$PATH_PASSWD_PROG" ; then
71 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
72fi
73
Damien Miller166bd442000-03-16 10:48:25 +110074if test -z "$LD" ; then
75 LD=$CC
76fi
77AC_SUBST(LD)
78
Damien Miller166bd442000-03-16 10:48:25 +110079AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110080if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100081 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110082fi
83
Tim Rice88368a32003-12-08 12:35:59 -080084AC_ARG_WITH(rpath,
85 [ --without-rpath Disable auto-added -R linker paths],
86 [
87 if test "x$withval" = "xno" ; then
88 need_dash_r=""
89 fi
90 if test "x$withval" = "xyes" ; then
91 need_dash_r=1
92 fi
93 ]
94)
95
Damien Millera22ba012000-03-02 23:09:20 +110096# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110097case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110098*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110099 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +1000100 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -0800101 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100102 fi
Damien Millereab4bae2003-04-29 23:22:40 +1000103 saved_LDFLAGS="$LDFLAGS"
104 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
105 if (test -z "$blibflags"); then
106 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
107 AC_TRY_LINK([], [], [blibflags=$tryflags])
108 fi
109 done
110 if (test -z "$blibflags"); then
111 AC_MSG_RESULT(not found)
112 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
113 else
114 AC_MSG_RESULT($blibflags)
115 fi
116 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000117 dnl Check for authenticate. Might be in libs.a on older AIXes
118 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -0700119 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000120 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -0700121 LIBS="$LIBS -ls"
122 ])
123 ])
Darren Tucker3c774c52005-02-16 22:49:31 +1100124 dnl Check for various auth function declarations in headers.
Darren Tucker04cfbe02005-02-20 23:27:11 +1100125 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
126 passwdexpired], , , [#include <usersec.h>])
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000127 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
Darren Tucker3c774c52005-02-16 22:49:31 +1100128 AC_CHECK_DECLS(loginfailed,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000129 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
130 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000131 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000132 [(void)loginfailed("user","host","tty",0);],
133 [AC_MSG_RESULT(yes)
134 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000135 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000136 )],
137 [],
138 [#include <usersec.h>]
139 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000140 AC_CHECK_FUNCS(setauthdb)
Darren Tucker691d5232005-02-15 21:45:57 +1100141 check_for_aix_broken_getaddrinfo=1
Damien Millerf5fea442002-04-23 22:52:45 +1000142 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000143 AC_DEFINE(SETEUID_BREAKS_SETUID)
144 AC_DEFINE(BROKEN_SETREUID)
145 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000146 dnl AIX handles lastlog as part of its login message
147 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000148 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000149 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100150 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100151*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100152 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800153 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100154 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000155 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100156 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100157 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000158 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000159 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700160 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100161 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000162*-*-dgux*)
163 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100164 AC_DEFINE(SETEUID_BREAKS_SETUID)
165 AC_DEFINE(BROKEN_SETREUID)
166 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000167 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000168*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000169 AC_MSG_CHECKING(if we have working getaddrinfo)
170 AC_TRY_RUN([#include <mach-o/dyld.h>
171main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
172 exit(0);
173 else
174 exit(1);
175}], [AC_MSG_RESULT(working)],
176 [AC_MSG_RESULT(buggy)
177 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700178 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000179 AC_DEFINE(SETEUID_BREAKS_SETUID)
180 AC_DEFINE(BROKEN_SETREUID)
181 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100182 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000183 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000184*-*-hpux10.26)
185 if test -z "$GCC"; then
186 CFLAGS="$CFLAGS -Ae"
187 fi
188 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
189 IPADDR_IN_DISPLAY=yes
190 AC_DEFINE(HAVE_SECUREWARE)
191 AC_DEFINE(USE_PIPES)
192 AC_DEFINE(LOGIN_NO_ENDOPT)
193 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000194 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000195 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700196 LIBS="$LIBS -lsec -lsecpw"
197 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000198 disable_ptmx_check=yes
199 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100200*-*-hpux10*)
201 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000202 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100203 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000204 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100205 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000206 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000207 AC_DEFINE(LOGIN_NO_ENDOPT)
208 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000209 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000210 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700211 LIBS="$LIBS -lsec"
212 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100213 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000214*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000215 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100216 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100217 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100218 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000219 AC_DEFINE(LOGIN_NO_ENDOPT)
220 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100221 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000222 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000223 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tucker2fba9932005-02-02 23:30:24 +1100224 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Darren Tucker4398cf52004-04-06 21:39:02 +1000225 check_for_hpux_broken_getaddrinfo=1
Darren Tuckera56f1912004-11-02 20:30:54 +1100226 check_for_conflicting_getspnam=1
Tim Ricef028f1e2002-07-19 12:41:10 -0700227 LIBS="$LIBS -lsec"
228 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000229 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100230*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100231 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000232 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000233 AC_DEFINE(SETEUID_BREAKS_SETUID)
234 AC_DEFINE(BROKEN_SETREUID)
235 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000236 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000237 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100238 ;;
239*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100240 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000241 AC_DEFINE(WITH_IRIX_ARRAY)
242 AC_DEFINE(WITH_IRIX_PROJECT)
243 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000244 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000245 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000246 AC_DEFINE(SETEUID_BREAKS_SETUID)
247 AC_DEFINE(BROKEN_SETREUID)
248 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker8db9a0f2004-04-06 21:31:12 +1000249 AC_DEFINE(BROKEN_UPDWTMPX)
Damien Millerf1b9d112002-04-23 23:09:19 +1000250 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000251 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100252 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100253*-*-linux*)
254 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100255 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000256 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100257 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000258 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker809031f2004-03-30 14:03:45 +1000259 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!")
Damien Miller35276252003-06-03 10:14:28 +1000260 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Darren Tuckere59b5082004-06-28 16:01:19 +1000261 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM)
Darren Tucker2fba9932005-02-02 23:30:24 +1100262 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
263 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Damien Miller7bcb0892000-03-11 20:45:40 +1100264 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000265 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000266 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000267 AC_DEFINE(BROKEN_CMSG_TYPE)
268 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000269 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100270 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000271mips-sony-bsd|mips-sony-newsos4)
272 AC_DEFINE(HAVE_NEWS4)
273 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000274 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100275*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000276 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800277 if test "x$withval" != "xno" ; then
278 need_dash_r=1
279 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100280 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100281*-*-freebsd*)
282 check_for_libcrypt_later=1
283 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000284*-*-bsdi*)
285 AC_DEFINE(SETEUID_BREAKS_SETUID)
286 AC_DEFINE(BROKEN_SETREUID)
287 AC_DEFINE(BROKEN_SETREGID)
288 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000289*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000290 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100291 conf_utmp_location=/etc/utmp
292 conf_wtmp_location=/usr/adm/wtmp
293 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000294 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000295 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000296 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100297 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000298 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100299*-*-solaris*)
Tim Ricead4a1882004-02-29 15:53:37 -0800300 if test "x$withval" != "xno" ; then
301 need_dash_r=1
302 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100303 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000304 AC_DEFINE(LOGIN_NEEDS_UTMPX)
305 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000306 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker21dd0892004-08-16 23:12:05 +1000307 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID)
Darren Tuckere41bba52003-08-25 11:51:19 +1000308 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000309 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
310 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000311 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000312 # hardwire lastlog location (can't detect it on some versions)
313 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000314 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
315 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
316 if test "$sol2ver" -ge 8; then
317 AC_MSG_RESULT(yes)
318 AC_DEFINE(DISABLE_UTMP)
319 AC_DEFINE(DISABLE_WTMP)
320 else
321 AC_MSG_RESULT(no)
322 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100323 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000324*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000325 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000326 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100327 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000328 conf_utmp_location=/etc/utmp
329 conf_wtmp_location=/var/adm/wtmp
330 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000331 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000332 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000333*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700334 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000335 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000336 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000337 AC_DEFINE(SETEUID_BREAKS_SETUID)
338 AC_DEFINE(BROKEN_SETREUID)
339 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000340 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000341*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700342 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000343 AC_CHECK_LIB(dl, dlsym, ,)
Darren Tuckerca6e7a72005-02-16 16:19:17 +1100344 # -lresolv needs to be at then end of LIBS or DNS lookups break
345 AC_CHECK_LIB(res_query, resolv, [ LIBS="$LIBS -lresolv" ])
Damien Millerfd9885e2001-01-10 08:16:53 +1100346 IPADDR_IN_DISPLAY=yes
347 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000348 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000349 AC_DEFINE(SETEUID_BREAKS_SETUID)
350 AC_DEFINE(BROKEN_SETREUID)
351 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000352 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000353 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700354 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
355 # Attention: always take care to bind libsocket and libnsl before libc,
356 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000357 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800358# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
Damien Miller78315eb2000-09-29 23:01:36 +1100359*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100360 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700361 AC_DEFINE(SETEUID_BREAKS_SETUID)
362 AC_DEFINE(BROKEN_SETREUID)
363 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100364 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800365# UnixWare 7.x, OpenUNIX 8
Damien Miller78315eb2000-09-29 23:01:36 +1100366*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100367 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700368 AC_DEFINE(SETEUID_BREAKS_SETUID)
369 AC_DEFINE(BROKEN_SETREUID)
370 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100371 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100372*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100373 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800374# SCO UNIX and OEM versions of SCO UNIX
Damien Miller78315eb2000-09-29 23:01:36 +1100375*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800376 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Ricee8c898a2004-02-23 21:47:04 -0800377 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100378 RANLIB=true
379 no_dev_ptmx=1
380 AC_DEFINE(BROKEN_SYS_TERMIO_H)
381 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000382 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000383 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100384 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Ricefe6d5aa2004-04-16 20:03:07 -0700385 AC_DEFINE(SETEUID_BREAKS_SETUID)
386 AC_DEFINE(BROKEN_SETREUID)
387 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700388 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100389 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700390 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700391 do_sco3_extra_lib_check=yes
Tim Ricef7ba8f62004-06-20 10:37:32 -0700392 TEST_SHELL=ksh
Damien Miller78315eb2000-09-29 23:01:36 +1100393 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800394# SCO OpenServer 5.x
Damien Miller78315eb2000-09-29 23:01:36 +1100395*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800396 if test -z "$GCC"; then
397 CFLAGS="$CFLAGS -belf"
398 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100399 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000400 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100401 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000402 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000403 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700404 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700405 AC_DEFINE(SETEUID_BREAKS_SETUID)
406 AC_DEFINE(BROKEN_SETREUID)
407 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700408 AC_DEFINE(WITH_ABBREV_NO_TTY)
Tim Rice816bd0d2004-07-19 10:19:26 -0700409 AC_DEFINE(BROKEN_UPDWTMPX)
Darren Tucker33370e02005-02-09 22:17:28 +1100410 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
Damien Miller217f5672001-02-16 12:12:41 +1100411 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700412 MANTYPE=man
Tim Ricef7ba8f62004-06-20 10:37:32 -0700413 TEST_SHELL=ksh
Damien Millera66626b2000-06-13 18:57:53 +1000414 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000415*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100416 AC_DEFINE(NO_SSH_LASTLOG)
417 AC_DEFINE(SETEUID_BREAKS_SETUID)
418 AC_DEFINE(BROKEN_SETREUID)
419 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000420 AC_DEFINE(USE_PIPES)
421 AC_DEFINE(DISABLE_FD_PASSING)
422 LDFLAGS="$LDFLAGS"
423 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
424 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000425 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000426*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100427 AC_DEFINE(SETEUID_BREAKS_SETUID)
428 AC_DEFINE(BROKEN_SETREUID)
429 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000430 AC_DEFINE(WITH_ABBREV_NO_TTY)
431 AC_DEFINE(USE_PIPES)
432 AC_DEFINE(DISABLE_FD_PASSING)
433 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100434 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000435 MANTYPE=cat
436 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000437*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100438 AC_DEFINE(SETEUID_BREAKS_SETUID)
439 AC_DEFINE(BROKEN_SETREUID)
440 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000441 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700442 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700443 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000444 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
445 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
446 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700447 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000448*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000449 AC_MSG_CHECKING(for Digital Unix SIA)
450 no_osfsia=""
451 AC_ARG_WITH(osfsia,
452 [ --with-osfsia Enable Digital Unix SIA],
453 [
454 if test "x$withval" = "xno" ; then
455 AC_MSG_RESULT(disabled)
456 no_osfsia=1
457 fi
458 ],
459 )
460 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000461 if test -f /etc/sia/matrix.conf; then
462 AC_MSG_RESULT(yes)
463 AC_DEFINE(HAVE_OSF_SIA)
464 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000465 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000466 LIBS="$LIBS -lsecurity -ldb -lm -laud"
467 else
468 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100469 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000470 fi
471 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000472 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700473 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000474 AC_DEFINE(BROKEN_SETREUID)
475 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000476 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000477
478*-*-nto-qnx)
479 AC_DEFINE(USE_PIPES)
480 AC_DEFINE(NO_X11_UNIX_SOCKETS)
481 AC_DEFINE(MISSING_NFDBITS)
482 AC_DEFINE(MISSING_HOWMANY)
483 AC_DEFINE(MISSING_FD_MASK)
484 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100485esac
486
Damien Millere37bfc12000-06-05 09:37:43 +1000487# Allow user to specify flags
488AC_ARG_WITH(cflags,
489 [ --with-cflags Specify additional flags to pass to compiler],
490 [
491 if test "x$withval" != "xno" ; then
492 CFLAGS="$CFLAGS $withval"
493 fi
494 ]
495)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000496AC_ARG_WITH(cppflags,
497 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
498 [
499 if test "x$withval" != "xno"; then
500 CPPFLAGS="$CPPFLAGS $withval"
501 fi
502 ]
503)
Damien Millere37bfc12000-06-05 09:37:43 +1000504AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000505 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000506 [
507 if test "x$withval" != "xno" ; then
508 LDFLAGS="$LDFLAGS $withval"
509 fi
510 ]
511)
512AC_ARG_WITH(libs,
513 [ --with-libs Specify additional libraries to link with],
514 [
515 if test "x$withval" != "xno" ; then
516 LIBS="$LIBS $withval"
517 fi
518 ]
519)
520
Darren Tucker6eb93042003-06-29 21:30:41 +1000521AC_MSG_CHECKING(compiler and flags for sanity)
Darren Tucker623d92f2004-09-12 22:36:15 +1000522AC_RUN_IFELSE(
523 [AC_LANG_SOURCE([
Darren Tucker6eb93042003-06-29 21:30:41 +1000524#include <stdio.h>
525int main(){exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000526 ])],
Darren Tucker6eb93042003-06-29 21:30:41 +1000527 [ AC_MSG_RESULT(yes) ],
528 [
529 AC_MSG_RESULT(no)
530 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000531 ],
532 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
Darren Tucker6eb93042003-06-29 21:30:41 +1000533)
534
Tim Rice4cec93f2002-02-26 08:40:48 -0800535# Checks for header files.
Damien Miller36f49652004-08-15 18:40:59 +1000536AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \
537 floatingpoint.h getopt.h glob.h ia.h lastlog.h limits.h login.h \
538 login_cap.h maillock.h ndir.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100539 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000540 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Damien Miller36f49652004-08-15 18:40:59 +1000541 strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \
542 sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \
Darren Tucker48d99d32004-08-29 17:04:50 +1000543 sys/pstat.h sys/select.h sys/stat.h sys/stream.h \
Damien Miller36f49652004-08-15 18:40:59 +1000544 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \
545 time.h tmpdir.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800546
Darren Tucker48d99d32004-08-29 17:04:50 +1000547# sys/ptms.h requires sys/stream.h to be included first on Solaris
548AC_CHECK_HEADERS(sys/ptms.h, [], [], [
549#ifdef HAVE_SYS_STREAM_H
550# include <sys/stream.h>
551#endif
552])
553
Damien Millera22ba012000-03-02 23:09:20 +1100554# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700555AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
556AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000557
Damien Millerdf288022001-02-18 13:07:07 +1100558dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700559if test "x$with_tcp_wrappers" != "xno" ; then
560 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
561 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
562 fi
563fi
Damien Millerdf288022001-02-18 13:07:07 +1100564
Tim Rice1e1ef642003-09-11 22:19:31 -0700565dnl IRIX and Solaris 2.5.1 have dirname() in libgen
566AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
567 AC_CHECK_LIB(gen, dirname,[
568 AC_CACHE_CHECK([for broken dirname],
569 ac_cv_have_broken_dirname, [
570 save_LIBS="$LIBS"
571 LIBS="$LIBS -lgen"
572 AC_TRY_RUN(
573 [
574#include <libgen.h>
575#include <string.h>
576
577int main(int argc, char **argv) {
578 char *s, buf[32];
579
580 strncpy(buf,"/etc", 32);
581 s = dirname(buf);
582 if (!s || strncmp(s, "/", 32) != 0) {
583 exit(1);
584 } else {
585 exit(0);
586 }
587}
588 ],
589 [ ac_cv_have_broken_dirname="no" ],
590 [ ac_cv_have_broken_dirname="yes" ]
591 )
592 LIBS="$save_LIBS"
593 ])
594 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
595 LIBS="$LIBS -lgen"
596 AC_DEFINE(HAVE_DIRNAME)
597 AC_CHECK_HEADERS(libgen.h)
598 fi
599 ])
600])
601
602AC_CHECK_FUNC(getspnam, ,
603 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
604AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
605
Tim Rice13aae5e2001-10-21 17:53:58 -0700606dnl zlib is required
607AC_ARG_WITH(zlib,
608 [ --with-zlib=PATH Use zlib in PATH],
609 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000610 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100611 AC_MSG_ERROR([*** zlib is required ***])
612 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700613 if test -d "$withval/lib"; then
614 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700615 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700616 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700617 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700618 fi
619 else
620 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700621 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700622 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700623 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700624 fi
625 fi
626 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700627 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700628 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700629 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700630 fi
631 ]
632)
633
Tim Ricefcb62202004-01-23 18:35:16 -0800634AC_CHECK_LIB(z, deflate, ,
635 [
636 saved_CPPFLAGS="$CPPFLAGS"
637 saved_LDFLAGS="$LDFLAGS"
638 save_LIBS="$LIBS"
639 dnl Check default zlib install dir
640 if test -n "${need_dash_r}"; then
641 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
642 else
643 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
644 fi
645 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
646 LIBS="$LIBS -lz"
647 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
648 [
649 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
650 ]
651 )
652 ]
653)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100654AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100655
656AC_ARG_WITH(zlib-version-check,
657 [ --without-zlib-version-check Disable zlib version check],
658 [ if test "x$withval" = "xno" ; then
659 zlib_check_nonfatal=1
660 fi
661 ]
662)
663
Darren Tucker2dcd2392004-01-23 17:13:33 +1100664AC_MSG_CHECKING(for zlib 1.1.4 or greater)
Darren Tucker623d92f2004-09-12 22:36:15 +1000665AC_RUN_IFELSE([AC_LANG_SOURCE([[
Darren Tucker2dcd2392004-01-23 17:13:33 +1100666#include <zlib.h>
667int main()
668{
669 int a, b, c, v;
670 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
671 exit(1);
672 v = a*1000000 + b*1000 + c;
673 if (v >= 1001004)
674 exit(0);
675 exit(2);
676}
Darren Tucker623d92f2004-09-12 22:36:15 +1000677 ]])],
Darren Tucker2dcd2392004-01-23 17:13:33 +1100678 AC_MSG_RESULT(yes),
679 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100680 if test -z "$zlib_check_nonfatal" ; then
681 AC_MSG_ERROR([*** zlib too old - check config.log ***
682Your reported zlib version has known security problems. It's possible your
683vendor has fixed these problems without changing the version number. If you
684are sure this is the case, you can disable the check by running
685"./configure --without-zlib-version-check".
686If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
687 else
688 AC_MSG_WARN([zlib version may have security problems])
689 fi
Darren Tuckera0c2b392004-09-11 23:26:37 +1000690 ],
691 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100692)
Damien Miller6f9c3372000-10-25 10:06:04 +1100693
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000694dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100695AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000696 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
697)
Damien Millera8e06ce2003-11-21 23:48:55 +1100698AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700699 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
700 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000701)
Damien Millerab18c411999-11-11 10:40:23 +1100702
Tim Ricee589a292001-11-03 11:09:32 -0800703dnl Checks for libutil functions
704AC_CHECK_HEADERS(libutil.h)
705AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
706AC_CHECK_FUNCS(logout updwtmp logwtmp)
707
Ben Lindstrom8697e082001-02-24 21:41:10 +0000708AC_FUNC_STRFTIME
709
Damien Miller3c027682001-03-14 11:39:45 +1100710# Check for ALTDIRFUNC glob() extension
711AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
712AC_EGREP_CPP(FOUNDIT,
713 [
714 #include <glob.h>
715 #ifdef GLOB_ALTDIRFUNC
716 FOUNDIT
717 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100718 ],
Damien Miller3c027682001-03-14 11:39:45 +1100719 [
720 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
721 AC_MSG_RESULT(yes)
722 ],
723 [
724 AC_MSG_RESULT(no)
725 ]
726)
Damien Millerab18c411999-11-11 10:40:23 +1100727
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000728# Check for g.gl_matchc glob() extension
729AC_MSG_CHECKING(for gl_matchc field in glob_t)
730AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100731 [
732 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000733 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100734 ],
735 [
736 AC_DEFINE(GLOB_HAS_GL_MATCHC)
737 AC_MSG_RESULT(yes)
738 ],
739 [
740 AC_MSG_RESULT(no)
741 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000742)
743
Damien Miller18bb4732001-03-28 14:35:30 +1000744AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000745AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000746 [AC_LANG_SOURCE([[
Damien Miller18bb4732001-03-28 14:35:30 +1000747#include <sys/types.h>
748#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700749int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Darren Tucker623d92f2004-09-12 22:36:15 +1000750 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100751 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000752 [
753 AC_MSG_RESULT(no)
754 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000755 ],
756 [
757 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
758 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Damien Miller18bb4732001-03-28 14:35:30 +1000759 ]
760)
761
Damien Miller36f49652004-08-15 18:40:59 +1000762AC_MSG_CHECKING([for /proc/pid/fd directory])
763if test -d "/proc/$$/fd" ; then
764 AC_DEFINE(HAVE_PROC_PID)
765 AC_MSG_RESULT(yes)
766else
767 AC_MSG_RESULT(no)
768fi
769
Damien Millerc547bf12001-02-16 10:18:12 +1100770# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100771SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100772AC_ARG_WITH(skey,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100773 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100774 [
775 if test "x$withval" != "xno" ; then
776
777 if test "x$withval" != "xyes" ; then
778 CPPFLAGS="$CPPFLAGS -I${withval}/include"
779 LDFLAGS="$LDFLAGS -L${withval}/lib"
780 fi
781
782 AC_DEFINE(SKEY)
783 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100784 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100785
Tim Rice4cec93f2002-02-26 08:40:48 -0800786 AC_MSG_CHECKING([for s/key support])
787 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100788 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800789#include <stdio.h>
790#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700791int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800792 ],
793 [AC_MSG_RESULT(yes)],
794 [
795 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100796 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
797 ])
Darren Tucker3b908f62004-04-14 15:26:39 +1000798 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
799 AC_TRY_COMPILE(
800 [#include <stdio.h>
801 #include <skey.h>],
802 [(void)skeychallenge(NULL,"name","",0);],
803 [AC_MSG_RESULT(yes)
804 AC_DEFINE(SKEYCHALLENGE_4ARG)],
805 [AC_MSG_RESULT(no)]
806 )
Damien Millerc547bf12001-02-16 10:18:12 +1100807 fi
808 ]
809)
810
811# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700812TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100813AC_ARG_WITH(tcp-wrappers,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100814 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100815 [
816 if test "x$withval" != "xno" ; then
817 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700818 saved_LDFLAGS="$LDFLAGS"
819 saved_CPPFLAGS="$CPPFLAGS"
820 if test -n "${withval}" -a "${withval}" != "yes"; then
821 if test -d "${withval}/lib"; then
822 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700823 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700824 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700825 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700826 fi
827 else
828 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700829 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700830 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700831 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700832 fi
833 fi
834 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700835 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700836 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700837 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700838 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700839 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800840 LIBWRAP="-lwrap"
841 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100842 AC_MSG_CHECKING(for libwrap)
843 AC_TRY_LINK(
844 [
Damien Miller0ac45002004-04-14 20:14:26 +1000845#include <sys/types.h>
846#include <sys/socket.h>
847#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +1100848#include <tcpd.h>
849 int deny_severity = 0, allow_severity = 0;
850 ],
851 [hosts_access(0);],
852 [
853 AC_MSG_RESULT(yes)
854 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800855 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700856 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100857 ],
858 [
859 AC_MSG_ERROR([*** libwrap missing])
860 ]
861 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800862 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100863 fi
864 ]
865)
866
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100867# Check whether user wants libedit support
868LIBEDIT_MSG="no"
869AC_ARG_WITH(libedit,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100870 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100871 [ if test "x$withval" != "xno" ; then
872 AC_CHECK_LIB(edit, el_init,
873 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
874 LIBEDIT="-ledit -lcurses"
875 LIBEDIT_MSG="yes"
876 AC_SUBST(LIBEDIT)
877 ],
878 [], [-lcurses]
879 )
880 fi ]
881)
882
Darren Tuckerd9f88912005-02-20 21:01:48 +1100883AUDIT_MODULE=none
884AC_ARG_WITH(audit,
885 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)],
886 [
887 AC_MSG_CHECKING(for supported audit module)
888 case "$withval" in
889 bsm)
890 AC_MSG_RESULT(bsm)
891 AUDIT_MODULE=bsm
892 dnl Checks for headers, libs and functions
893 AC_CHECK_HEADERS(bsm/audit.h, [],
894 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)])
895 AC_CHECK_LIB(bsm, getaudit, [],
896 [AC_MSG_ERROR(BSM enabled and required library not found)])
897 AC_CHECK_FUNCS(getaudit, [],
898 [AC_MSG_ERROR(BSM enabled and required function not found)])
899 # These are optional
900 AC_CHECK_FUNCS(getaudit_addr gettext)
901 AC_DEFINE(USE_BSM_AUDIT, [], [Use BSM audit module])
902 ;;
903 debug)
904 AUDIT_MODULE=debug
905 AC_MSG_RESULT(debug)
906 AC_DEFINE(SSH_AUDIT_EVENTS, [], Use audit debugging module)
907 ;;
908 *)
909 AC_MSG_ERROR([Unknown audit module $withval])
910 ;;
911 esac ]
912)
913
Damien Millerfe1f1432003-02-24 15:45:42 +1100914dnl Checks for library functions. Please keep in alphabetical order
915AC_CHECK_FUNCS(\
Darren Tucker60bd4092004-06-25 14:03:34 +1000916 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
Darren Tuckerad7646a2005-02-02 10:43:59 +1100917 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
918 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
919 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100920 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000921 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100922 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000923 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100924 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000925 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000926 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100927 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100928)
Tim Rice13aae5e2001-10-21 17:53:58 -0700929
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000930# IRIX has a const char return value for gai_strerror()
931AC_CHECK_FUNCS(gai_strerror,[
932 AC_DEFINE(HAVE_GAI_STRERROR)
933 AC_TRY_COMPILE([
934#include <sys/types.h>
935#include <sys/socket.h>
936#include <netdb.h>
937
938const char *gai_strerror(int);],[
939char *str;
940
941str = gai_strerror(0);],[
942 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
943 [Define if gai_strerror() returns const char *])])])
944
Damien Millercd6853c2003-01-28 11:33:42 +1100945AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
946
Darren Tuckerf1159b52003-07-07 19:44:01 +1000947dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000948AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000949AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000950
Darren Tuckerb2427c82003-09-10 15:22:44 +1000951dnl tcsendbreak might be a macro
952AC_CHECK_DECL(tcsendbreak,
953 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100954 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000955 [#include <termios.h>]
956)
957
Darren Tucker5bb14002004-04-23 18:53:10 +1000958AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
959
Darren Tucker2a6b0292003-12-31 14:59:17 +1100960AC_CHECK_FUNCS(setresuid, [
961 dnl Some platorms have setresuid that isn't implemented, test for this
962 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000963 AC_RUN_IFELSE(
964 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100965#include <stdlib.h>
966#include <errno.h>
967int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000968 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100969 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100970 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000971 AC_MSG_RESULT(not implemented)],
972 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100973 )
974])
Darren Tuckere937be32003-12-17 18:53:26 +1100975
Darren Tucker2a6b0292003-12-31 14:59:17 +1100976AC_CHECK_FUNCS(setresgid, [
977 dnl Some platorms have setresgid that isn't implemented, test for this
978 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000979 AC_RUN_IFELSE(
980 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100981#include <stdlib.h>
982#include <errno.h>
983int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000984 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100985 [AC_MSG_RESULT(yes)],
986 [AC_DEFINE(BROKEN_SETRESGID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000987 AC_MSG_RESULT(not implemented)],
988 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100989 )
990])
Darren Tuckere937be32003-12-17 18:53:26 +1100991
Damien Millerad833b32000-08-23 10:46:23 +1000992dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000993AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000994dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000995AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000996AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000997dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000998AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000999AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +11001000
Damien Millera8e06ce2003-11-21 23:48:55 +11001001AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +11001002 [AC_DEFINE(HAVE_DAEMON)],
1003 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
1004)
1005
Damien Millera8e06ce2003-11-21 23:48:55 +11001006AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +11001007 [AC_DEFINE(HAVE_GETPAGESIZE)],
1008 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
1009)
1010
Damien Millercb170cb2000-07-01 16:52:55 +10001011# Check for broken snprintf
1012if test "x$ac_cv_func_snprintf" = "xyes" ; then
1013 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001014 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001015 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +10001016#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001017int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +10001018 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +11001019 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +10001020 [
1021 AC_MSG_RESULT(no)
1022 AC_DEFINE(BROKEN_SNPRINTF)
1023 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001024 ],
1025 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +10001026 )
1027fi
1028
Damien Millerb4097182004-05-23 14:09:40 +10001029# Check for missing getpeereid (or equiv) support
1030NO_PEERCHECK=""
1031if test "x$ac_cv_func_getpeereid" != "xyes" ; then
1032 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1033 AC_TRY_COMPILE(
1034 [#include <sys/types.h>
1035 #include <sys/socket.h>],
1036 [int i = SO_PEERCRED;],
1037 [AC_MSG_RESULT(yes)],
1038 [AC_MSG_RESULT(no)
1039 NO_PEERCHECK=1]
1040 )
1041fi
1042
Damien Millere8328192003-01-07 15:18:32 +11001043dnl see whether mkstemp() requires XXXXXX
1044if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1045AC_MSG_CHECKING([for (overly) strict mkstemp])
1046AC_TRY_RUN(
1047 [
1048#include <stdlib.h>
1049main() { char template[]="conftest.mkstemp-test";
1050if (mkstemp(template) == -1)
1051 exit(1);
1052unlink(template); exit(0);
1053}
1054 ],
1055 [
1056 AC_MSG_RESULT(no)
1057 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001058 [
Damien Millere8328192003-01-07 15:18:32 +11001059 AC_MSG_RESULT(yes)
1060 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1061 ],
1062 [
1063 AC_MSG_RESULT(yes)
1064 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001065 ]
Damien Millere8328192003-01-07 15:18:32 +11001066)
1067fi
1068
Darren Tucker70a3d552003-08-21 17:58:29 +10001069dnl make sure that openpty does not reacquire controlling terminal
1070if test ! -z "$check_for_openpty_ctty_bug"; then
1071 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1072 AC_TRY_RUN(
1073 [
1074#include <stdio.h>
1075#include <sys/fcntl.h>
1076#include <sys/types.h>
1077#include <sys/wait.h>
1078
1079int
1080main()
1081{
1082 pid_t pid;
1083 int fd, ptyfd, ttyfd, status;
1084
1085 pid = fork();
1086 if (pid < 0) { /* failed */
1087 exit(1);
1088 } else if (pid > 0) { /* parent */
1089 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001090 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001091 exit(WEXITSTATUS(status));
1092 else
1093 exit(2);
1094 } else { /* child */
1095 close(0); close(1); close(2);
1096 setsid();
1097 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1098 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1099 if (fd >= 0)
1100 exit(3); /* Acquired ctty: broken */
1101 else
1102 exit(0); /* Did not acquire ctty: OK */
1103 }
1104}
1105 ],
1106 [
1107 AC_MSG_RESULT(yes)
1108 ],
1109 [
1110 AC_MSG_RESULT(no)
1111 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1112 ]
1113 )
1114fi
1115
Darren Tucker4398cf52004-04-06 21:39:02 +10001116if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1117 AC_MSG_CHECKING(if getaddrinfo seems to work)
1118 AC_TRY_RUN(
1119 [
1120#include <stdio.h>
1121#include <sys/socket.h>
1122#include <netdb.h>
1123#include <errno.h>
1124#include <netinet/in.h>
1125
1126#define TEST_PORT "2222"
1127
1128int
1129main(void)
1130{
1131 int err, sock;
1132 struct addrinfo *gai_ai, *ai, hints;
1133 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1134
1135 memset(&hints, 0, sizeof(hints));
1136 hints.ai_family = PF_UNSPEC;
1137 hints.ai_socktype = SOCK_STREAM;
1138 hints.ai_flags = AI_PASSIVE;
1139
1140 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1141 if (err != 0) {
1142 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1143 exit(1);
1144 }
1145
1146 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1147 if (ai->ai_family != AF_INET6)
1148 continue;
1149
1150 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1151 sizeof(ntop), strport, sizeof(strport),
1152 NI_NUMERICHOST|NI_NUMERICSERV);
1153
1154 if (err != 0) {
1155 if (err == EAI_SYSTEM)
1156 perror("getnameinfo EAI_SYSTEM");
1157 else
1158 fprintf(stderr, "getnameinfo failed: %s\n",
1159 gai_strerror(err));
1160 exit(2);
1161 }
1162
1163 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1164 if (sock < 0)
1165 perror("socket");
1166 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1167 if (errno == EBADF)
1168 exit(3);
1169 }
1170 }
1171 exit(0);
1172}
1173 ],
1174 [
1175 AC_MSG_RESULT(yes)
1176 ],
1177 [
1178 AC_MSG_RESULT(no)
1179 AC_DEFINE(BROKEN_GETADDRINFO)
1180 ]
1181 )
1182fi
1183
Darren Tucker691d5232005-02-15 21:45:57 +11001184if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1185 AC_MSG_CHECKING(if getaddrinfo seems to work)
1186 AC_TRY_RUN(
1187 [
1188#include <stdio.h>
1189#include <sys/socket.h>
1190#include <netdb.h>
1191#include <errno.h>
1192#include <netinet/in.h>
1193
1194#define TEST_PORT "2222"
1195
1196int
1197main(void)
1198{
1199 int err, sock;
1200 struct addrinfo *gai_ai, *ai, hints;
1201 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1202
1203 memset(&hints, 0, sizeof(hints));
1204 hints.ai_family = PF_UNSPEC;
1205 hints.ai_socktype = SOCK_STREAM;
1206 hints.ai_flags = AI_PASSIVE;
1207
1208 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1209 if (err != 0) {
1210 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1211 exit(1);
1212 }
1213
1214 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1215 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1216 continue;
1217
1218 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1219 sizeof(ntop), strport, sizeof(strport),
1220 NI_NUMERICHOST|NI_NUMERICSERV);
1221
1222 if (ai->ai_family == AF_INET && err != 0) {
1223 perror("getnameinfo");
1224 exit(2);
1225 }
1226 }
1227 exit(0);
1228}
1229 ],
1230 [
1231 AC_MSG_RESULT(yes)
1232 AC_DEFINE(AIX_GETNAMEINFO_HACK, [],
1233[Define if you have a getaddrinfo that fails for the all-zeros IPv6 address])
1234 ],
1235 [
1236 AC_MSG_RESULT(no)
1237 AC_DEFINE(BROKEN_GETADDRINFO)
1238 ]
1239 )
1240fi
1241
Darren Tuckera56f1912004-11-02 20:30:54 +11001242if test "x$check_for_conflicting_getspnam" = "x1"; then
1243 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1244 AC_COMPILE_IFELSE(
1245 [
1246#include <shadow.h>
1247int main(void) {exit(0);}
1248 ],
1249 [
1250 AC_MSG_RESULT(no)
1251 ],
1252 [
1253 AC_MSG_RESULT(yes)
1254 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1255 [Conflicting defs for getspnam])
1256 ]
1257 )
1258fi
1259
Damien Miller606f8802000-09-16 15:39:56 +11001260AC_FUNC_GETPGRP
1261
Damien Millera64b57a2001-01-17 10:44:13 +11001262# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001263PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001264AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001265 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001266 [
Damien Millera64b57a2001-01-17 10:44:13 +11001267 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001268 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1269 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001270 AC_MSG_ERROR([PAM headers not found])
1271 fi
1272
1273 AC_CHECK_LIB(dl, dlopen, , )
1274 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1275 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001276 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001277
Damien Millera64b57a2001-01-17 10:44:13 +11001278 PAM_MSG="yes"
1279
1280 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001281 if test $ac_cv_lib_dl_dlopen = yes; then
1282 LIBPAM="-lpam -ldl"
1283 else
1284 LIBPAM="-lpam"
1285 fi
1286 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001287 fi
1288 ]
1289)
Damien Millera22ba012000-03-02 23:09:20 +11001290
Damien Millera64b57a2001-01-17 10:44:13 +11001291# Check for older PAM
1292if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001293 # Check PAM strerror arguments (old PAM)
1294 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1295 AC_TRY_COMPILE(
1296 [
Damien Miller81171112000-04-23 11:14:01 +10001297#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001298#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001299#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001300#elif defined (HAVE_PAM_PAM_APPL_H)
1301#include <pam/pam_appl.h>
1302#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001303 ],
1304 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001305 [AC_MSG_RESULT(no)],
1306 [
1307 AC_DEFINE(HAVE_OLD_PAM)
1308 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001309 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001310 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001311 )
Damien Millera22ba012000-03-02 23:09:20 +11001312fi
1313
Tim Riceaef73712002-05-11 13:17:42 -07001314# Search for OpenSSL
1315saved_CPPFLAGS="$CPPFLAGS"
1316saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001317AC_ARG_WITH(ssl-dir,
1318 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1319 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001320 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001321 case "$withval" in
1322 # Relative paths
1323 ./*|../*) withval="`pwd`/$withval"
1324 esac
Tim Riceaef73712002-05-11 13:17:42 -07001325 if test -d "$withval/lib"; then
1326 if test -n "${need_dash_r}"; then
1327 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1328 else
1329 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1330 fi
1331 else
1332 if test -n "${need_dash_r}"; then
1333 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1334 else
1335 LDFLAGS="-L${withval} ${LDFLAGS}"
1336 fi
1337 fi
1338 if test -d "$withval/include"; then
1339 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1340 else
1341 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1342 fi
Damien Millera22ba012000-03-02 23:09:20 +11001343 fi
1344 ]
1345)
Tim Rice3d5352e2004-02-12 09:27:21 -08001346LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001347AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001348 [
Tim Riceaef73712002-05-11 13:17:42 -07001349 dnl Check default openssl install dir
1350 if test -n "${need_dash_r}"; then
1351 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001352 else
Tim Riceaef73712002-05-11 13:17:42 -07001353 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001354 fi
Tim Riceaef73712002-05-11 13:17:42 -07001355 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1356 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1357 [
1358 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1359 ]
1360 )
1361 ]
1362)
1363
Tim Riced730b782002-08-13 18:52:10 -07001364# Determine OpenSSL header version
1365AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001366AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001367 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001368#include <stdio.h>
1369#include <string.h>
1370#include <openssl/opensslv.h>
1371#define DATA "conftest.sslincver"
1372int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001373 FILE *fd;
1374 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001375
Damien Millera8e06ce2003-11-21 23:48:55 +11001376 fd = fopen(DATA,"w");
1377 if(fd == NULL)
1378 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001379
1380 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1381 exit(1);
1382
1383 exit(0);
1384}
Darren Tucker623d92f2004-09-12 22:36:15 +10001385 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001386 [
1387 ssl_header_ver=`cat conftest.sslincver`
1388 AC_MSG_RESULT($ssl_header_ver)
1389 ],
1390 [
1391 AC_MSG_RESULT(not found)
1392 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001393 ],
1394 [
1395 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001396 ]
1397)
1398
1399# Determine OpenSSL library version
1400AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001401AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001402 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001403#include <stdio.h>
1404#include <string.h>
1405#include <openssl/opensslv.h>
1406#include <openssl/crypto.h>
1407#define DATA "conftest.ssllibver"
1408int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001409 FILE *fd;
1410 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001411
Damien Millera8e06ce2003-11-21 23:48:55 +11001412 fd = fopen(DATA,"w");
1413 if(fd == NULL)
1414 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001415
1416 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1417 exit(1);
1418
1419 exit(0);
1420}
Darren Tucker623d92f2004-09-12 22:36:15 +10001421 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001422 [
1423 ssl_library_ver=`cat conftest.ssllibver`
1424 AC_MSG_RESULT($ssl_library_ver)
1425 ],
1426 [
1427 AC_MSG_RESULT(not found)
1428 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001429 ],
1430 [
1431 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001432 ]
1433)
Damien Millera22ba012000-03-02 23:09:20 +11001434
Damien Millerec932372002-01-22 22:16:03 +11001435# Sanity check OpenSSL headers
1436AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001437AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001438 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001439#include <string.h>
1440#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001441int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001442 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001443 [
1444 AC_MSG_RESULT(yes)
1445 ],
1446 [
1447 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001448 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1449Check config.log for details.
1450Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001451 ],
1452 [
1453 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001454 ]
1455)
1456
Tim Rice3d5352e2004-02-12 09:27:21 -08001457# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1458# because the system crypt() is more featureful.
1459if test "x$check_for_libcrypt_before" = "x1"; then
1460 AC_CHECK_LIB(crypt, crypt)
1461fi
1462
Damien Millera8e06ce2003-11-21 23:48:55 +11001463# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001464# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001465if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001466 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001467fi
1468
Damien Miller6c21c512002-01-22 21:57:53 +11001469
1470### Configure cryptographic random number support
1471
1472# Check wheter OpenSSL seeds itself
1473AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001474AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001475 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001476#include <string.h>
1477#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001478int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001479 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001480 [
1481 OPENSSL_SEEDS_ITSELF=yes
1482 AC_MSG_RESULT(yes)
1483 ],
1484 [
1485 AC_MSG_RESULT(no)
1486 # Default to use of the rand helper if OpenSSL doesn't
1487 # seed itself
1488 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001489 ],
1490 [
1491 AC_MSG_WARN([cross compiling: assuming yes])
1492 # This is safe, since all recent OpenSSL versions will
1493 # complain at runtime if not seeded correctly.
1494 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001495 ]
1496)
1497
1498
1499# Do we want to force the use of the rand helper?
1500AC_ARG_WITH(rand-helper,
1501 [ --with-rand-helper Use subprocess to gather strong randomness ],
1502 [
1503 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001504 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001505 # the previous test showed it to be unseeded.
1506 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1507 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1508 OPENSSL_SEEDS_ITSELF=yes
1509 USE_RAND_HELPER=""
1510 fi
1511 else
1512 USE_RAND_HELPER=yes
1513 fi
1514 ],
1515)
1516
1517# Which randomness source do we use?
1518if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1519 # OpenSSL only
1520 AC_DEFINE(OPENSSL_PRNG_ONLY)
1521 RAND_MSG="OpenSSL internal ONLY"
1522 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001523elif test ! -z "$USE_RAND_HELPER" ; then
1524 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001525 RAND_MSG="ssh-rand-helper"
1526 INSTALL_SSH_RAND_HELPER="yes"
1527fi
1528AC_SUBST(INSTALL_SSH_RAND_HELPER)
1529
1530### Configuration of ssh-rand-helper
1531
1532# PRNGD TCP socket
1533AC_ARG_WITH(prngd-port,
1534 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1535 [
Damien Millere996d722002-01-23 11:20:59 +11001536 case "$withval" in
1537 no)
1538 withval=""
1539 ;;
1540 [[0-9]]*)
1541 ;;
1542 *)
1543 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1544 ;;
1545 esac
1546 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001547 PRNGD_PORT="$withval"
1548 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1549 fi
1550 ]
1551)
1552
1553# PRNGD Unix domain socket
1554AC_ARG_WITH(prngd-socket,
1555 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1556 [
Damien Millere996d722002-01-23 11:20:59 +11001557 case "$withval" in
1558 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001559 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001560 ;;
1561 no)
1562 withval=""
1563 ;;
1564 /*)
1565 ;;
1566 *)
1567 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1568 ;;
1569 esac
1570
1571 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001572 if test ! -z "$PRNGD_PORT" ; then
1573 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1574 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001575 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001576 AC_MSG_WARN(Entropy socket is not readable)
1577 fi
1578 PRNGD_SOCKET="$withval"
1579 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1580 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001581 ],
1582 [
1583 # Check for existing socket only if we don't have a random device already
1584 if test "$USE_RAND_HELPER" = yes ; then
1585 AC_MSG_CHECKING(for PRNGD/EGD socket)
1586 # Insert other locations here
1587 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1588 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1589 PRNGD_SOCKET="$sock"
1590 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1591 break;
1592 fi
1593 done
1594 if test ! -z "$PRNGD_SOCKET" ; then
1595 AC_MSG_RESULT($PRNGD_SOCKET)
1596 else
1597 AC_MSG_RESULT(not found)
1598 fi
1599 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001600 ]
1601)
1602
1603# Change default command timeout for hashing entropy source
1604entropy_timeout=200
1605AC_ARG_WITH(entropy-timeout,
1606 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1607 [
1608 if test "x$withval" != "xno" ; then
1609 entropy_timeout=$withval
1610 fi
1611 ]
1612)
Damien Miller6c21c512002-01-22 21:57:53 +11001613AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1614
Damien Millerd3f6ad22002-06-25 10:24:47 +10001615SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001616AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001617 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001618 [
1619 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001620 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001621 fi
1622 ]
1623)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001624AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1625AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001626
Tim Rice88f2ab52002-03-17 12:17:34 -08001627# We do this little dance with the search path to insure
1628# that programs that we select for use by installed programs
1629# (which may be run by the super-user) come from trusted
1630# locations before they come from the user's private area.
1631# This should help avoid accidentally configuring some
1632# random version of a program in someone's personal bin.
1633
1634OPATH=$PATH
1635PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001636test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001637test -d /sbin && PATH=$PATH:/sbin
1638test -d /usr/sbin && PATH=$PATH:/usr/sbin
1639PATH=$PATH:/etc:$OPATH
1640
Damien Millera8e06ce2003-11-21 23:48:55 +11001641# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001642OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1643OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1644OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1645OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1646OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1647OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1648OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1649OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1650OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1651OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1652OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1653OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1654OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1655OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1656OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1657OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001658# restore PATH
1659PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001660
1661# Where does ssh-rand-helper get its randomness from?
1662INSTALL_SSH_PRNG_CMDS=""
1663if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1664 if test ! -z "$PRNGD_PORT" ; then
1665 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1666 elif test ! -z "$PRNGD_SOCKET" ; then
1667 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1668 else
1669 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1670 RAND_HELPER_CMDHASH=yes
1671 INSTALL_SSH_PRNG_CMDS="yes"
1672 fi
1673fi
1674AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1675
1676
Ben Lindstromb5628642000-10-18 00:02:25 +00001677# Cheap hack to ensure NEWS-OS libraries are arranged right.
1678if test ! -z "$SONY" ; then
1679 LIBS="$LIBS -liberty";
1680fi
1681
Damien Millera22ba012000-03-02 23:09:20 +11001682# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001683AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001684AC_CHECK_SIZEOF(short int, 2)
1685AC_CHECK_SIZEOF(int, 4)
1686AC_CHECK_SIZEOF(long int, 4)
1687AC_CHECK_SIZEOF(long long int, 8)
1688
Damien Millerfa2bb692002-04-23 23:22:25 +10001689# Sanity check long long for some platforms (AIX)
1690if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1691 ac_cv_sizeof_long_long_int=0
1692fi
1693
Damien Millera22ba012000-03-02 23:09:20 +11001694# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001695AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1696 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001697 [ #include <sys/types.h> ],
1698 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001699 [ ac_cv_have_u_int="yes" ],
1700 [ ac_cv_have_u_int="no" ]
1701 )
1702])
1703if test "x$ac_cv_have_u_int" = "xyes" ; then
1704 AC_DEFINE(HAVE_U_INT)
1705 have_u_int=1
1706fi
1707
Damien Miller61e50f12000-05-08 20:49:37 +10001708AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1709 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001710 [ #include <sys/types.h> ],
1711 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001712 [ ac_cv_have_intxx_t="yes" ],
1713 [ ac_cv_have_intxx_t="no" ]
1714 )
1715])
1716if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1717 AC_DEFINE(HAVE_INTXX_T)
1718 have_intxx_t=1
1719fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001720
1721if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001722 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001723then
1724 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1725 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001726 [ #include <stdint.h> ],
1727 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001728 [
1729 AC_DEFINE(HAVE_INTXX_T)
1730 AC_MSG_RESULT(yes)
1731 ],
1732 [ AC_MSG_RESULT(no) ]
1733 )
1734fi
1735
Damien Miller578783e2000-09-23 14:12:24 +11001736AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1737 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001738 [
1739#include <sys/types.h>
1740#ifdef HAVE_STDINT_H
1741# include <stdint.h>
1742#endif
1743#include <sys/socket.h>
1744#ifdef HAVE_SYS_BITYPES_H
1745# include <sys/bitypes.h>
1746#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001747 ],
1748 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001749 [ ac_cv_have_int64_t="yes" ],
1750 [ ac_cv_have_int64_t="no" ]
1751 )
1752])
1753if test "x$ac_cv_have_int64_t" = "xyes" ; then
1754 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001755fi
1756
Damien Miller61e50f12000-05-08 20:49:37 +10001757AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1758 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001759 [ #include <sys/types.h> ],
1760 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001761 [ ac_cv_have_u_intxx_t="yes" ],
1762 [ ac_cv_have_u_intxx_t="no" ]
1763 )
1764])
1765if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1766 AC_DEFINE(HAVE_U_INTXX_T)
1767 have_u_intxx_t=1
1768fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001769
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001770if test -z "$have_u_intxx_t" ; then
1771 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1772 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001773 [ #include <sys/socket.h> ],
1774 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001775 [
1776 AC_DEFINE(HAVE_U_INTXX_T)
1777 AC_MSG_RESULT(yes)
1778 ],
1779 [ AC_MSG_RESULT(no) ]
1780 )
1781fi
1782
Damien Miller578783e2000-09-23 14:12:24 +11001783AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1784 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001785 [ #include <sys/types.h> ],
1786 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001787 [ ac_cv_have_u_int64_t="yes" ],
1788 [ ac_cv_have_u_int64_t="no" ]
1789 )
1790])
1791if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1792 AC_DEFINE(HAVE_U_INT64_T)
1793 have_u_int64_t=1
1794fi
1795
Tim Rice4cec93f2002-02-26 08:40:48 -08001796if test -z "$have_u_int64_t" ; then
1797 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1798 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001799 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001800 [ u_int64_t a; a = 1],
1801 [
1802 AC_DEFINE(HAVE_U_INT64_T)
1803 AC_MSG_RESULT(yes)
1804 ],
1805 [ AC_MSG_RESULT(no) ]
1806 )
1807fi
1808
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001809if test -z "$have_u_intxx_t" ; then
1810 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1811 AC_TRY_COMPILE(
1812 [
1813#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001814 ],
1815 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001816 [ ac_cv_have_uintxx_t="yes" ],
1817 [ ac_cv_have_uintxx_t="no" ]
1818 )
1819 ])
1820 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1821 AC_DEFINE(HAVE_UINTXX_T)
1822 fi
1823fi
1824
1825if test -z "$have_uintxx_t" ; then
1826 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1827 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001828 [ #include <stdint.h> ],
1829 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001830 [
1831 AC_DEFINE(HAVE_UINTXX_T)
1832 AC_MSG_RESULT(yes)
1833 ],
1834 [ AC_MSG_RESULT(no) ]
1835 )
1836fi
1837
Damien Milleredb82922000-06-20 13:25:52 +10001838if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001839 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001840then
1841 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1842 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001843 [
1844#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001845 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001846 [
Damien Miller70494d12000-04-03 15:57:06 +10001847 int8_t a; int16_t b; int32_t c;
1848 u_int8_t e; u_int16_t f; u_int32_t g;
1849 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001850 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001851 [
1852 AC_DEFINE(HAVE_U_INTXX_T)
1853 AC_DEFINE(HAVE_INTXX_T)
1854 AC_MSG_RESULT(yes)
1855 ],
1856 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001857 )
Damien Millerb29ea912000-01-15 14:12:03 +11001858fi
1859
Damien Miller58be7382001-09-15 21:31:54 +10001860
1861AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1862 AC_TRY_COMPILE(
1863 [
1864#include <sys/types.h>
1865 ],
1866 [ u_char foo; foo = 125; ],
1867 [ ac_cv_have_u_char="yes" ],
1868 [ ac_cv_have_u_char="no" ]
1869 )
1870])
1871if test "x$ac_cv_have_u_char" = "xyes" ; then
1872 AC_DEFINE(HAVE_U_CHAR)
1873fi
1874
Tim Rice13aae5e2001-10-21 17:53:58 -07001875TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001876
Tim Rice200a5c02002-02-26 22:12:34 -08001877AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001878
Damien Miller848b9932005-02-24 12:12:34 +11001879AC_CHECK_TYPES(in_addr_t,,,
1880[#include <sys/types.h>
1881#include <netinet/in.h>])
Darren Tuckerd9f88912005-02-20 21:01:48 +11001882
Damien Miller61e50f12000-05-08 20:49:37 +10001883AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1884 AC_TRY_COMPILE(
1885 [
1886#include <sys/types.h>
1887 ],
1888 [ size_t foo; foo = 1235; ],
1889 [ ac_cv_have_size_t="yes" ],
1890 [ ac_cv_have_size_t="no" ]
1891 )
1892])
1893if test "x$ac_cv_have_size_t" = "xyes" ; then
1894 AC_DEFINE(HAVE_SIZE_T)
1895fi
Damien Miller95058511999-12-29 10:36:45 +11001896
Damien Miller615f9392000-05-17 22:53:33 +10001897AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1898 AC_TRY_COMPILE(
1899 [
1900#include <sys/types.h>
1901 ],
1902 [ ssize_t foo; foo = 1235; ],
1903 [ ac_cv_have_ssize_t="yes" ],
1904 [ ac_cv_have_ssize_t="no" ]
1905 )
1906])
1907if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1908 AC_DEFINE(HAVE_SSIZE_T)
1909fi
1910
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001911AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1912 AC_TRY_COMPILE(
1913 [
1914#include <time.h>
1915 ],
1916 [ clock_t foo; foo = 1235; ],
1917 [ ac_cv_have_clock_t="yes" ],
1918 [ ac_cv_have_clock_t="no" ]
1919 )
1920])
1921if test "x$ac_cv_have_clock_t" = "xyes" ; then
1922 AC_DEFINE(HAVE_CLOCK_T)
1923fi
1924
Damien Millerb54b40e2000-06-23 08:23:34 +10001925AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1926 AC_TRY_COMPILE(
1927 [
1928#include <sys/types.h>
1929#include <sys/socket.h>
1930 ],
1931 [ sa_family_t foo; foo = 1235; ],
1932 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001933 [ AC_TRY_COMPILE(
1934 [
1935#include <sys/types.h>
1936#include <sys/socket.h>
1937#include <netinet/in.h>
1938 ],
1939 [ sa_family_t foo; foo = 1235; ],
1940 [ ac_cv_have_sa_family_t="yes" ],
1941
Damien Millerb54b40e2000-06-23 08:23:34 +10001942 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001943 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001944 )
1945])
1946if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1947 AC_DEFINE(HAVE_SA_FAMILY_T)
1948fi
1949
Damien Miller0f91b4e2000-06-18 15:43:25 +10001950AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1951 AC_TRY_COMPILE(
1952 [
1953#include <sys/types.h>
1954 ],
1955 [ pid_t foo; foo = 1235; ],
1956 [ ac_cv_have_pid_t="yes" ],
1957 [ ac_cv_have_pid_t="no" ]
1958 )
1959])
1960if test "x$ac_cv_have_pid_t" = "xyes" ; then
1961 AC_DEFINE(HAVE_PID_T)
1962fi
1963
1964AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1965 AC_TRY_COMPILE(
1966 [
1967#include <sys/types.h>
1968 ],
1969 [ mode_t foo; foo = 1235; ],
1970 [ ac_cv_have_mode_t="yes" ],
1971 [ ac_cv_have_mode_t="no" ]
1972 )
1973])
1974if test "x$ac_cv_have_mode_t" = "xyes" ; then
1975 AC_DEFINE(HAVE_MODE_T)
1976fi
1977
Damien Miller61e50f12000-05-08 20:49:37 +10001978
1979AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1980 AC_TRY_COMPILE(
1981 [
Damien Miller81171112000-04-23 11:14:01 +10001982#include <sys/types.h>
1983#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001984 ],
1985 [ struct sockaddr_storage s; ],
1986 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1987 [ ac_cv_have_struct_sockaddr_storage="no" ]
1988 )
1989])
1990if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1991 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1992fi
Damien Miller34132e52000-01-14 15:45:46 +11001993
Damien Miller61e50f12000-05-08 20:49:37 +10001994AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1995 AC_TRY_COMPILE(
1996 [
Damien Miller7b22d652000-06-18 14:07:04 +10001997#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001998#include <netinet/in.h>
1999 ],
2000 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
2001 [ ac_cv_have_struct_sockaddr_in6="yes" ],
2002 [ ac_cv_have_struct_sockaddr_in6="no" ]
2003 )
2004])
2005if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
2006 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
2007fi
Damien Miller34132e52000-01-14 15:45:46 +11002008
Damien Miller61e50f12000-05-08 20:49:37 +10002009AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
2010 AC_TRY_COMPILE(
2011 [
Damien Miller7b22d652000-06-18 14:07:04 +10002012#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002013#include <netinet/in.h>
2014 ],
2015 [ struct in6_addr s; s.s6_addr[0] = 0; ],
2016 [ ac_cv_have_struct_in6_addr="yes" ],
2017 [ ac_cv_have_struct_in6_addr="no" ]
2018 )
2019])
2020if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
2021 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
2022fi
Damien Miller34132e52000-01-14 15:45:46 +11002023
Damien Miller61e50f12000-05-08 20:49:37 +10002024AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2025 AC_TRY_COMPILE(
2026 [
Damien Miller81171112000-04-23 11:14:01 +10002027#include <sys/types.h>
2028#include <sys/socket.h>
2029#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002030 ],
2031 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
2032 [ ac_cv_have_struct_addrinfo="yes" ],
2033 [ ac_cv_have_struct_addrinfo="no" ]
2034 )
2035])
2036if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
2037 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
2038fi
2039
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002040AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2041 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002042 [ #include <sys/time.h> ],
2043 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002044 [ ac_cv_have_struct_timeval="yes" ],
2045 [ ac_cv_have_struct_timeval="no" ]
2046 )
2047])
2048if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
2049 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
2050 have_struct_timeval=1
2051fi
2052
Tim Rice4e4dc562003-03-18 10:21:40 -08002053AC_CHECK_TYPES(struct timespec)
2054
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002055# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002056if test "x$ac_cv_have_int64_t" = "xno" -a \
2057 "x$ac_cv_sizeof_long_int" != "x8" -a \
2058 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002059 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2060 echo "an alternative compiler (I.E., GCC) before continuing."
2061 echo ""
2062 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08002063else
2064dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10002065 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10002066 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08002067#include <stdio.h>
2068#include <string.h>
2069#ifdef HAVE_SNPRINTF
2070main()
2071{
2072 char buf[50];
2073 char expected_out[50];
2074 int mazsize = 50 ;
2075#if (SIZEOF_LONG_INT == 8)
2076 long int num = 0x7fffffffffffffff;
2077#else
Kevin Steves6482ec82001-07-15 02:09:28 +00002078 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08002079#endif
2080 strcpy(expected_out, "9223372036854775807");
2081 snprintf(buf, mazsize, "%lld", num);
2082 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11002083 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08002084 exit(0);
2085}
2086#else
2087main() { exit(0); }
2088#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10002089 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10002090 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08002091 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002092fi
2093
Damien Miller78315eb2000-09-29 23:01:36 +11002094dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10002095OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2096OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2097OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2098OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2099OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002100OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002101OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2102OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002103OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002104OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2105OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2106OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2107OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002108OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2109OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2110OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2111OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002112
2113AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00002114
Damien Miller61e50f12000-05-08 20:49:37 +10002115AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2116 ac_cv_have_ss_family_in_struct_ss, [
2117 AC_TRY_COMPILE(
2118 [
Damien Miller81171112000-04-23 11:14:01 +10002119#include <sys/types.h>
2120#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002121 ],
2122 [ struct sockaddr_storage s; s.ss_family = 1; ],
2123 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2124 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2125 )
2126])
2127if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2128 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
2129fi
2130
Damien Miller61e50f12000-05-08 20:49:37 +10002131AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2132 ac_cv_have___ss_family_in_struct_ss, [
2133 AC_TRY_COMPILE(
2134 [
Damien Miller81171112000-04-23 11:14:01 +10002135#include <sys/types.h>
2136#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002137 ],
2138 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2139 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2140 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2141 )
2142])
2143if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2144 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
2145fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002146
Damien Millerad833b32000-08-23 10:46:23 +10002147AC_CACHE_CHECK([for pw_class field in struct passwd],
2148 ac_cv_have_pw_class_in_struct_passwd, [
2149 AC_TRY_COMPILE(
2150 [
Damien Millerad833b32000-08-23 10:46:23 +10002151#include <pwd.h>
2152 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002153 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002154 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2155 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2156 )
2157])
2158if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2159 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
2160fi
2161
Kevin Steves82456952001-06-22 21:14:18 +00002162AC_CACHE_CHECK([for pw_expire field in struct passwd],
2163 ac_cv_have_pw_expire_in_struct_passwd, [
2164 AC_TRY_COMPILE(
2165 [
2166#include <pwd.h>
2167 ],
2168 [ struct passwd p; p.pw_expire = 0; ],
2169 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2170 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2171 )
2172])
2173if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2174 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
2175fi
2176
2177AC_CACHE_CHECK([for pw_change field in struct passwd],
2178 ac_cv_have_pw_change_in_struct_passwd, [
2179 AC_TRY_COMPILE(
2180 [
2181#include <pwd.h>
2182 ],
2183 [ struct passwd p; p.pw_change = 0; ],
2184 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2185 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2186 )
2187])
2188if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2189 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
2190fi
Damien Miller61e50f12000-05-08 20:49:37 +10002191
Tim Rice28bbb0c2002-05-27 17:37:32 -07002192dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002193AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2194 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002195 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002196 [
Tim Riceae49fe62002-04-12 10:26:21 -07002197#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002198#include <sys/socket.h>
2199#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002200int main() {
2201#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002202#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002203exit(1);
2204#endif
2205struct msghdr m;
2206m.msg_accrights = 0;
2207exit(0);
2208}
Kevin Steves939c9db2002-03-22 17:23:25 +00002209 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002210 [ ac_cv_have_accrights_in_msghdr="yes" ],
2211 [ ac_cv_have_accrights_in_msghdr="no" ]
2212 )
2213])
2214if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2215 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2216fi
2217
Kevin Stevesa44e0352002-04-07 16:18:03 +00002218AC_CACHE_CHECK([for msg_control field in struct msghdr],
2219 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002220 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002221 [
Tim Riceae49fe62002-04-12 10:26:21 -07002222#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002223#include <sys/socket.h>
2224#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002225int main() {
2226#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002227#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002228exit(1);
2229#endif
2230struct msghdr m;
2231m.msg_control = 0;
2232exit(0);
2233}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002234 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002235 [ ac_cv_have_control_in_msghdr="yes" ],
2236 [ ac_cv_have_control_in_msghdr="no" ]
2237 )
2238])
2239if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2240 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2241fi
2242
Damien Miller61e50f12000-05-08 20:49:37 +10002243AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002244 AC_TRY_LINK([],
2245 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002246 [ ac_cv_libc_defines___progname="yes" ],
2247 [ ac_cv_libc_defines___progname="no" ]
2248 )
2249])
2250if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2251 AC_DEFINE(HAVE___PROGNAME)
2252fi
2253
Kevin Steves4846f4a2002-03-22 18:19:53 +00002254AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2255 AC_TRY_LINK([
2256#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002257],
2258 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002259 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2260 [ ac_cv_cc_implements___FUNCTION__="no" ]
2261 )
2262])
2263if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2264 AC_DEFINE(HAVE___FUNCTION__)
2265fi
2266
2267AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2268 AC_TRY_LINK([
2269#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002270],
2271 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002272 [ ac_cv_cc_implements___func__="yes" ],
2273 [ ac_cv_cc_implements___func__="no" ]
2274 )
2275])
2276if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2277 AC_DEFINE(HAVE___func__)
2278fi
2279
Damien Miller4f8e6692001-07-14 13:22:53 +10002280AC_CACHE_CHECK([whether getopt has optreset support],
2281 ac_cv_have_getopt_optreset, [
2282 AC_TRY_LINK(
2283 [
2284#include <getopt.h>
2285 ],
2286 [ extern int optreset; optreset = 0; ],
2287 [ ac_cv_have_getopt_optreset="yes" ],
2288 [ ac_cv_have_getopt_optreset="no" ]
2289 )
2290])
2291if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2292 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2293fi
Damien Millera22ba012000-03-02 23:09:20 +11002294
Damien Millerecbb26d2000-07-15 14:59:14 +10002295AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002296 AC_TRY_LINK([],
2297 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002298 [ ac_cv_libc_defines_sys_errlist="yes" ],
2299 [ ac_cv_libc_defines_sys_errlist="no" ]
2300 )
2301])
2302if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2303 AC_DEFINE(HAVE_SYS_ERRLIST)
2304fi
2305
2306
Damien Miller11fa2cc2000-08-16 10:35:58 +10002307AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002308 AC_TRY_LINK([],
2309 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002310 [ ac_cv_libc_defines_sys_nerr="yes" ],
2311 [ ac_cv_libc_defines_sys_nerr="no" ]
2312 )
2313])
2314if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2315 AC_DEFINE(HAVE_SYS_NERR)
2316fi
2317
Damien Millera8e06ce2003-11-21 23:48:55 +11002318SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002319# Check whether user wants sectok support
2320AC_ARG_WITH(sectok,
2321 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002322 [
2323 if test "x$withval" != "xno" ; then
2324 if test "x$withval" != "xyes" ; then
2325 CPPFLAGS="$CPPFLAGS -I${withval}"
2326 LDFLAGS="$LDFLAGS -L${withval}"
2327 if test ! -z "$need_dash_r" ; then
2328 LDFLAGS="$LDFLAGS -R${withval}"
2329 fi
2330 if test ! -z "$blibpath" ; then
2331 blibpath="$blibpath:${withval}"
2332 fi
2333 fi
2334 AC_CHECK_HEADERS(sectok.h)
2335 if test "$ac_cv_header_sectok_h" != yes; then
2336 AC_MSG_ERROR(Can't find sectok.h)
2337 fi
2338 AC_CHECK_LIB(sectok, sectok_open)
2339 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2340 AC_MSG_ERROR(Can't find libsectok)
2341 fi
2342 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002343 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002344 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002345 fi
2346 ]
2347)
2348
2349# Check whether user wants OpenSC support
2350AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002351 AC_HELP_STRING([--with-opensc=PFX],
2352 [Enable smartcard support using OpenSC]),
2353 opensc_config_prefix="$withval", opensc_config_prefix="")
2354if test x$opensc_config_prefix != x ; then
2355 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2356 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2357 if test "$OPENSC_CONFIG" != "no"; then
2358 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2359 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2360 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2361 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2362 AC_DEFINE(SMARTCARD)
2363 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002364 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002365 fi
2366fi
Damien Miller85de5802001-09-18 14:01:11 +10002367
Darren Tucker5f88d342003-10-15 16:57:57 +10002368# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002369AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002370 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002371 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002372 # Needed by our getrrsetbyname()
2373 AC_SEARCH_LIBS(res_query, resolv)
2374 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002375 AC_MSG_CHECKING(if res_query will link)
2376 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2377 [AC_MSG_RESULT(no)
2378 saved_LIBS="$LIBS"
2379 LIBS="$LIBS -lresolv"
2380 AC_MSG_CHECKING(for res_query in -lresolv)
2381 AC_LINK_IFELSE([
2382#include <resolv.h>
2383int main()
2384{
2385 res_query (0, 0, 0, 0, 0);
2386 return 0;
2387}
2388 ],
2389 [LIBS="$LIBS -lresolv"
2390 AC_MSG_RESULT(yes)],
2391 [LIBS="$saved_LIBS"
2392 AC_MSG_RESULT(no)])
2393 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002394 AC_CHECK_FUNCS(_getshort _getlong)
2395 AC_CHECK_MEMBER(HEADER.ad,
2396 [AC_DEFINE(HAVE_HEADER_AD)],,
2397 [#include <arpa/nameser.h>])
2398 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002399
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002400# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002401KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002402AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002403 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002404 [ if test "x$withval" != "xno" ; then
2405 if test "x$withval" = "xyes" ; then
2406 KRB5ROOT="/usr/local"
2407 else
2408 KRB5ROOT=${withval}
2409 fi
2410
2411 AC_DEFINE(KRB5)
2412 KRB5_MSG="yes"
2413
2414 AC_MSG_CHECKING(for krb5-config)
2415 if test -x $KRB5ROOT/bin/krb5-config ; then
2416 KRB5CONF=$KRB5ROOT/bin/krb5-config
2417 AC_MSG_RESULT($KRB5CONF)
2418
2419 AC_MSG_CHECKING(for gssapi support)
2420 if $KRB5CONF | grep gssapi >/dev/null ; then
2421 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002422 AC_DEFINE(GSSAPI)
2423 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002424 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002425 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002426 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002427 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002428 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2429 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002430 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002431 AC_MSG_CHECKING(whether we are using Heimdal)
2432 AC_TRY_COMPILE([ #include <krb5.h> ],
2433 [ char *tmp = heimdal_version; ],
2434 [ AC_MSG_RESULT(yes)
2435 AC_DEFINE(HEIMDAL) ],
2436 AC_MSG_RESULT(no)
2437 )
2438 else
2439 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002440 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002441 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002442 AC_MSG_CHECKING(whether we are using Heimdal)
2443 AC_TRY_COMPILE([ #include <krb5.h> ],
2444 [ char *tmp = heimdal_version; ],
2445 [ AC_MSG_RESULT(yes)
2446 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10002447 K5LIBS="-lkrb5 -ldes"
2448 K5LIBS="$K5LIBS -lcom_err -lasn1"
2449 AC_CHECK_LIB(roken, net_write,
2450 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11002451 ],
2452 [ AC_MSG_RESULT(no)
2453 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2454 ]
2455 )
Damien Miller200d0a72003-06-30 19:21:36 +10002456 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002457
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002458 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2459 [ AC_DEFINE(GSSAPI)
2460 K5LIBS="-lgssapi $K5LIBS" ],
2461 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2462 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002463 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002464 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2465 $K5LIBS)
2466 ],
2467 $K5LIBS)
2468
2469 AC_CHECK_HEADER(gssapi.h, ,
2470 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002471 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002472 AC_CHECK_HEADERS(gssapi.h, ,
2473 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002474 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002475 ]
2476 )
2477
2478 oldCPP="$CPPFLAGS"
2479 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2480 AC_CHECK_HEADER(gssapi_krb5.h, ,
2481 [ CPPFLAGS="$oldCPP" ])
2482
Damien Millera8e06ce2003-11-21 23:48:55 +11002483 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002484 if test ! -z "$need_dash_r" ; then
2485 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2486 fi
2487 if test ! -z "$blibpath" ; then
2488 blibpath="$blibpath:${KRB5ROOT}/lib"
2489 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002490 fi
2491
2492 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2493 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2494 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2495
2496 LIBS="$LIBS $K5LIBS"
2497 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
Ben Lindstroma8104b52004-04-07 04:16:11 +00002498 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
Darren Tucker0d27ed12004-02-24 10:37:33 +11002499 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002500)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002501
Damien Millera22ba012000-03-02 23:09:20 +11002502# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002503
Damien Millerf58c6722002-05-13 13:15:42 +10002504PRIVSEP_PATH=/var/empty
2505AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002506 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002507 [
2508 if test "x$withval" != "$no" ; then
2509 PRIVSEP_PATH=$withval
2510 fi
2511 ]
2512)
2513AC_SUBST(PRIVSEP_PATH)
2514
Damien Millera22ba012000-03-02 23:09:20 +11002515AC_ARG_WITH(xauth,
2516 [ --with-xauth=PATH Specify path to xauth program ],
2517 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002518 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002519 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002520 fi
2521 ],
2522 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002523 TestPath="$PATH"
2524 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2525 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2526 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2527 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2528 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002529 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002530 xauth_path="/usr/openwin/bin/xauth"
2531 fi
2532 ]
2533)
2534
Damien Miller7d901272003-01-13 16:55:22 +11002535STRIP_OPT=-s
2536AC_ARG_ENABLE(strip,
2537 [ --disable-strip Disable calling strip(1) on install],
2538 [
2539 if test "x$enableval" = "xno" ; then
2540 STRIP_OPT=
2541 fi
2542 ]
2543)
2544AC_SUBST(STRIP_OPT)
2545
Damien Millera19cf472000-11-29 13:28:50 +11002546if test -z "$xauth_path" ; then
2547 XAUTH_PATH="undefined"
2548 AC_SUBST(XAUTH_PATH)
2549else
Damien Millera22ba012000-03-02 23:09:20 +11002550 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002551 XAUTH_PATH=$xauth_path
2552 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002553fi
Damien Millera22ba012000-03-02 23:09:20 +11002554
2555# Check for mail directory (last resort if we cannot get it from headers)
2556if test ! -z "$MAIL" ; then
2557 maildir=`dirname $MAIL`
2558 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2559fi
2560
Darren Tucker623d92f2004-09-12 22:36:15 +10002561if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002562 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2563 disable_ptmx_check=yes
2564fi
Damien Millera22ba012000-03-02 23:09:20 +11002565if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002566 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002567 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002568 [
2569 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2570 have_dev_ptmx=1
2571 ]
2572 )
2573 fi
Damien Millera22ba012000-03-02 23:09:20 +11002574fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10002575
Darren Tucker623d92f2004-09-12 22:36:15 +10002576if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002577 AC_CHECK_FILE("/dev/ptc",
2578 [
2579 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2580 have_dev_ptc=1
2581 ]
2582 )
2583else
2584 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2585fi
Damien Miller204ad072000-03-02 23:56:12 +11002586
Damien Millera22ba012000-03-02 23:09:20 +11002587# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002588AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002589 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002590 [
Damien Miller897741e2001-04-16 10:41:46 +10002591 case "$withval" in
2592 man|cat|doc)
2593 MANTYPE=$withval
2594 ;;
2595 *)
2596 AC_MSG_ERROR(invalid man type: $withval)
2597 ;;
2598 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002599 ]
2600)
Ben Lindstrombc709922001-04-18 18:04:21 +00002601if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002602 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2603 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002604 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2605 MANTYPE=doc
2606 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2607 MANTYPE=man
2608 else
2609 MANTYPE=cat
2610 fi
2611fi
Damien Miller670a4b82000-01-22 13:53:11 +11002612AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002613if test "$MANTYPE" = "doc"; then
2614 mansubdir=man;
2615else
2616 mansubdir=$MANTYPE;
2617fi
2618AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002619
Damien Millera22ba012000-03-02 23:09:20 +11002620# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002621MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002622AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002623 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002624 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002625 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002626 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002627 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002628 fi
2629 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002630)
2631
Damien Millera22ba012000-03-02 23:09:20 +11002632# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002633AC_ARG_WITH(shadow,
2634 [ --without-shadow Disable shadow password support],
2635 [
2636 if test "x$withval" = "xno" ; then
2637 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002638 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002639 fi
2640 ]
2641)
2642
Damien Miller1f335fb2000-06-26 11:31:33 +10002643if test -z "$disable_shadow" ; then
2644 AC_MSG_CHECKING([if the systems has expire shadow information])
2645 AC_TRY_COMPILE(
2646 [
2647#include <sys/types.h>
2648#include <shadow.h>
2649 struct spwd sp;
2650 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2651 [ sp_expire_available=yes ], []
2652 )
2653
2654 if test "x$sp_expire_available" = "xyes" ; then
2655 AC_MSG_RESULT(yes)
2656 AC_DEFINE(HAS_SHADOW_EXPIRE)
2657 else
2658 AC_MSG_RESULT(no)
2659 fi
2660fi
2661
Damien Millera22ba012000-03-02 23:09:20 +11002662# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002663if test ! -z "$IPADDR_IN_DISPLAY" ; then
2664 DISPLAY_HACK_MSG="yes"
2665 AC_DEFINE(IPADDR_IN_DISPLAY)
2666else
Damien Millera8e06ce2003-11-21 23:48:55 +11002667 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002668 AC_ARG_WITH(ipaddr-display,
2669 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2670 [
2671 if test "x$withval" != "xno" ; then
2672 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002673 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002674 fi
2675 ]
2676 )
2677fi
Damien Miller76112de1999-12-21 11:18:08 +11002678
Darren Tuckere1a790d2003-09-16 11:52:19 +10002679# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002680AC_ARG_ENABLE(etc-default-login,
Darren Tucker1b6f2292005-02-11 16:11:49 +11002681 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
Darren Tucker2f9573d2005-02-10 22:28:54 +11002682 [ if test "x$enableval" = "xno"; then
2683 AC_MSG_NOTICE([/etc/default/login handling disabled])
2684 etc_default_login=no
2685 else
2686 etc_default_login=yes
2687 fi ],
2688 [ etc_default_login=yes ]
2689)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002690
Darren Tucker2f9573d2005-02-10 22:28:54 +11002691if test "x$etc_default_login" != "xno"; then
2692 AC_CHECK_FILE("/etc/default/login",
2693 [ external_path_file=/etc/default/login ])
Darren Tucker623d92f2004-09-12 22:36:15 +10002694 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2695 then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002696 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2697 elif test "x$external_path_file" = "x/etc/default/login"; then
2698 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2699 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11002700fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002701
Tim Rice43a1c132002-04-17 21:19:14 -07002702dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2703if test $ac_cv_func_login_getcapbool = "yes" -a \
2704 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002705 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002706fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002707
Damien Millera22ba012000-03-02 23:09:20 +11002708# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002709SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002710AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002711 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002712 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002713 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002714 AC_MSG_WARN([
2715--with-default-path=PATH has no effect on this system.
2716Edit /etc/login.conf instead.])
2717 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002718 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002719 AC_MSG_WARN([
2720--with-default-path=PATH will only be used if PATH is not defined in
2721$external_path_file .])
2722 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002723 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002724 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002725 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002726 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002727 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2728 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002729 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002730 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002731 AC_MSG_WARN([
2732If PATH is defined in $external_path_file, ensure the path to scp is included,
2733otherwise scp will not work.])
2734 fi
2735 AC_TRY_RUN(
2736 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002737/* find out what STDPATH is */
2738#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002739#ifdef HAVE_PATHS_H
2740# include <paths.h>
2741#endif
2742#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002743# ifdef _PATH_USERPATH /* Irix */
2744# define _PATH_STDPATH _PATH_USERPATH
2745# else
2746# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2747# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002748#endif
2749#include <sys/types.h>
2750#include <sys/stat.h>
2751#include <fcntl.h>
2752#define DATA "conftest.stdpath"
2753
2754main()
2755{
2756 FILE *fd;
2757 int rc;
2758
2759 fd = fopen(DATA,"w");
2760 if(fd == NULL)
2761 exit(1);
2762
2763 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2764 exit(1);
2765
2766 exit(0);
2767}
2768 ], [ user_path=`cat conftest.stdpath` ],
2769 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2770 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2771 )
2772# make sure $bindir is in USER_PATH so scp will work
2773 t_bindir=`eval echo ${bindir}`
2774 case $t_bindir in
2775 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2776 esac
2777 case $t_bindir in
2778 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2779 esac
2780 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2781 if test $? -ne 0 ; then
2782 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2783 if test $? -ne 0 ; then
2784 user_path=$user_path:$t_bindir
2785 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2786 fi
2787 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002788 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002789)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002790if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002791 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2792 AC_SUBST(user_path)
2793fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002794
Damien Millera18bbd32002-05-13 10:48:57 +10002795# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002796AC_ARG_WITH(superuser-path,
2797 [ --with-superuser-path= Specify different path for super-user],
2798 [
2799 if test "x$withval" != "xno" ; then
2800 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2801 superuser_path=$withval
2802 fi
2803 ]
2804)
2805
2806
Damien Miller61e50f12000-05-08 20:49:37 +10002807AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002808IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002809AC_ARG_WITH(4in6,
2810 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2811 [
2812 if test "x$withval" != "xno" ; then
2813 AC_MSG_RESULT(yes)
2814 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002815 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002816 else
2817 AC_MSG_RESULT(no)
2818 fi
2819 ],[
2820 if test "x$inet6_default_4in6" = "xyes"; then
2821 AC_MSG_RESULT([yes (default)])
2822 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002823 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002824 else
2825 AC_MSG_RESULT([no (default)])
2826 fi
2827 ]
2828)
2829
Damien Miller60396b02001-02-18 17:01:00 +11002830# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002831BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002832AC_ARG_WITH(bsd-auth,
2833 [ --with-bsd-auth Enable BSD auth support],
2834 [
2835 if test "x$withval" != "xno" ; then
2836 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002837 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002838 fi
2839 ]
2840)
2841
Damien Millera22ba012000-03-02 23:09:20 +11002842# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002843piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002844# make sure the directory exists
2845if test ! -d $piddir ; then
2846 piddir=`eval echo ${sysconfdir}`
2847 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002848 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002849 esac
2850fi
2851
Tim Rice88f2ab52002-03-17 12:17:34 -08002852AC_ARG_WITH(pid-dir,
2853 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2854 [
2855 if test "x$withval" != "xno" ; then
2856 piddir=$withval
2857 if test ! -d $piddir ; then
2858 AC_MSG_WARN([** no $piddir directory on this system **])
2859 fi
2860 fi
2861 ]
2862)
2863
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002864AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002865AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002866
andre2ff7b5d2000-06-03 14:57:40 +00002867dnl allow user to disable some login recording features
2868AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002869 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002870 [
2871 if test "x$enableval" = "xno" ; then
2872 AC_DEFINE(DISABLE_LASTLOG)
2873 fi
2874 ]
andre2ff7b5d2000-06-03 14:57:40 +00002875)
2876AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002877 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002878 [
2879 if test "x$enableval" = "xno" ; then
2880 AC_DEFINE(DISABLE_UTMP)
2881 fi
2882 ]
andre2ff7b5d2000-06-03 14:57:40 +00002883)
2884AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002885 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002886 [
2887 if test "x$enableval" = "xno" ; then
2888 AC_DEFINE(DISABLE_UTMPX)
2889 fi
2890 ]
andre2ff7b5d2000-06-03 14:57:40 +00002891)
2892AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002893 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002894 [
2895 if test "x$enableval" = "xno" ; then
2896 AC_DEFINE(DISABLE_WTMP)
2897 fi
2898 ]
andre2ff7b5d2000-06-03 14:57:40 +00002899)
2900AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002901 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002902 [
2903 if test "x$enableval" = "xno" ; then
2904 AC_DEFINE(DISABLE_WTMPX)
2905 fi
2906 ]
andre2ff7b5d2000-06-03 14:57:40 +00002907)
2908AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002909 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002910 [
2911 if test "x$enableval" = "xno" ; then
2912 AC_DEFINE(DISABLE_LOGIN)
2913 fi
2914 ]
andre2ff7b5d2000-06-03 14:57:40 +00002915)
2916AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002917 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002918 [
2919 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002920 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002921 fi
2922 ]
andre2ff7b5d2000-06-03 14:57:40 +00002923)
2924AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002925 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002926 [
2927 if test "x$enableval" = "xno" ; then
2928 AC_DEFINE(DISABLE_PUTUTXLINE)
2929 fi
2930 ]
andre2ff7b5d2000-06-03 14:57:40 +00002931)
2932AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002933 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002934 [
2935 if test "x$withval" = "xno" ; then
2936 AC_DEFINE(DISABLE_LASTLOG)
2937 else
2938 conf_lastlog_location=$withval
2939 fi
2940 ]
2941)
andre2ff7b5d2000-06-03 14:57:40 +00002942
2943dnl lastlog, [uw]tmpx? detection
2944dnl NOTE: set the paths in the platform section to avoid the
2945dnl need for command-line parameters
2946dnl lastlog and [uw]tmp are subject to a file search if all else fails
2947
2948dnl lastlog detection
2949dnl NOTE: the code itself will detect if lastlog is a directory
2950AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2951AC_TRY_COMPILE([
2952#include <sys/types.h>
2953#include <utmp.h>
2954#ifdef HAVE_LASTLOG_H
2955# include <lastlog.h>
2956#endif
Damien Miller2994e082000-06-04 15:51:47 +10002957#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002958# include <paths.h>
2959#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002960#ifdef HAVE_LOGIN_H
2961# include <login.h>
2962#endif
andre2ff7b5d2000-06-03 14:57:40 +00002963 ],
2964 [ char *lastlog = LASTLOG_FILE; ],
2965 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002966 [
2967 AC_MSG_RESULT(no)
2968 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2969 AC_TRY_COMPILE([
2970#include <sys/types.h>
2971#include <utmp.h>
2972#ifdef HAVE_LASTLOG_H
2973# include <lastlog.h>
2974#endif
2975#ifdef HAVE_PATHS_H
2976# include <paths.h>
2977#endif
2978 ],
2979 [ char *lastlog = _PATH_LASTLOG; ],
2980 [ AC_MSG_RESULT(yes) ],
2981 [
andree441aa32000-06-12 22:34:38 +00002982 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002983 system_lastlog_path=no
2984 ])
2985 ]
andre2ff7b5d2000-06-03 14:57:40 +00002986)
Damien Miller2994e082000-06-04 15:51:47 +10002987
andre2ff7b5d2000-06-03 14:57:40 +00002988if test -z "$conf_lastlog_location"; then
2989 if test x"$system_lastlog_path" = x"no" ; then
2990 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002991 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002992 conf_lastlog_location=$f
2993 fi
2994 done
2995 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002996 AC_MSG_WARN([** Cannot find lastlog **])
2997 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002998 fi
2999 fi
3000fi
3001
3002if test -n "$conf_lastlog_location"; then
3003 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
3004fi
3005
3006dnl utmp detection
3007AC_MSG_CHECKING([if your system defines UTMP_FILE])
3008AC_TRY_COMPILE([
3009#include <sys/types.h>
3010#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003011#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003012# include <paths.h>
3013#endif
3014 ],
3015 [ char *utmp = UTMP_FILE; ],
3016 [ AC_MSG_RESULT(yes) ],
3017 [ AC_MSG_RESULT(no)
3018 system_utmp_path=no ]
3019)
3020if test -z "$conf_utmp_location"; then
3021 if test x"$system_utmp_path" = x"no" ; then
3022 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
3023 if test -f $f ; then
3024 conf_utmp_location=$f
3025 fi
3026 done
3027 if test -z "$conf_utmp_location"; then
3028 AC_DEFINE(DISABLE_UTMP)
3029 fi
3030 fi
3031fi
3032if test -n "$conf_utmp_location"; then
3033 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
3034fi
3035
3036dnl wtmp detection
3037AC_MSG_CHECKING([if your system defines WTMP_FILE])
3038AC_TRY_COMPILE([
3039#include <sys/types.h>
3040#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003041#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003042# include <paths.h>
3043#endif
3044 ],
3045 [ char *wtmp = WTMP_FILE; ],
3046 [ AC_MSG_RESULT(yes) ],
3047 [ AC_MSG_RESULT(no)
3048 system_wtmp_path=no ]
3049)
3050if test -z "$conf_wtmp_location"; then
3051 if test x"$system_wtmp_path" = x"no" ; then
3052 for f in /usr/adm/wtmp /var/log/wtmp; do
3053 if test -f $f ; then
3054 conf_wtmp_location=$f
3055 fi
3056 done
3057 if test -z "$conf_wtmp_location"; then
3058 AC_DEFINE(DISABLE_WTMP)
3059 fi
3060 fi
3061fi
3062if test -n "$conf_wtmp_location"; then
3063 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
3064fi
3065
3066
3067dnl utmpx detection - I don't know any system so perverse as to require
3068dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3069dnl there, though.
3070AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3071AC_TRY_COMPILE([
3072#include <sys/types.h>
3073#include <utmp.h>
3074#ifdef HAVE_UTMPX_H
3075#include <utmpx.h>
3076#endif
Damien Miller2994e082000-06-04 15:51:47 +10003077#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003078# include <paths.h>
3079#endif
3080 ],
3081 [ char *utmpx = UTMPX_FILE; ],
3082 [ AC_MSG_RESULT(yes) ],
3083 [ AC_MSG_RESULT(no)
3084 system_utmpx_path=no ]
3085)
3086if test -z "$conf_utmpx_location"; then
3087 if test x"$system_utmpx_path" = x"no" ; then
3088 AC_DEFINE(DISABLE_UTMPX)
3089 fi
3090else
3091 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
3092fi
3093
3094dnl wtmpx detection
3095AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3096AC_TRY_COMPILE([
3097#include <sys/types.h>
3098#include <utmp.h>
3099#ifdef HAVE_UTMPX_H
3100#include <utmpx.h>
3101#endif
Damien Miller2994e082000-06-04 15:51:47 +10003102#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003103# include <paths.h>
3104#endif
3105 ],
3106 [ char *wtmpx = WTMPX_FILE; ],
3107 [ AC_MSG_RESULT(yes) ],
3108 [ AC_MSG_RESULT(no)
3109 system_wtmpx_path=no ]
3110)
3111if test -z "$conf_wtmpx_location"; then
3112 if test x"$system_wtmpx_path" = x"no" ; then
3113 AC_DEFINE(DISABLE_WTMPX)
3114 fi
3115else
3116 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
3117fi
3118
Damien Miller4018c192000-04-30 09:30:44 +10003119
Damien Miller29ea30d2000-03-17 10:54:15 +11003120if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003121 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3122 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003123fi
3124
Tim Rice4cec93f2002-02-26 08:40:48 -08003125dnl remove pam and dl because they are in $LIBPAM
3126if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003127 LIBS=`echo $LIBS | sed 's/-lpam //'`
3128fi
3129if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3130 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003131fi
3132
Damien Millerbac2d8a2000-09-05 16:13:06 +11003133AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003134AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3135 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003136AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003137
Damien Miller7b22d652000-06-18 14:07:04 +10003138# Print summary of options
3139
Damien Miller7b22d652000-06-18 14:07:04 +10003140# Someone please show me a better way :)
3141A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3142B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3143C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3144D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003145E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003146F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003147G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003148H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3149I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3150J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003151
3152echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003153echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003154echo " User binaries: $B"
3155echo " System binaries: $C"
3156echo " Configuration files: $D"
3157echo " Askpass program: $E"
3158echo " Manual pages: $F"
3159echo " PID file: $G"
3160echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003161if test "x$external_path_file" = "x/etc/login.conf" ; then
3162echo " At runtime, sshd will use the path defined in $external_path_file"
3163echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003164else
Damien Millerf58c6722002-05-13 13:15:42 +10003165echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003166 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003167echo " (If PATH is set in $external_path_file it will be used instead. If"
3168echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3169 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003170fi
Damien Millera18bbd32002-05-13 10:48:57 +10003171if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003172echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003173fi
Damien Millerf58c6722002-05-13 13:15:42 +10003174echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003175echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003176echo " KerberosV support: $KRB5_MSG"
3177echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003178echo " S/KEY support: $SKEY_MSG"
3179echo " TCP Wrappers support: $TCPW_MSG"
3180echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003181echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003182echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003183echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3184echo " BSD Auth support: $BSD_AUTH_MSG"
3185echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003186if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003187echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003188fi
3189
Damien Miller7b22d652000-06-18 14:07:04 +10003190echo ""
3191
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003192echo " Host: ${host}"
3193echo " Compiler: ${CC}"
3194echo " Compiler flags: ${CFLAGS}"
3195echo "Preprocessor flags: ${CPPFLAGS}"
3196echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003197echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003198
3199echo ""
3200
Tim Rice6f1f7582004-05-30 21:38:51 -07003201if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003202 echo "SVR4 style packages are supported with \"make package\""
3203 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003204fi
3205
Damien Miller82cf0ce2000-12-20 13:34:48 +11003206if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003207 echo "PAM is enabled. You may need to install a PAM control file "
3208 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003209 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003210 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003211 echo ""
3212fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003213
Damien Miller6c21c512002-01-22 21:57:53 +11003214if test ! -z "$RAND_HELPER_CMDHASH" ; then
3215 echo "WARNING: you are using the builtin random number collection "
3216 echo "service. Please read WARNING.RNG and request that your OS "
3217 echo "vendor includes kernel-based random number collection in "
3218 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003219 echo ""
3220fi
Damien Miller60396b02001-02-18 17:01:00 +11003221
Damien Millerb4097182004-05-23 14:09:40 +10003222if test ! -z "$NO_PEERCHECK" ; then
3223 echo "WARNING: the operating system that you are using does not "
3224 echo "appear to support either the getpeereid() API nor the "
3225 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3226 echo "enforce security checks to prevent unauthorised connections to "
3227 echo "ssh-agent. Their absence increases the risk that a malicious "
3228 echo "user can connect to your agent. "
3229 echo ""
3230fi
3231
Darren Tuckerd9f88912005-02-20 21:01:48 +11003232if test "$AUDIT_MODULE" = "bsm" ; then
3233 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
3234 echo "See the Solaris section in README.platform for details."
3235fi