blob: 9d1d3328262e060297bb640a3c1f2ff1786ae12d [file] [log] [blame]
Darren Tucker2f9573d2005-02-10 22:28:54 +11001# $Id: configure.ac,v 1.240 2005/02/10 11:28:55 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 Tucker5c6a91a2003-07-14 16:21:44 +1000124 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
125 AC_CHECK_DECL(loginfailed,
126 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
127 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000128 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000129 [(void)loginfailed("user","host","tty",0);],
130 [AC_MSG_RESULT(yes)
131 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000132 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000133 )],
134 [],
135 [#include <usersec.h>]
136 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000137 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +1100138 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000139 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000140 AC_DEFINE(SETEUID_BREAKS_SETUID)
141 AC_DEFINE(BROKEN_SETREUID)
142 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000143 dnl AIX handles lastlog as part of its login message
144 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000145 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000146 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100147 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100148*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100149 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800150 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100151 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000152 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100153 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100154 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000155 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000156 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700157 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000158 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100159 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000160*-*-dgux*)
161 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100162 AC_DEFINE(SETEUID_BREAKS_SETUID)
163 AC_DEFINE(BROKEN_SETREUID)
164 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000165 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000166*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000167 AC_MSG_CHECKING(if we have working getaddrinfo)
168 AC_TRY_RUN([#include <mach-o/dyld.h>
169main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
170 exit(0);
171 else
172 exit(1);
173}], [AC_MSG_RESULT(working)],
174 [AC_MSG_RESULT(buggy)
175 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700176 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000177 AC_DEFINE(SETEUID_BREAKS_SETUID)
178 AC_DEFINE(BROKEN_SETREUID)
179 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100180 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000181 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000182*-*-hpux10.26)
183 if test -z "$GCC"; then
184 CFLAGS="$CFLAGS -Ae"
185 fi
186 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
187 IPADDR_IN_DISPLAY=yes
188 AC_DEFINE(HAVE_SECUREWARE)
189 AC_DEFINE(USE_PIPES)
190 AC_DEFINE(LOGIN_NO_ENDOPT)
191 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000192 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000193 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700194 LIBS="$LIBS -lsec -lsecpw"
195 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000196 disable_ptmx_check=yes
197 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100198*-*-hpux10*)
199 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000200 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100201 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000202 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100203 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000204 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000205 AC_DEFINE(LOGIN_NO_ENDOPT)
206 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000207 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000208 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700209 LIBS="$LIBS -lsec"
210 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100211 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000212*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000213 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100214 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100215 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100216 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000217 AC_DEFINE(LOGIN_NO_ENDOPT)
218 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100219 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000220 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000221 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tucker2fba9932005-02-02 23:30:24 +1100222 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Darren Tucker4398cf52004-04-06 21:39:02 +1000223 check_for_hpux_broken_getaddrinfo=1
Darren Tuckera56f1912004-11-02 20:30:54 +1100224 check_for_conflicting_getspnam=1
Tim Ricef028f1e2002-07-19 12:41:10 -0700225 LIBS="$LIBS -lsec"
226 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000227 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100228*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100229 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000230 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000231 AC_DEFINE(SETEUID_BREAKS_SETUID)
232 AC_DEFINE(BROKEN_SETREUID)
233 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000234 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000235 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100236 ;;
237*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100238 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000239 AC_DEFINE(WITH_IRIX_ARRAY)
240 AC_DEFINE(WITH_IRIX_PROJECT)
241 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000242 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000243 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000244 AC_DEFINE(SETEUID_BREAKS_SETUID)
245 AC_DEFINE(BROKEN_SETREUID)
246 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker8db9a0f2004-04-06 21:31:12 +1000247 AC_DEFINE(BROKEN_UPDWTMPX)
Damien Millerf1b9d112002-04-23 23:09:19 +1000248 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000249 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100250 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100251*-*-linux*)
252 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100253 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000254 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100255 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000256 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker809031f2004-03-30 14:03:45 +1000257 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!")
Damien Miller35276252003-06-03 10:14:28 +1000258 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Darren Tuckere59b5082004-06-28 16:01:19 +1000259 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM)
Darren Tucker2fba9932005-02-02 23:30:24 +1100260 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
261 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Damien Miller7bcb0892000-03-11 20:45:40 +1100262 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000263 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000264 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000265 AC_DEFINE(BROKEN_CMSG_TYPE)
266 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000267 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100268 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000269mips-sony-bsd|mips-sony-newsos4)
270 AC_DEFINE(HAVE_NEWS4)
271 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000272 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100273*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000274 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800275 if test "x$withval" != "xno" ; then
276 need_dash_r=1
277 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100278 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100279*-*-freebsd*)
280 check_for_libcrypt_later=1
281 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000282*-*-bsdi*)
283 AC_DEFINE(SETEUID_BREAKS_SETUID)
284 AC_DEFINE(BROKEN_SETREUID)
285 AC_DEFINE(BROKEN_SETREGID)
286 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000287*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000288 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100289 conf_utmp_location=/etc/utmp
290 conf_wtmp_location=/usr/adm/wtmp
291 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000292 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000293 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000294 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100295 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000296 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100297*-*-solaris*)
Tim Ricead4a1882004-02-29 15:53:37 -0800298 if test "x$withval" != "xno" ; then
299 need_dash_r=1
300 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100301 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000302 AC_DEFINE(LOGIN_NEEDS_UTMPX)
303 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000304 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker21dd0892004-08-16 23:12:05 +1000305 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID)
Darren Tuckere41bba52003-08-25 11:51:19 +1000306 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000307 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
308 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000309 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000310 # hardwire lastlog location (can't detect it on some versions)
311 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000312 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
313 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
314 if test "$sol2ver" -ge 8; then
315 AC_MSG_RESULT(yes)
316 AC_DEFINE(DISABLE_UTMP)
317 AC_DEFINE(DISABLE_WTMP)
318 else
319 AC_MSG_RESULT(no)
320 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100321 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000322*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000323 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000324 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100325 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000326 conf_utmp_location=/etc/utmp
327 conf_wtmp_location=/var/adm/wtmp
328 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000329 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000330 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000331*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700332 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000333 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000334 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000335 AC_DEFINE(SETEUID_BREAKS_SETUID)
336 AC_DEFINE(BROKEN_SETREUID)
337 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000338 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000339*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700340 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000341 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100342 IPADDR_IN_DISPLAY=yes
343 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000344 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000345 AC_DEFINE(SETEUID_BREAKS_SETUID)
346 AC_DEFINE(BROKEN_SETREUID)
347 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000348 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000349 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700350 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
351 # Attention: always take care to bind libsocket and libnsl before libc,
352 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000353 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800354# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
Damien Miller78315eb2000-09-29 23:01:36 +1100355*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100356 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700357 AC_DEFINE(SETEUID_BREAKS_SETUID)
358 AC_DEFINE(BROKEN_SETREUID)
359 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100360 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800361# UnixWare 7.x, OpenUNIX 8
Damien Miller78315eb2000-09-29 23:01:36 +1100362*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100363 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700364 AC_DEFINE(SETEUID_BREAKS_SETUID)
365 AC_DEFINE(BROKEN_SETREUID)
366 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100367 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100368*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100369 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800370# SCO UNIX and OEM versions of SCO UNIX
Damien Miller78315eb2000-09-29 23:01:36 +1100371*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800372 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Ricee8c898a2004-02-23 21:47:04 -0800373 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100374 RANLIB=true
375 no_dev_ptmx=1
376 AC_DEFINE(BROKEN_SYS_TERMIO_H)
377 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000378 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000379 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100380 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Ricefe6d5aa2004-04-16 20:03:07 -0700381 AC_DEFINE(SETEUID_BREAKS_SETUID)
382 AC_DEFINE(BROKEN_SETREUID)
383 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700384 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100385 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700386 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700387 do_sco3_extra_lib_check=yes
Tim Ricef7ba8f62004-06-20 10:37:32 -0700388 TEST_SHELL=ksh
Damien Miller78315eb2000-09-29 23:01:36 +1100389 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800390# SCO OpenServer 5.x
Damien Miller78315eb2000-09-29 23:01:36 +1100391*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800392 if test -z "$GCC"; then
393 CFLAGS="$CFLAGS -belf"
394 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100395 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000396 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100397 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000398 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000399 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700400 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700401 AC_DEFINE(SETEUID_BREAKS_SETUID)
402 AC_DEFINE(BROKEN_SETREUID)
403 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700404 AC_DEFINE(WITH_ABBREV_NO_TTY)
Tim Rice816bd0d2004-07-19 10:19:26 -0700405 AC_DEFINE(BROKEN_UPDWTMPX)
Darren Tucker33370e02005-02-09 22:17:28 +1100406 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
Damien Miller217f5672001-02-16 12:12:41 +1100407 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700408 MANTYPE=man
Tim Ricef7ba8f62004-06-20 10:37:32 -0700409 TEST_SHELL=ksh
Damien Millera66626b2000-06-13 18:57:53 +1000410 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000411*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100412 AC_DEFINE(NO_SSH_LASTLOG)
413 AC_DEFINE(SETEUID_BREAKS_SETUID)
414 AC_DEFINE(BROKEN_SETREUID)
415 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000416 AC_DEFINE(USE_PIPES)
417 AC_DEFINE(DISABLE_FD_PASSING)
418 LDFLAGS="$LDFLAGS"
419 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
420 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000421 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000422*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100423 AC_DEFINE(SETEUID_BREAKS_SETUID)
424 AC_DEFINE(BROKEN_SETREUID)
425 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000426 AC_DEFINE(WITH_ABBREV_NO_TTY)
427 AC_DEFINE(USE_PIPES)
428 AC_DEFINE(DISABLE_FD_PASSING)
429 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100430 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000431 MANTYPE=cat
432 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000433*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100434 AC_DEFINE(SETEUID_BREAKS_SETUID)
435 AC_DEFINE(BROKEN_SETREUID)
436 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000437 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700438 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700439 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000440 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
441 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
442 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700443 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000444*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000445 AC_MSG_CHECKING(for Digital Unix SIA)
446 no_osfsia=""
447 AC_ARG_WITH(osfsia,
448 [ --with-osfsia Enable Digital Unix SIA],
449 [
450 if test "x$withval" = "xno" ; then
451 AC_MSG_RESULT(disabled)
452 no_osfsia=1
453 fi
454 ],
455 )
456 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000457 if test -f /etc/sia/matrix.conf; then
458 AC_MSG_RESULT(yes)
459 AC_DEFINE(HAVE_OSF_SIA)
460 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000461 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000462 LIBS="$LIBS -lsecurity -ldb -lm -laud"
463 else
464 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100465 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000466 fi
467 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000468 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700469 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000470 AC_DEFINE(BROKEN_SETREUID)
471 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000472 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000473
474*-*-nto-qnx)
475 AC_DEFINE(USE_PIPES)
476 AC_DEFINE(NO_X11_UNIX_SOCKETS)
477 AC_DEFINE(MISSING_NFDBITS)
478 AC_DEFINE(MISSING_HOWMANY)
479 AC_DEFINE(MISSING_FD_MASK)
480 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100481esac
482
Damien Millere37bfc12000-06-05 09:37:43 +1000483# Allow user to specify flags
484AC_ARG_WITH(cflags,
485 [ --with-cflags Specify additional flags to pass to compiler],
486 [
487 if test "x$withval" != "xno" ; then
488 CFLAGS="$CFLAGS $withval"
489 fi
490 ]
491)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000492AC_ARG_WITH(cppflags,
493 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
494 [
495 if test "x$withval" != "xno"; then
496 CPPFLAGS="$CPPFLAGS $withval"
497 fi
498 ]
499)
Damien Millere37bfc12000-06-05 09:37:43 +1000500AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000501 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000502 [
503 if test "x$withval" != "xno" ; then
504 LDFLAGS="$LDFLAGS $withval"
505 fi
506 ]
507)
508AC_ARG_WITH(libs,
509 [ --with-libs Specify additional libraries to link with],
510 [
511 if test "x$withval" != "xno" ; then
512 LIBS="$LIBS $withval"
513 fi
514 ]
515)
516
Darren Tucker6eb93042003-06-29 21:30:41 +1000517AC_MSG_CHECKING(compiler and flags for sanity)
Darren Tucker623d92f2004-09-12 22:36:15 +1000518AC_RUN_IFELSE(
519 [AC_LANG_SOURCE([
Darren Tucker6eb93042003-06-29 21:30:41 +1000520#include <stdio.h>
521int main(){exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000522 ])],
Darren Tucker6eb93042003-06-29 21:30:41 +1000523 [ AC_MSG_RESULT(yes) ],
524 [
525 AC_MSG_RESULT(no)
526 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000527 ],
528 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
Darren Tucker6eb93042003-06-29 21:30:41 +1000529)
530
Tim Rice4cec93f2002-02-26 08:40:48 -0800531# Checks for header files.
Damien Miller36f49652004-08-15 18:40:59 +1000532AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \
533 floatingpoint.h getopt.h glob.h ia.h lastlog.h limits.h login.h \
534 login_cap.h maillock.h ndir.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100535 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000536 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Damien Miller36f49652004-08-15 18:40:59 +1000537 strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \
538 sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \
Darren Tucker48d99d32004-08-29 17:04:50 +1000539 sys/pstat.h sys/select.h sys/stat.h sys/stream.h \
Damien Miller36f49652004-08-15 18:40:59 +1000540 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \
541 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 -0800542
Darren Tucker48d99d32004-08-29 17:04:50 +1000543# sys/ptms.h requires sys/stream.h to be included first on Solaris
544AC_CHECK_HEADERS(sys/ptms.h, [], [], [
545#ifdef HAVE_SYS_STREAM_H
546# include <sys/stream.h>
547#endif
548])
549
Damien Millera22ba012000-03-02 23:09:20 +1100550# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700551AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
552AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000553
Damien Millerdf288022001-02-18 13:07:07 +1100554dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700555if test "x$with_tcp_wrappers" != "xno" ; then
556 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
557 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
558 fi
559fi
Damien Millerdf288022001-02-18 13:07:07 +1100560
Tim Rice1e1ef642003-09-11 22:19:31 -0700561dnl IRIX and Solaris 2.5.1 have dirname() in libgen
562AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
563 AC_CHECK_LIB(gen, dirname,[
564 AC_CACHE_CHECK([for broken dirname],
565 ac_cv_have_broken_dirname, [
566 save_LIBS="$LIBS"
567 LIBS="$LIBS -lgen"
568 AC_TRY_RUN(
569 [
570#include <libgen.h>
571#include <string.h>
572
573int main(int argc, char **argv) {
574 char *s, buf[32];
575
576 strncpy(buf,"/etc", 32);
577 s = dirname(buf);
578 if (!s || strncmp(s, "/", 32) != 0) {
579 exit(1);
580 } else {
581 exit(0);
582 }
583}
584 ],
585 [ ac_cv_have_broken_dirname="no" ],
586 [ ac_cv_have_broken_dirname="yes" ]
587 )
588 LIBS="$save_LIBS"
589 ])
590 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
591 LIBS="$LIBS -lgen"
592 AC_DEFINE(HAVE_DIRNAME)
593 AC_CHECK_HEADERS(libgen.h)
594 fi
595 ])
596])
597
598AC_CHECK_FUNC(getspnam, ,
599 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
600AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
601
Tim Rice13aae5e2001-10-21 17:53:58 -0700602dnl zlib is required
603AC_ARG_WITH(zlib,
604 [ --with-zlib=PATH Use zlib in PATH],
605 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000606 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100607 AC_MSG_ERROR([*** zlib is required ***])
608 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700609 if test -d "$withval/lib"; then
610 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700611 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700612 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700613 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700614 fi
615 else
616 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700617 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700618 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700619 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700620 fi
621 fi
622 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700623 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700624 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700625 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700626 fi
627 ]
628)
629
Tim Ricefcb62202004-01-23 18:35:16 -0800630AC_CHECK_LIB(z, deflate, ,
631 [
632 saved_CPPFLAGS="$CPPFLAGS"
633 saved_LDFLAGS="$LDFLAGS"
634 save_LIBS="$LIBS"
635 dnl Check default zlib install dir
636 if test -n "${need_dash_r}"; then
637 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
638 else
639 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
640 fi
641 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
642 LIBS="$LIBS -lz"
643 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
644 [
645 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
646 ]
647 )
648 ]
649)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100650AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100651
652AC_ARG_WITH(zlib-version-check,
653 [ --without-zlib-version-check Disable zlib version check],
654 [ if test "x$withval" = "xno" ; then
655 zlib_check_nonfatal=1
656 fi
657 ]
658)
659
Darren Tucker2dcd2392004-01-23 17:13:33 +1100660AC_MSG_CHECKING(for zlib 1.1.4 or greater)
Darren Tucker623d92f2004-09-12 22:36:15 +1000661AC_RUN_IFELSE([AC_LANG_SOURCE([[
Darren Tucker2dcd2392004-01-23 17:13:33 +1100662#include <zlib.h>
663int main()
664{
665 int a, b, c, v;
666 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
667 exit(1);
668 v = a*1000000 + b*1000 + c;
669 if (v >= 1001004)
670 exit(0);
671 exit(2);
672}
Darren Tucker623d92f2004-09-12 22:36:15 +1000673 ]])],
Darren Tucker2dcd2392004-01-23 17:13:33 +1100674 AC_MSG_RESULT(yes),
675 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100676 if test -z "$zlib_check_nonfatal" ; then
677 AC_MSG_ERROR([*** zlib too old - check config.log ***
678Your reported zlib version has known security problems. It's possible your
679vendor has fixed these problems without changing the version number. If you
680are sure this is the case, you can disable the check by running
681"./configure --without-zlib-version-check".
682If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
683 else
684 AC_MSG_WARN([zlib version may have security problems])
685 fi
Darren Tuckera0c2b392004-09-11 23:26:37 +1000686 ],
687 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100688)
Damien Miller6f9c3372000-10-25 10:06:04 +1100689
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000690dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100691AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000692 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
693)
Damien Millera8e06ce2003-11-21 23:48:55 +1100694AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700695 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
696 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000697)
Damien Millerab18c411999-11-11 10:40:23 +1100698
Tim Ricee589a292001-11-03 11:09:32 -0800699dnl Checks for libutil functions
700AC_CHECK_HEADERS(libutil.h)
701AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
702AC_CHECK_FUNCS(logout updwtmp logwtmp)
703
Ben Lindstrom8697e082001-02-24 21:41:10 +0000704AC_FUNC_STRFTIME
705
Damien Miller3c027682001-03-14 11:39:45 +1100706# Check for ALTDIRFUNC glob() extension
707AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
708AC_EGREP_CPP(FOUNDIT,
709 [
710 #include <glob.h>
711 #ifdef GLOB_ALTDIRFUNC
712 FOUNDIT
713 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100714 ],
Damien Miller3c027682001-03-14 11:39:45 +1100715 [
716 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
717 AC_MSG_RESULT(yes)
718 ],
719 [
720 AC_MSG_RESULT(no)
721 ]
722)
Damien Millerab18c411999-11-11 10:40:23 +1100723
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000724# Check for g.gl_matchc glob() extension
725AC_MSG_CHECKING(for gl_matchc field in glob_t)
726AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100727 [
728 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000729 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100730 ],
731 [
732 AC_DEFINE(GLOB_HAS_GL_MATCHC)
733 AC_MSG_RESULT(yes)
734 ],
735 [
736 AC_MSG_RESULT(no)
737 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000738)
739
Damien Miller18bb4732001-03-28 14:35:30 +1000740AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000741AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000742 [AC_LANG_SOURCE([[
Damien Miller18bb4732001-03-28 14:35:30 +1000743#include <sys/types.h>
744#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700745int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Darren Tucker623d92f2004-09-12 22:36:15 +1000746 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100747 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000748 [
749 AC_MSG_RESULT(no)
750 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000751 ],
752 [
753 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
754 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Damien Miller18bb4732001-03-28 14:35:30 +1000755 ]
756)
757
Damien Miller36f49652004-08-15 18:40:59 +1000758AC_MSG_CHECKING([for /proc/pid/fd directory])
759if test -d "/proc/$$/fd" ; then
760 AC_DEFINE(HAVE_PROC_PID)
761 AC_MSG_RESULT(yes)
762else
763 AC_MSG_RESULT(no)
764fi
765
Damien Millerc547bf12001-02-16 10:18:12 +1100766# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100767SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100768AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700769 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100770 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100771 [
772 if test "x$withval" != "xno" ; then
773
774 if test "x$withval" != "xyes" ; then
775 CPPFLAGS="$CPPFLAGS -I${withval}/include"
776 LDFLAGS="$LDFLAGS -L${withval}/lib"
777 fi
778
779 AC_DEFINE(SKEY)
780 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100781 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100782
Tim Rice4cec93f2002-02-26 08:40:48 -0800783 AC_MSG_CHECKING([for s/key support])
784 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100785 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800786#include <stdio.h>
787#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700788int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800789 ],
790 [AC_MSG_RESULT(yes)],
791 [
792 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100793 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
794 ])
Darren Tucker3b908f62004-04-14 15:26:39 +1000795 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
796 AC_TRY_COMPILE(
797 [#include <stdio.h>
798 #include <skey.h>],
799 [(void)skeychallenge(NULL,"name","",0);],
800 [AC_MSG_RESULT(yes)
801 AC_DEFINE(SKEYCHALLENGE_4ARG)],
802 [AC_MSG_RESULT(no)]
803 )
Damien Millerc547bf12001-02-16 10:18:12 +1100804 fi
805 ]
806)
807
808# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700809TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100810AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700811 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100812 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100813 [
814 if test "x$withval" != "xno" ; then
815 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700816 saved_LDFLAGS="$LDFLAGS"
817 saved_CPPFLAGS="$CPPFLAGS"
818 if test -n "${withval}" -a "${withval}" != "yes"; then
819 if test -d "${withval}/lib"; then
820 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700821 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700822 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700823 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700824 fi
825 else
826 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700827 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700828 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700829 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700830 fi
831 fi
832 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700833 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700834 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700835 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700836 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700837 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800838 LIBWRAP="-lwrap"
839 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100840 AC_MSG_CHECKING(for libwrap)
841 AC_TRY_LINK(
842 [
Damien Miller0ac45002004-04-14 20:14:26 +1000843#include <sys/types.h>
844#include <sys/socket.h>
845#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +1100846#include <tcpd.h>
847 int deny_severity = 0, allow_severity = 0;
848 ],
849 [hosts_access(0);],
850 [
851 AC_MSG_RESULT(yes)
852 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800853 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700854 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100855 ],
856 [
857 AC_MSG_ERROR([*** libwrap missing])
858 ]
859 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800860 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100861 fi
862 ]
863)
864
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100865# Check whether user wants libedit support
866LIBEDIT_MSG="no"
867AC_ARG_WITH(libedit,
868 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
869 [ if test "x$withval" != "xno" ; then
870 AC_CHECK_LIB(edit, el_init,
871 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
872 LIBEDIT="-ledit -lcurses"
873 LIBEDIT_MSG="yes"
874 AC_SUBST(LIBEDIT)
875 ],
876 [], [-lcurses]
877 )
878 fi ]
879)
880
Damien Millerfe1f1432003-02-24 15:45:42 +1100881dnl Checks for library functions. Please keep in alphabetical order
882AC_CHECK_FUNCS(\
Darren Tucker60bd4092004-06-25 14:03:34 +1000883 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
Darren Tuckerad7646a2005-02-02 10:43:59 +1100884 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
885 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
886 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100887 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000888 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100889 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000890 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100891 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000892 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000893 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100894 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100895)
Tim Rice13aae5e2001-10-21 17:53:58 -0700896
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000897# IRIX has a const char return value for gai_strerror()
898AC_CHECK_FUNCS(gai_strerror,[
899 AC_DEFINE(HAVE_GAI_STRERROR)
900 AC_TRY_COMPILE([
901#include <sys/types.h>
902#include <sys/socket.h>
903#include <netdb.h>
904
905const char *gai_strerror(int);],[
906char *str;
907
908str = gai_strerror(0);],[
909 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
910 [Define if gai_strerror() returns const char *])])])
911
Damien Millercd6853c2003-01-28 11:33:42 +1100912AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
913
Darren Tuckerf1159b52003-07-07 19:44:01 +1000914dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000915AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000916AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000917
Darren Tuckerb2427c82003-09-10 15:22:44 +1000918dnl tcsendbreak might be a macro
919AC_CHECK_DECL(tcsendbreak,
920 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100921 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000922 [#include <termios.h>]
923)
924
Darren Tucker5bb14002004-04-23 18:53:10 +1000925AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
926
Darren Tucker2a6b0292003-12-31 14:59:17 +1100927AC_CHECK_FUNCS(setresuid, [
928 dnl Some platorms have setresuid that isn't implemented, test for this
929 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000930 AC_RUN_IFELSE(
931 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100932#include <stdlib.h>
933#include <errno.h>
934int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000935 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100936 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100937 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000938 AC_MSG_RESULT(not implemented)],
939 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100940 )
941])
Darren Tuckere937be32003-12-17 18:53:26 +1100942
Darren Tucker2a6b0292003-12-31 14:59:17 +1100943AC_CHECK_FUNCS(setresgid, [
944 dnl Some platorms have setresgid that isn't implemented, test for this
945 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000946 AC_RUN_IFELSE(
947 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100948#include <stdlib.h>
949#include <errno.h>
950int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000951 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100952 [AC_MSG_RESULT(yes)],
953 [AC_DEFINE(BROKEN_SETRESGID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000954 AC_MSG_RESULT(not implemented)],
955 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100956 )
957])
Darren Tuckere937be32003-12-17 18:53:26 +1100958
Damien Millerad833b32000-08-23 10:46:23 +1000959dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000960AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000961dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000962AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000963AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000964dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000965AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000966AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100967
Damien Millera8e06ce2003-11-21 23:48:55 +1100968AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100969 [AC_DEFINE(HAVE_DAEMON)],
970 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
971)
972
Damien Millera8e06ce2003-11-21 23:48:55 +1100973AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100974 [AC_DEFINE(HAVE_GETPAGESIZE)],
975 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
976)
977
Damien Millercb170cb2000-07-01 16:52:55 +1000978# Check for broken snprintf
979if test "x$ac_cv_func_snprintf" = "xyes" ; then
980 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000981 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000982 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +1000983#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700984int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +1000985 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100986 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000987 [
988 AC_MSG_RESULT(no)
989 AC_DEFINE(BROKEN_SNPRINTF)
990 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000991 ],
992 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +1000993 )
994fi
995
Damien Millerb4097182004-05-23 14:09:40 +1000996# Check for missing getpeereid (or equiv) support
997NO_PEERCHECK=""
998if test "x$ac_cv_func_getpeereid" != "xyes" ; then
999 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1000 AC_TRY_COMPILE(
1001 [#include <sys/types.h>
1002 #include <sys/socket.h>],
1003 [int i = SO_PEERCRED;],
1004 [AC_MSG_RESULT(yes)],
1005 [AC_MSG_RESULT(no)
1006 NO_PEERCHECK=1]
1007 )
1008fi
1009
Damien Millere8328192003-01-07 15:18:32 +11001010dnl see whether mkstemp() requires XXXXXX
1011if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1012AC_MSG_CHECKING([for (overly) strict mkstemp])
1013AC_TRY_RUN(
1014 [
1015#include <stdlib.h>
1016main() { char template[]="conftest.mkstemp-test";
1017if (mkstemp(template) == -1)
1018 exit(1);
1019unlink(template); exit(0);
1020}
1021 ],
1022 [
1023 AC_MSG_RESULT(no)
1024 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001025 [
Damien Millere8328192003-01-07 15:18:32 +11001026 AC_MSG_RESULT(yes)
1027 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1028 ],
1029 [
1030 AC_MSG_RESULT(yes)
1031 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001032 ]
Damien Millere8328192003-01-07 15:18:32 +11001033)
1034fi
1035
Darren Tucker70a3d552003-08-21 17:58:29 +10001036dnl make sure that openpty does not reacquire controlling terminal
1037if test ! -z "$check_for_openpty_ctty_bug"; then
1038 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1039 AC_TRY_RUN(
1040 [
1041#include <stdio.h>
1042#include <sys/fcntl.h>
1043#include <sys/types.h>
1044#include <sys/wait.h>
1045
1046int
1047main()
1048{
1049 pid_t pid;
1050 int fd, ptyfd, ttyfd, status;
1051
1052 pid = fork();
1053 if (pid < 0) { /* failed */
1054 exit(1);
1055 } else if (pid > 0) { /* parent */
1056 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001057 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001058 exit(WEXITSTATUS(status));
1059 else
1060 exit(2);
1061 } else { /* child */
1062 close(0); close(1); close(2);
1063 setsid();
1064 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1065 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1066 if (fd >= 0)
1067 exit(3); /* Acquired ctty: broken */
1068 else
1069 exit(0); /* Did not acquire ctty: OK */
1070 }
1071}
1072 ],
1073 [
1074 AC_MSG_RESULT(yes)
1075 ],
1076 [
1077 AC_MSG_RESULT(no)
1078 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1079 ]
1080 )
1081fi
1082
Darren Tucker4398cf52004-04-06 21:39:02 +10001083if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1084 AC_MSG_CHECKING(if getaddrinfo seems to work)
1085 AC_TRY_RUN(
1086 [
1087#include <stdio.h>
1088#include <sys/socket.h>
1089#include <netdb.h>
1090#include <errno.h>
1091#include <netinet/in.h>
1092
1093#define TEST_PORT "2222"
1094
1095int
1096main(void)
1097{
1098 int err, sock;
1099 struct addrinfo *gai_ai, *ai, hints;
1100 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1101
1102 memset(&hints, 0, sizeof(hints));
1103 hints.ai_family = PF_UNSPEC;
1104 hints.ai_socktype = SOCK_STREAM;
1105 hints.ai_flags = AI_PASSIVE;
1106
1107 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1108 if (err != 0) {
1109 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1110 exit(1);
1111 }
1112
1113 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1114 if (ai->ai_family != AF_INET6)
1115 continue;
1116
1117 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1118 sizeof(ntop), strport, sizeof(strport),
1119 NI_NUMERICHOST|NI_NUMERICSERV);
1120
1121 if (err != 0) {
1122 if (err == EAI_SYSTEM)
1123 perror("getnameinfo EAI_SYSTEM");
1124 else
1125 fprintf(stderr, "getnameinfo failed: %s\n",
1126 gai_strerror(err));
1127 exit(2);
1128 }
1129
1130 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1131 if (sock < 0)
1132 perror("socket");
1133 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1134 if (errno == EBADF)
1135 exit(3);
1136 }
1137 }
1138 exit(0);
1139}
1140 ],
1141 [
1142 AC_MSG_RESULT(yes)
1143 ],
1144 [
1145 AC_MSG_RESULT(no)
1146 AC_DEFINE(BROKEN_GETADDRINFO)
1147 ]
1148 )
1149fi
1150
Darren Tuckera56f1912004-11-02 20:30:54 +11001151if test "x$check_for_conflicting_getspnam" = "x1"; then
1152 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1153 AC_COMPILE_IFELSE(
1154 [
1155#include <shadow.h>
1156int main(void) {exit(0);}
1157 ],
1158 [
1159 AC_MSG_RESULT(no)
1160 ],
1161 [
1162 AC_MSG_RESULT(yes)
1163 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1164 [Conflicting defs for getspnam])
1165 ]
1166 )
1167fi
1168
Damien Miller606f8802000-09-16 15:39:56 +11001169AC_FUNC_GETPGRP
1170
Damien Millera64b57a2001-01-17 10:44:13 +11001171# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001172PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001173AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001174 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001175 [
Damien Millera64b57a2001-01-17 10:44:13 +11001176 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001177 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1178 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001179 AC_MSG_ERROR([PAM headers not found])
1180 fi
1181
1182 AC_CHECK_LIB(dl, dlopen, , )
1183 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1184 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001185 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001186
Damien Millera64b57a2001-01-17 10:44:13 +11001187 PAM_MSG="yes"
1188
1189 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001190 if test $ac_cv_lib_dl_dlopen = yes; then
1191 LIBPAM="-lpam -ldl"
1192 else
1193 LIBPAM="-lpam"
1194 fi
1195 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001196 fi
1197 ]
1198)
Damien Millera22ba012000-03-02 23:09:20 +11001199
Damien Millera64b57a2001-01-17 10:44:13 +11001200# Check for older PAM
1201if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001202 # Check PAM strerror arguments (old PAM)
1203 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1204 AC_TRY_COMPILE(
1205 [
Damien Miller81171112000-04-23 11:14:01 +10001206#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001207#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001208#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001209#elif defined (HAVE_PAM_PAM_APPL_H)
1210#include <pam/pam_appl.h>
1211#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001212 ],
1213 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001214 [AC_MSG_RESULT(no)],
1215 [
1216 AC_DEFINE(HAVE_OLD_PAM)
1217 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001218 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001219 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001220 )
Damien Millera22ba012000-03-02 23:09:20 +11001221fi
1222
Tim Riceaef73712002-05-11 13:17:42 -07001223# Search for OpenSSL
1224saved_CPPFLAGS="$CPPFLAGS"
1225saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001226AC_ARG_WITH(ssl-dir,
1227 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1228 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001229 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001230 case "$withval" in
1231 # Relative paths
1232 ./*|../*) withval="`pwd`/$withval"
1233 esac
Tim Riceaef73712002-05-11 13:17:42 -07001234 if test -d "$withval/lib"; then
1235 if test -n "${need_dash_r}"; then
1236 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1237 else
1238 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1239 fi
1240 else
1241 if test -n "${need_dash_r}"; then
1242 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1243 else
1244 LDFLAGS="-L${withval} ${LDFLAGS}"
1245 fi
1246 fi
1247 if test -d "$withval/include"; then
1248 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1249 else
1250 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1251 fi
Damien Millera22ba012000-03-02 23:09:20 +11001252 fi
1253 ]
1254)
Tim Rice3d5352e2004-02-12 09:27:21 -08001255LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001256AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001257 [
Tim Riceaef73712002-05-11 13:17:42 -07001258 dnl Check default openssl install dir
1259 if test -n "${need_dash_r}"; then
1260 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001261 else
Tim Riceaef73712002-05-11 13:17:42 -07001262 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001263 fi
Tim Riceaef73712002-05-11 13:17:42 -07001264 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1265 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1266 [
1267 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1268 ]
1269 )
1270 ]
1271)
1272
Tim Riced730b782002-08-13 18:52:10 -07001273# Determine OpenSSL header version
1274AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001275AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001276 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001277#include <stdio.h>
1278#include <string.h>
1279#include <openssl/opensslv.h>
1280#define DATA "conftest.sslincver"
1281int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001282 FILE *fd;
1283 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001284
Damien Millera8e06ce2003-11-21 23:48:55 +11001285 fd = fopen(DATA,"w");
1286 if(fd == NULL)
1287 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001288
1289 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1290 exit(1);
1291
1292 exit(0);
1293}
Darren Tucker623d92f2004-09-12 22:36:15 +10001294 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001295 [
1296 ssl_header_ver=`cat conftest.sslincver`
1297 AC_MSG_RESULT($ssl_header_ver)
1298 ],
1299 [
1300 AC_MSG_RESULT(not found)
1301 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001302 ],
1303 [
1304 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001305 ]
1306)
1307
1308# Determine OpenSSL library version
1309AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001310AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001311 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001312#include <stdio.h>
1313#include <string.h>
1314#include <openssl/opensslv.h>
1315#include <openssl/crypto.h>
1316#define DATA "conftest.ssllibver"
1317int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001318 FILE *fd;
1319 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001320
Damien Millera8e06ce2003-11-21 23:48:55 +11001321 fd = fopen(DATA,"w");
1322 if(fd == NULL)
1323 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001324
1325 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1326 exit(1);
1327
1328 exit(0);
1329}
Darren Tucker623d92f2004-09-12 22:36:15 +10001330 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001331 [
1332 ssl_library_ver=`cat conftest.ssllibver`
1333 AC_MSG_RESULT($ssl_library_ver)
1334 ],
1335 [
1336 AC_MSG_RESULT(not found)
1337 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001338 ],
1339 [
1340 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001341 ]
1342)
Damien Millera22ba012000-03-02 23:09:20 +11001343
Damien Millerec932372002-01-22 22:16:03 +11001344# Sanity check OpenSSL headers
1345AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001346AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001347 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001348#include <string.h>
1349#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001350int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001351 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001352 [
1353 AC_MSG_RESULT(yes)
1354 ],
1355 [
1356 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001357 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1358Check config.log for details.
1359Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001360 ],
1361 [
1362 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001363 ]
1364)
1365
Tim Rice3d5352e2004-02-12 09:27:21 -08001366# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1367# because the system crypt() is more featureful.
1368if test "x$check_for_libcrypt_before" = "x1"; then
1369 AC_CHECK_LIB(crypt, crypt)
1370fi
1371
Damien Millera8e06ce2003-11-21 23:48:55 +11001372# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001373# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001374if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001375 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001376fi
1377
Damien Miller6c21c512002-01-22 21:57:53 +11001378
1379### Configure cryptographic random number support
1380
1381# Check wheter OpenSSL seeds itself
1382AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001383AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001384 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001385#include <string.h>
1386#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001387int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001388 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001389 [
1390 OPENSSL_SEEDS_ITSELF=yes
1391 AC_MSG_RESULT(yes)
1392 ],
1393 [
1394 AC_MSG_RESULT(no)
1395 # Default to use of the rand helper if OpenSSL doesn't
1396 # seed itself
1397 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001398 ],
1399 [
1400 AC_MSG_WARN([cross compiling: assuming yes])
1401 # This is safe, since all recent OpenSSL versions will
1402 # complain at runtime if not seeded correctly.
1403 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001404 ]
1405)
1406
1407
1408# Do we want to force the use of the rand helper?
1409AC_ARG_WITH(rand-helper,
1410 [ --with-rand-helper Use subprocess to gather strong randomness ],
1411 [
1412 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001413 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001414 # the previous test showed it to be unseeded.
1415 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1416 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1417 OPENSSL_SEEDS_ITSELF=yes
1418 USE_RAND_HELPER=""
1419 fi
1420 else
1421 USE_RAND_HELPER=yes
1422 fi
1423 ],
1424)
1425
1426# Which randomness source do we use?
1427if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1428 # OpenSSL only
1429 AC_DEFINE(OPENSSL_PRNG_ONLY)
1430 RAND_MSG="OpenSSL internal ONLY"
1431 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001432elif test ! -z "$USE_RAND_HELPER" ; then
1433 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001434 RAND_MSG="ssh-rand-helper"
1435 INSTALL_SSH_RAND_HELPER="yes"
1436fi
1437AC_SUBST(INSTALL_SSH_RAND_HELPER)
1438
1439### Configuration of ssh-rand-helper
1440
1441# PRNGD TCP socket
1442AC_ARG_WITH(prngd-port,
1443 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1444 [
Damien Millere996d722002-01-23 11:20:59 +11001445 case "$withval" in
1446 no)
1447 withval=""
1448 ;;
1449 [[0-9]]*)
1450 ;;
1451 *)
1452 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1453 ;;
1454 esac
1455 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001456 PRNGD_PORT="$withval"
1457 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1458 fi
1459 ]
1460)
1461
1462# PRNGD Unix domain socket
1463AC_ARG_WITH(prngd-socket,
1464 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1465 [
Damien Millere996d722002-01-23 11:20:59 +11001466 case "$withval" in
1467 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001468 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001469 ;;
1470 no)
1471 withval=""
1472 ;;
1473 /*)
1474 ;;
1475 *)
1476 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1477 ;;
1478 esac
1479
1480 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001481 if test ! -z "$PRNGD_PORT" ; then
1482 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1483 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001484 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001485 AC_MSG_WARN(Entropy socket is not readable)
1486 fi
1487 PRNGD_SOCKET="$withval"
1488 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1489 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001490 ],
1491 [
1492 # Check for existing socket only if we don't have a random device already
1493 if test "$USE_RAND_HELPER" = yes ; then
1494 AC_MSG_CHECKING(for PRNGD/EGD socket)
1495 # Insert other locations here
1496 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1497 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1498 PRNGD_SOCKET="$sock"
1499 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1500 break;
1501 fi
1502 done
1503 if test ! -z "$PRNGD_SOCKET" ; then
1504 AC_MSG_RESULT($PRNGD_SOCKET)
1505 else
1506 AC_MSG_RESULT(not found)
1507 fi
1508 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001509 ]
1510)
1511
1512# Change default command timeout for hashing entropy source
1513entropy_timeout=200
1514AC_ARG_WITH(entropy-timeout,
1515 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1516 [
1517 if test "x$withval" != "xno" ; then
1518 entropy_timeout=$withval
1519 fi
1520 ]
1521)
Damien Miller6c21c512002-01-22 21:57:53 +11001522AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1523
Damien Millerd3f6ad22002-06-25 10:24:47 +10001524SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001525AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001526 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001527 [
1528 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001529 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001530 fi
1531 ]
1532)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001533AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1534AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001535
Tim Rice88f2ab52002-03-17 12:17:34 -08001536# We do this little dance with the search path to insure
1537# that programs that we select for use by installed programs
1538# (which may be run by the super-user) come from trusted
1539# locations before they come from the user's private area.
1540# This should help avoid accidentally configuring some
1541# random version of a program in someone's personal bin.
1542
1543OPATH=$PATH
1544PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001545test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001546test -d /sbin && PATH=$PATH:/sbin
1547test -d /usr/sbin && PATH=$PATH:/usr/sbin
1548PATH=$PATH:/etc:$OPATH
1549
Damien Millera8e06ce2003-11-21 23:48:55 +11001550# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001551OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1552OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1553OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1554OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1555OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1556OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1557OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1558OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1559OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1560OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1561OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1562OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1563OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1564OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1565OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1566OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001567# restore PATH
1568PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001569
1570# Where does ssh-rand-helper get its randomness from?
1571INSTALL_SSH_PRNG_CMDS=""
1572if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1573 if test ! -z "$PRNGD_PORT" ; then
1574 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1575 elif test ! -z "$PRNGD_SOCKET" ; then
1576 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1577 else
1578 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1579 RAND_HELPER_CMDHASH=yes
1580 INSTALL_SSH_PRNG_CMDS="yes"
1581 fi
1582fi
1583AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1584
1585
Ben Lindstromb5628642000-10-18 00:02:25 +00001586# Cheap hack to ensure NEWS-OS libraries are arranged right.
1587if test ! -z "$SONY" ; then
1588 LIBS="$LIBS -liberty";
1589fi
1590
Damien Millera22ba012000-03-02 23:09:20 +11001591# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001592AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001593AC_CHECK_SIZEOF(short int, 2)
1594AC_CHECK_SIZEOF(int, 4)
1595AC_CHECK_SIZEOF(long int, 4)
1596AC_CHECK_SIZEOF(long long int, 8)
1597
Damien Millerfa2bb692002-04-23 23:22:25 +10001598# Sanity check long long for some platforms (AIX)
1599if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1600 ac_cv_sizeof_long_long_int=0
1601fi
1602
Damien Millera22ba012000-03-02 23:09:20 +11001603# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001604AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1605 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001606 [ #include <sys/types.h> ],
1607 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001608 [ ac_cv_have_u_int="yes" ],
1609 [ ac_cv_have_u_int="no" ]
1610 )
1611])
1612if test "x$ac_cv_have_u_int" = "xyes" ; then
1613 AC_DEFINE(HAVE_U_INT)
1614 have_u_int=1
1615fi
1616
Damien Miller61e50f12000-05-08 20:49:37 +10001617AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1618 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001619 [ #include <sys/types.h> ],
1620 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001621 [ ac_cv_have_intxx_t="yes" ],
1622 [ ac_cv_have_intxx_t="no" ]
1623 )
1624])
1625if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1626 AC_DEFINE(HAVE_INTXX_T)
1627 have_intxx_t=1
1628fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001629
1630if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001631 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001632then
1633 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1634 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001635 [ #include <stdint.h> ],
1636 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001637 [
1638 AC_DEFINE(HAVE_INTXX_T)
1639 AC_MSG_RESULT(yes)
1640 ],
1641 [ AC_MSG_RESULT(no) ]
1642 )
1643fi
1644
Damien Miller578783e2000-09-23 14:12:24 +11001645AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1646 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001647 [
1648#include <sys/types.h>
1649#ifdef HAVE_STDINT_H
1650# include <stdint.h>
1651#endif
1652#include <sys/socket.h>
1653#ifdef HAVE_SYS_BITYPES_H
1654# include <sys/bitypes.h>
1655#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001656 ],
1657 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001658 [ ac_cv_have_int64_t="yes" ],
1659 [ ac_cv_have_int64_t="no" ]
1660 )
1661])
1662if test "x$ac_cv_have_int64_t" = "xyes" ; then
1663 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001664fi
1665
Damien Miller61e50f12000-05-08 20:49:37 +10001666AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1667 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001668 [ #include <sys/types.h> ],
1669 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001670 [ ac_cv_have_u_intxx_t="yes" ],
1671 [ ac_cv_have_u_intxx_t="no" ]
1672 )
1673])
1674if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1675 AC_DEFINE(HAVE_U_INTXX_T)
1676 have_u_intxx_t=1
1677fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001678
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001679if test -z "$have_u_intxx_t" ; then
1680 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1681 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001682 [ #include <sys/socket.h> ],
1683 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001684 [
1685 AC_DEFINE(HAVE_U_INTXX_T)
1686 AC_MSG_RESULT(yes)
1687 ],
1688 [ AC_MSG_RESULT(no) ]
1689 )
1690fi
1691
Damien Miller578783e2000-09-23 14:12:24 +11001692AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1693 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001694 [ #include <sys/types.h> ],
1695 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001696 [ ac_cv_have_u_int64_t="yes" ],
1697 [ ac_cv_have_u_int64_t="no" ]
1698 )
1699])
1700if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1701 AC_DEFINE(HAVE_U_INT64_T)
1702 have_u_int64_t=1
1703fi
1704
Tim Rice4cec93f2002-02-26 08:40:48 -08001705if test -z "$have_u_int64_t" ; then
1706 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1707 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001708 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001709 [ u_int64_t a; a = 1],
1710 [
1711 AC_DEFINE(HAVE_U_INT64_T)
1712 AC_MSG_RESULT(yes)
1713 ],
1714 [ AC_MSG_RESULT(no) ]
1715 )
1716fi
1717
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001718if test -z "$have_u_intxx_t" ; then
1719 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1720 AC_TRY_COMPILE(
1721 [
1722#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001723 ],
1724 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001725 [ ac_cv_have_uintxx_t="yes" ],
1726 [ ac_cv_have_uintxx_t="no" ]
1727 )
1728 ])
1729 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1730 AC_DEFINE(HAVE_UINTXX_T)
1731 fi
1732fi
1733
1734if test -z "$have_uintxx_t" ; then
1735 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1736 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001737 [ #include <stdint.h> ],
1738 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001739 [
1740 AC_DEFINE(HAVE_UINTXX_T)
1741 AC_MSG_RESULT(yes)
1742 ],
1743 [ AC_MSG_RESULT(no) ]
1744 )
1745fi
1746
Damien Milleredb82922000-06-20 13:25:52 +10001747if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001748 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001749then
1750 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1751 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001752 [
1753#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001754 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001755 [
Damien Miller70494d12000-04-03 15:57:06 +10001756 int8_t a; int16_t b; int32_t c;
1757 u_int8_t e; u_int16_t f; u_int32_t g;
1758 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001759 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001760 [
1761 AC_DEFINE(HAVE_U_INTXX_T)
1762 AC_DEFINE(HAVE_INTXX_T)
1763 AC_MSG_RESULT(yes)
1764 ],
1765 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001766 )
Damien Millerb29ea912000-01-15 14:12:03 +11001767fi
1768
Damien Miller58be7382001-09-15 21:31:54 +10001769
1770AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1771 AC_TRY_COMPILE(
1772 [
1773#include <sys/types.h>
1774 ],
1775 [ u_char foo; foo = 125; ],
1776 [ ac_cv_have_u_char="yes" ],
1777 [ ac_cv_have_u_char="no" ]
1778 )
1779])
1780if test "x$ac_cv_have_u_char" = "xyes" ; then
1781 AC_DEFINE(HAVE_U_CHAR)
1782fi
1783
Tim Rice13aae5e2001-10-21 17:53:58 -07001784TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001785
Tim Rice200a5c02002-02-26 22:12:34 -08001786AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001787
Damien Miller61e50f12000-05-08 20:49:37 +10001788AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1789 AC_TRY_COMPILE(
1790 [
1791#include <sys/types.h>
1792 ],
1793 [ size_t foo; foo = 1235; ],
1794 [ ac_cv_have_size_t="yes" ],
1795 [ ac_cv_have_size_t="no" ]
1796 )
1797])
1798if test "x$ac_cv_have_size_t" = "xyes" ; then
1799 AC_DEFINE(HAVE_SIZE_T)
1800fi
Damien Miller95058511999-12-29 10:36:45 +11001801
Damien Miller615f9392000-05-17 22:53:33 +10001802AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1803 AC_TRY_COMPILE(
1804 [
1805#include <sys/types.h>
1806 ],
1807 [ ssize_t foo; foo = 1235; ],
1808 [ ac_cv_have_ssize_t="yes" ],
1809 [ ac_cv_have_ssize_t="no" ]
1810 )
1811])
1812if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1813 AC_DEFINE(HAVE_SSIZE_T)
1814fi
1815
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001816AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1817 AC_TRY_COMPILE(
1818 [
1819#include <time.h>
1820 ],
1821 [ clock_t foo; foo = 1235; ],
1822 [ ac_cv_have_clock_t="yes" ],
1823 [ ac_cv_have_clock_t="no" ]
1824 )
1825])
1826if test "x$ac_cv_have_clock_t" = "xyes" ; then
1827 AC_DEFINE(HAVE_CLOCK_T)
1828fi
1829
Damien Millerb54b40e2000-06-23 08:23:34 +10001830AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1831 AC_TRY_COMPILE(
1832 [
1833#include <sys/types.h>
1834#include <sys/socket.h>
1835 ],
1836 [ sa_family_t foo; foo = 1235; ],
1837 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001838 [ AC_TRY_COMPILE(
1839 [
1840#include <sys/types.h>
1841#include <sys/socket.h>
1842#include <netinet/in.h>
1843 ],
1844 [ sa_family_t foo; foo = 1235; ],
1845 [ ac_cv_have_sa_family_t="yes" ],
1846
Damien Millerb54b40e2000-06-23 08:23:34 +10001847 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001848 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001849 )
1850])
1851if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1852 AC_DEFINE(HAVE_SA_FAMILY_T)
1853fi
1854
Damien Miller0f91b4e2000-06-18 15:43:25 +10001855AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1856 AC_TRY_COMPILE(
1857 [
1858#include <sys/types.h>
1859 ],
1860 [ pid_t foo; foo = 1235; ],
1861 [ ac_cv_have_pid_t="yes" ],
1862 [ ac_cv_have_pid_t="no" ]
1863 )
1864])
1865if test "x$ac_cv_have_pid_t" = "xyes" ; then
1866 AC_DEFINE(HAVE_PID_T)
1867fi
1868
1869AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1870 AC_TRY_COMPILE(
1871 [
1872#include <sys/types.h>
1873 ],
1874 [ mode_t foo; foo = 1235; ],
1875 [ ac_cv_have_mode_t="yes" ],
1876 [ ac_cv_have_mode_t="no" ]
1877 )
1878])
1879if test "x$ac_cv_have_mode_t" = "xyes" ; then
1880 AC_DEFINE(HAVE_MODE_T)
1881fi
1882
Damien Miller61e50f12000-05-08 20:49:37 +10001883
1884AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1885 AC_TRY_COMPILE(
1886 [
Damien Miller81171112000-04-23 11:14:01 +10001887#include <sys/types.h>
1888#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001889 ],
1890 [ struct sockaddr_storage s; ],
1891 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1892 [ ac_cv_have_struct_sockaddr_storage="no" ]
1893 )
1894])
1895if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1896 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1897fi
Damien Miller34132e52000-01-14 15:45:46 +11001898
Damien Miller61e50f12000-05-08 20:49:37 +10001899AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1900 AC_TRY_COMPILE(
1901 [
Damien Miller7b22d652000-06-18 14:07:04 +10001902#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001903#include <netinet/in.h>
1904 ],
1905 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1906 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1907 [ ac_cv_have_struct_sockaddr_in6="no" ]
1908 )
1909])
1910if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1911 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1912fi
Damien Miller34132e52000-01-14 15:45:46 +11001913
Damien Miller61e50f12000-05-08 20:49:37 +10001914AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1915 AC_TRY_COMPILE(
1916 [
Damien Miller7b22d652000-06-18 14:07:04 +10001917#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001918#include <netinet/in.h>
1919 ],
1920 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1921 [ ac_cv_have_struct_in6_addr="yes" ],
1922 [ ac_cv_have_struct_in6_addr="no" ]
1923 )
1924])
1925if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1926 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1927fi
Damien Miller34132e52000-01-14 15:45:46 +11001928
Damien Miller61e50f12000-05-08 20:49:37 +10001929AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1930 AC_TRY_COMPILE(
1931 [
Damien Miller81171112000-04-23 11:14:01 +10001932#include <sys/types.h>
1933#include <sys/socket.h>
1934#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001935 ],
1936 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1937 [ ac_cv_have_struct_addrinfo="yes" ],
1938 [ ac_cv_have_struct_addrinfo="no" ]
1939 )
1940])
1941if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1942 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1943fi
1944
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001945AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1946 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001947 [ #include <sys/time.h> ],
1948 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001949 [ ac_cv_have_struct_timeval="yes" ],
1950 [ ac_cv_have_struct_timeval="no" ]
1951 )
1952])
1953if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1954 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1955 have_struct_timeval=1
1956fi
1957
Tim Rice4e4dc562003-03-18 10:21:40 -08001958AC_CHECK_TYPES(struct timespec)
1959
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001960# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001961if test "x$ac_cv_have_int64_t" = "xno" -a \
1962 "x$ac_cv_sizeof_long_int" != "x8" -a \
1963 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001964 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1965 echo "an alternative compiler (I.E., GCC) before continuing."
1966 echo ""
1967 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001968else
1969dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001970 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001971 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08001972#include <stdio.h>
1973#include <string.h>
1974#ifdef HAVE_SNPRINTF
1975main()
1976{
1977 char buf[50];
1978 char expected_out[50];
1979 int mazsize = 50 ;
1980#if (SIZEOF_LONG_INT == 8)
1981 long int num = 0x7fffffffffffffff;
1982#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001983 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001984#endif
1985 strcpy(expected_out, "9223372036854775807");
1986 snprintf(buf, mazsize, "%lld", num);
1987 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001988 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001989 exit(0);
1990}
1991#else
1992main() { exit(0); }
1993#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10001994 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10001995 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08001996 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001997fi
1998
Damien Miller78315eb2000-09-29 23:01:36 +11001999dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10002000OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2001OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2002OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2003OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2004OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002005OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002006OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2007OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002008OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002009OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2010OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2011OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2012OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002013OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2014OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2015OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2016OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002017
2018AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00002019
Damien Miller61e50f12000-05-08 20:49:37 +10002020AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2021 ac_cv_have_ss_family_in_struct_ss, [
2022 AC_TRY_COMPILE(
2023 [
Damien Miller81171112000-04-23 11:14:01 +10002024#include <sys/types.h>
2025#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002026 ],
2027 [ struct sockaddr_storage s; s.ss_family = 1; ],
2028 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2029 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2030 )
2031])
2032if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2033 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
2034fi
2035
Damien Miller61e50f12000-05-08 20:49:37 +10002036AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2037 ac_cv_have___ss_family_in_struct_ss, [
2038 AC_TRY_COMPILE(
2039 [
Damien Miller81171112000-04-23 11:14:01 +10002040#include <sys/types.h>
2041#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002042 ],
2043 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2044 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2045 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2046 )
2047])
2048if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2049 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
2050fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002051
Damien Millerad833b32000-08-23 10:46:23 +10002052AC_CACHE_CHECK([for pw_class field in struct passwd],
2053 ac_cv_have_pw_class_in_struct_passwd, [
2054 AC_TRY_COMPILE(
2055 [
Damien Millerad833b32000-08-23 10:46:23 +10002056#include <pwd.h>
2057 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002058 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002059 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2060 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2061 )
2062])
2063if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2064 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
2065fi
2066
Kevin Steves82456952001-06-22 21:14:18 +00002067AC_CACHE_CHECK([for pw_expire field in struct passwd],
2068 ac_cv_have_pw_expire_in_struct_passwd, [
2069 AC_TRY_COMPILE(
2070 [
2071#include <pwd.h>
2072 ],
2073 [ struct passwd p; p.pw_expire = 0; ],
2074 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2075 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2076 )
2077])
2078if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2079 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
2080fi
2081
2082AC_CACHE_CHECK([for pw_change field in struct passwd],
2083 ac_cv_have_pw_change_in_struct_passwd, [
2084 AC_TRY_COMPILE(
2085 [
2086#include <pwd.h>
2087 ],
2088 [ struct passwd p; p.pw_change = 0; ],
2089 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2090 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2091 )
2092])
2093if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2094 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
2095fi
Damien Miller61e50f12000-05-08 20:49:37 +10002096
Tim Rice28bbb0c2002-05-27 17:37:32 -07002097dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002098AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2099 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002100 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002101 [
Tim Riceae49fe62002-04-12 10:26:21 -07002102#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002103#include <sys/socket.h>
2104#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002105int main() {
2106#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002107#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002108exit(1);
2109#endif
2110struct msghdr m;
2111m.msg_accrights = 0;
2112exit(0);
2113}
Kevin Steves939c9db2002-03-22 17:23:25 +00002114 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002115 [ ac_cv_have_accrights_in_msghdr="yes" ],
2116 [ ac_cv_have_accrights_in_msghdr="no" ]
2117 )
2118])
2119if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2120 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2121fi
2122
Kevin Stevesa44e0352002-04-07 16:18:03 +00002123AC_CACHE_CHECK([for msg_control field in struct msghdr],
2124 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002125 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002126 [
Tim Riceae49fe62002-04-12 10:26:21 -07002127#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002128#include <sys/socket.h>
2129#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002130int main() {
2131#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002132#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002133exit(1);
2134#endif
2135struct msghdr m;
2136m.msg_control = 0;
2137exit(0);
2138}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002139 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002140 [ ac_cv_have_control_in_msghdr="yes" ],
2141 [ ac_cv_have_control_in_msghdr="no" ]
2142 )
2143])
2144if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2145 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2146fi
2147
Damien Miller61e50f12000-05-08 20:49:37 +10002148AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002149 AC_TRY_LINK([],
2150 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002151 [ ac_cv_libc_defines___progname="yes" ],
2152 [ ac_cv_libc_defines___progname="no" ]
2153 )
2154])
2155if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2156 AC_DEFINE(HAVE___PROGNAME)
2157fi
2158
Kevin Steves4846f4a2002-03-22 18:19:53 +00002159AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2160 AC_TRY_LINK([
2161#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002162],
2163 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002164 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2165 [ ac_cv_cc_implements___FUNCTION__="no" ]
2166 )
2167])
2168if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2169 AC_DEFINE(HAVE___FUNCTION__)
2170fi
2171
2172AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2173 AC_TRY_LINK([
2174#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002175],
2176 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002177 [ ac_cv_cc_implements___func__="yes" ],
2178 [ ac_cv_cc_implements___func__="no" ]
2179 )
2180])
2181if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2182 AC_DEFINE(HAVE___func__)
2183fi
2184
Damien Miller4f8e6692001-07-14 13:22:53 +10002185AC_CACHE_CHECK([whether getopt has optreset support],
2186 ac_cv_have_getopt_optreset, [
2187 AC_TRY_LINK(
2188 [
2189#include <getopt.h>
2190 ],
2191 [ extern int optreset; optreset = 0; ],
2192 [ ac_cv_have_getopt_optreset="yes" ],
2193 [ ac_cv_have_getopt_optreset="no" ]
2194 )
2195])
2196if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2197 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2198fi
Damien Millera22ba012000-03-02 23:09:20 +11002199
Damien Millerecbb26d2000-07-15 14:59:14 +10002200AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002201 AC_TRY_LINK([],
2202 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002203 [ ac_cv_libc_defines_sys_errlist="yes" ],
2204 [ ac_cv_libc_defines_sys_errlist="no" ]
2205 )
2206])
2207if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2208 AC_DEFINE(HAVE_SYS_ERRLIST)
2209fi
2210
2211
Damien Miller11fa2cc2000-08-16 10:35:58 +10002212AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002213 AC_TRY_LINK([],
2214 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002215 [ ac_cv_libc_defines_sys_nerr="yes" ],
2216 [ ac_cv_libc_defines_sys_nerr="no" ]
2217 )
2218])
2219if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2220 AC_DEFINE(HAVE_SYS_NERR)
2221fi
2222
Damien Millera8e06ce2003-11-21 23:48:55 +11002223SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002224# Check whether user wants sectok support
2225AC_ARG_WITH(sectok,
2226 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002227 [
2228 if test "x$withval" != "xno" ; then
2229 if test "x$withval" != "xyes" ; then
2230 CPPFLAGS="$CPPFLAGS -I${withval}"
2231 LDFLAGS="$LDFLAGS -L${withval}"
2232 if test ! -z "$need_dash_r" ; then
2233 LDFLAGS="$LDFLAGS -R${withval}"
2234 fi
2235 if test ! -z "$blibpath" ; then
2236 blibpath="$blibpath:${withval}"
2237 fi
2238 fi
2239 AC_CHECK_HEADERS(sectok.h)
2240 if test "$ac_cv_header_sectok_h" != yes; then
2241 AC_MSG_ERROR(Can't find sectok.h)
2242 fi
2243 AC_CHECK_LIB(sectok, sectok_open)
2244 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2245 AC_MSG_ERROR(Can't find libsectok)
2246 fi
2247 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002248 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002249 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002250 fi
2251 ]
2252)
2253
2254# Check whether user wants OpenSC support
2255AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002256 AC_HELP_STRING([--with-opensc=PFX],
2257 [Enable smartcard support using OpenSC]),
2258 opensc_config_prefix="$withval", opensc_config_prefix="")
2259if test x$opensc_config_prefix != x ; then
2260 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2261 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2262 if test "$OPENSC_CONFIG" != "no"; then
2263 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2264 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2265 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2266 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2267 AC_DEFINE(SMARTCARD)
2268 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002269 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002270 fi
2271fi
Damien Miller85de5802001-09-18 14:01:11 +10002272
Darren Tucker5f88d342003-10-15 16:57:57 +10002273# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002274AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002275 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002276 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002277 # Needed by our getrrsetbyname()
2278 AC_SEARCH_LIBS(res_query, resolv)
2279 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002280 AC_MSG_CHECKING(if res_query will link)
2281 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2282 [AC_MSG_RESULT(no)
2283 saved_LIBS="$LIBS"
2284 LIBS="$LIBS -lresolv"
2285 AC_MSG_CHECKING(for res_query in -lresolv)
2286 AC_LINK_IFELSE([
2287#include <resolv.h>
2288int main()
2289{
2290 res_query (0, 0, 0, 0, 0);
2291 return 0;
2292}
2293 ],
2294 [LIBS="$LIBS -lresolv"
2295 AC_MSG_RESULT(yes)],
2296 [LIBS="$saved_LIBS"
2297 AC_MSG_RESULT(no)])
2298 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002299 AC_CHECK_FUNCS(_getshort _getlong)
2300 AC_CHECK_MEMBER(HEADER.ad,
2301 [AC_DEFINE(HAVE_HEADER_AD)],,
2302 [#include <arpa/nameser.h>])
2303 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002304
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002305# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002306KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002307AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002308 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002309 [ if test "x$withval" != "xno" ; then
2310 if test "x$withval" = "xyes" ; then
2311 KRB5ROOT="/usr/local"
2312 else
2313 KRB5ROOT=${withval}
2314 fi
2315
2316 AC_DEFINE(KRB5)
2317 KRB5_MSG="yes"
2318
2319 AC_MSG_CHECKING(for krb5-config)
2320 if test -x $KRB5ROOT/bin/krb5-config ; then
2321 KRB5CONF=$KRB5ROOT/bin/krb5-config
2322 AC_MSG_RESULT($KRB5CONF)
2323
2324 AC_MSG_CHECKING(for gssapi support)
2325 if $KRB5CONF | grep gssapi >/dev/null ; then
2326 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002327 AC_DEFINE(GSSAPI)
2328 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002329 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002330 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002331 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002332 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002333 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2334 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002335 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002336 AC_MSG_CHECKING(whether we are using Heimdal)
2337 AC_TRY_COMPILE([ #include <krb5.h> ],
2338 [ char *tmp = heimdal_version; ],
2339 [ AC_MSG_RESULT(yes)
2340 AC_DEFINE(HEIMDAL) ],
2341 AC_MSG_RESULT(no)
2342 )
2343 else
2344 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002345 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002346 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002347 AC_MSG_CHECKING(whether we are using Heimdal)
2348 AC_TRY_COMPILE([ #include <krb5.h> ],
2349 [ char *tmp = heimdal_version; ],
2350 [ AC_MSG_RESULT(yes)
2351 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10002352 K5LIBS="-lkrb5 -ldes"
2353 K5LIBS="$K5LIBS -lcom_err -lasn1"
2354 AC_CHECK_LIB(roken, net_write,
2355 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11002356 ],
2357 [ AC_MSG_RESULT(no)
2358 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2359 ]
2360 )
Damien Miller200d0a72003-06-30 19:21:36 +10002361 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002362
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002363 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2364 [ AC_DEFINE(GSSAPI)
2365 K5LIBS="-lgssapi $K5LIBS" ],
2366 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2367 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002368 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002369 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2370 $K5LIBS)
2371 ],
2372 $K5LIBS)
2373
2374 AC_CHECK_HEADER(gssapi.h, ,
2375 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002376 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002377 AC_CHECK_HEADERS(gssapi.h, ,
2378 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002379 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002380 ]
2381 )
2382
2383 oldCPP="$CPPFLAGS"
2384 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2385 AC_CHECK_HEADER(gssapi_krb5.h, ,
2386 [ CPPFLAGS="$oldCPP" ])
2387
Damien Millera8e06ce2003-11-21 23:48:55 +11002388 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002389 if test ! -z "$need_dash_r" ; then
2390 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2391 fi
2392 if test ! -z "$blibpath" ; then
2393 blibpath="$blibpath:${KRB5ROOT}/lib"
2394 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002395 fi
2396
2397 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2398 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2399 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2400
2401 LIBS="$LIBS $K5LIBS"
2402 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
Ben Lindstroma8104b52004-04-07 04:16:11 +00002403 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
Darren Tucker0d27ed12004-02-24 10:37:33 +11002404 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002405)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002406
Damien Millera22ba012000-03-02 23:09:20 +11002407# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002408
Damien Millerf58c6722002-05-13 13:15:42 +10002409PRIVSEP_PATH=/var/empty
2410AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002411 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002412 [
2413 if test "x$withval" != "$no" ; then
2414 PRIVSEP_PATH=$withval
2415 fi
2416 ]
2417)
2418AC_SUBST(PRIVSEP_PATH)
2419
Damien Millera22ba012000-03-02 23:09:20 +11002420AC_ARG_WITH(xauth,
2421 [ --with-xauth=PATH Specify path to xauth program ],
2422 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002423 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002424 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002425 fi
2426 ],
2427 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002428 TestPath="$PATH"
2429 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2430 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2431 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2432 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2433 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002434 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002435 xauth_path="/usr/openwin/bin/xauth"
2436 fi
2437 ]
2438)
2439
Damien Miller7d901272003-01-13 16:55:22 +11002440STRIP_OPT=-s
2441AC_ARG_ENABLE(strip,
2442 [ --disable-strip Disable calling strip(1) on install],
2443 [
2444 if test "x$enableval" = "xno" ; then
2445 STRIP_OPT=
2446 fi
2447 ]
2448)
2449AC_SUBST(STRIP_OPT)
2450
Damien Millera19cf472000-11-29 13:28:50 +11002451if test -z "$xauth_path" ; then
2452 XAUTH_PATH="undefined"
2453 AC_SUBST(XAUTH_PATH)
2454else
Damien Millera22ba012000-03-02 23:09:20 +11002455 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002456 XAUTH_PATH=$xauth_path
2457 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002458fi
Damien Millera22ba012000-03-02 23:09:20 +11002459
2460# Check for mail directory (last resort if we cannot get it from headers)
2461if test ! -z "$MAIL" ; then
2462 maildir=`dirname $MAIL`
2463 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2464fi
2465
Darren Tucker623d92f2004-09-12 22:36:15 +10002466if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002467 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2468 disable_ptmx_check=yes
2469fi
Damien Millera22ba012000-03-02 23:09:20 +11002470if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002471 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002472 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002473 [
2474 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2475 have_dev_ptmx=1
2476 ]
2477 )
2478 fi
Damien Millera22ba012000-03-02 23:09:20 +11002479fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10002480
Darren Tucker623d92f2004-09-12 22:36:15 +10002481if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002482 AC_CHECK_FILE("/dev/ptc",
2483 [
2484 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2485 have_dev_ptc=1
2486 ]
2487 )
2488else
2489 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2490fi
Damien Miller204ad072000-03-02 23:56:12 +11002491
Damien Millera22ba012000-03-02 23:09:20 +11002492# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002493AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002494 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002495 [
Damien Miller897741e2001-04-16 10:41:46 +10002496 case "$withval" in
2497 man|cat|doc)
2498 MANTYPE=$withval
2499 ;;
2500 *)
2501 AC_MSG_ERROR(invalid man type: $withval)
2502 ;;
2503 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002504 ]
2505)
Ben Lindstrombc709922001-04-18 18:04:21 +00002506if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002507 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2508 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002509 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2510 MANTYPE=doc
2511 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2512 MANTYPE=man
2513 else
2514 MANTYPE=cat
2515 fi
2516fi
Damien Miller670a4b82000-01-22 13:53:11 +11002517AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002518if test "$MANTYPE" = "doc"; then
2519 mansubdir=man;
2520else
2521 mansubdir=$MANTYPE;
2522fi
2523AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002524
Damien Millera22ba012000-03-02 23:09:20 +11002525# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002526MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002527AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002528 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002529 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002530 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002531 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002532 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002533 fi
2534 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002535)
2536
Damien Millera22ba012000-03-02 23:09:20 +11002537# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002538AC_ARG_WITH(shadow,
2539 [ --without-shadow Disable shadow password support],
2540 [
2541 if test "x$withval" = "xno" ; then
2542 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002543 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002544 fi
2545 ]
2546)
2547
Damien Miller1f335fb2000-06-26 11:31:33 +10002548if test -z "$disable_shadow" ; then
2549 AC_MSG_CHECKING([if the systems has expire shadow information])
2550 AC_TRY_COMPILE(
2551 [
2552#include <sys/types.h>
2553#include <shadow.h>
2554 struct spwd sp;
2555 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2556 [ sp_expire_available=yes ], []
2557 )
2558
2559 if test "x$sp_expire_available" = "xyes" ; then
2560 AC_MSG_RESULT(yes)
2561 AC_DEFINE(HAS_SHADOW_EXPIRE)
2562 else
2563 AC_MSG_RESULT(no)
2564 fi
2565fi
2566
Damien Millera22ba012000-03-02 23:09:20 +11002567# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002568if test ! -z "$IPADDR_IN_DISPLAY" ; then
2569 DISPLAY_HACK_MSG="yes"
2570 AC_DEFINE(IPADDR_IN_DISPLAY)
2571else
Damien Millera8e06ce2003-11-21 23:48:55 +11002572 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002573 AC_ARG_WITH(ipaddr-display,
2574 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2575 [
2576 if test "x$withval" != "xno" ; then
2577 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002578 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002579 fi
2580 ]
2581 )
2582fi
Damien Miller76112de1999-12-21 11:18:08 +11002583
Darren Tuckere1a790d2003-09-16 11:52:19 +10002584# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002585AC_ARG_ENABLE(etc-default-login,
Darren Tucker2f9573d2005-02-10 22:28:54 +11002586 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
2587 [ if test "x$enableval" = "xno"; then
2588 AC_MSG_NOTICE([/etc/default/login handling disabled])
2589 etc_default_login=no
2590 else
2591 etc_default_login=yes
2592 fi ],
2593 [ etc_default_login=yes ]
2594)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002595
Darren Tucker2f9573d2005-02-10 22:28:54 +11002596if test "x$etc_default_login" != "xno"; then
2597 AC_CHECK_FILE("/etc/default/login",
2598 [ external_path_file=/etc/default/login ])
Darren Tucker623d92f2004-09-12 22:36:15 +10002599 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2600 then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002601 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2602 elif test "x$external_path_file" = "x/etc/default/login"; then
2603 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2604 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11002605fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002606
Tim Rice43a1c132002-04-17 21:19:14 -07002607dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2608if test $ac_cv_func_login_getcapbool = "yes" -a \
2609 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002610 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002611fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002612
Damien Millera22ba012000-03-02 23:09:20 +11002613# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002614SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002615AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002616 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002617 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002618 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002619 AC_MSG_WARN([
2620--with-default-path=PATH has no effect on this system.
2621Edit /etc/login.conf instead.])
2622 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002623 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002624 AC_MSG_WARN([
2625--with-default-path=PATH will only be used if PATH is not defined in
2626$external_path_file .])
2627 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002628 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002629 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002630 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002631 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002632 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2633 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002634 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002635 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002636 AC_MSG_WARN([
2637If PATH is defined in $external_path_file, ensure the path to scp is included,
2638otherwise scp will not work.])
2639 fi
2640 AC_TRY_RUN(
2641 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002642/* find out what STDPATH is */
2643#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002644#ifdef HAVE_PATHS_H
2645# include <paths.h>
2646#endif
2647#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002648# ifdef _PATH_USERPATH /* Irix */
2649# define _PATH_STDPATH _PATH_USERPATH
2650# else
2651# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2652# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002653#endif
2654#include <sys/types.h>
2655#include <sys/stat.h>
2656#include <fcntl.h>
2657#define DATA "conftest.stdpath"
2658
2659main()
2660{
2661 FILE *fd;
2662 int rc;
2663
2664 fd = fopen(DATA,"w");
2665 if(fd == NULL)
2666 exit(1);
2667
2668 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2669 exit(1);
2670
2671 exit(0);
2672}
2673 ], [ user_path=`cat conftest.stdpath` ],
2674 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2675 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2676 )
2677# make sure $bindir is in USER_PATH so scp will work
2678 t_bindir=`eval echo ${bindir}`
2679 case $t_bindir in
2680 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2681 esac
2682 case $t_bindir in
2683 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2684 esac
2685 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2686 if test $? -ne 0 ; then
2687 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2688 if test $? -ne 0 ; then
2689 user_path=$user_path:$t_bindir
2690 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2691 fi
2692 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002693 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002694)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002695if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002696 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2697 AC_SUBST(user_path)
2698fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002699
Damien Millera18bbd32002-05-13 10:48:57 +10002700# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002701AC_ARG_WITH(superuser-path,
2702 [ --with-superuser-path= Specify different path for super-user],
2703 [
2704 if test "x$withval" != "xno" ; then
2705 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2706 superuser_path=$withval
2707 fi
2708 ]
2709)
2710
2711
Damien Miller61e50f12000-05-08 20:49:37 +10002712AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002713IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002714AC_ARG_WITH(4in6,
2715 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2716 [
2717 if test "x$withval" != "xno" ; then
2718 AC_MSG_RESULT(yes)
2719 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002720 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002721 else
2722 AC_MSG_RESULT(no)
2723 fi
2724 ],[
2725 if test "x$inet6_default_4in6" = "xyes"; then
2726 AC_MSG_RESULT([yes (default)])
2727 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002728 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002729 else
2730 AC_MSG_RESULT([no (default)])
2731 fi
2732 ]
2733)
2734
Damien Miller60396b02001-02-18 17:01:00 +11002735# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002736BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002737AC_ARG_WITH(bsd-auth,
2738 [ --with-bsd-auth Enable BSD auth support],
2739 [
2740 if test "x$withval" != "xno" ; then
2741 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002742 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002743 fi
2744 ]
2745)
2746
Damien Millera22ba012000-03-02 23:09:20 +11002747# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002748piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002749# make sure the directory exists
2750if test ! -d $piddir ; then
2751 piddir=`eval echo ${sysconfdir}`
2752 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002753 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002754 esac
2755fi
2756
Tim Rice88f2ab52002-03-17 12:17:34 -08002757AC_ARG_WITH(pid-dir,
2758 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2759 [
2760 if test "x$withval" != "xno" ; then
2761 piddir=$withval
2762 if test ! -d $piddir ; then
2763 AC_MSG_WARN([** no $piddir directory on this system **])
2764 fi
2765 fi
2766 ]
2767)
2768
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002769AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002770AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002771
andre2ff7b5d2000-06-03 14:57:40 +00002772dnl allow user to disable some login recording features
2773AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002774 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002775 [
2776 if test "x$enableval" = "xno" ; then
2777 AC_DEFINE(DISABLE_LASTLOG)
2778 fi
2779 ]
andre2ff7b5d2000-06-03 14:57:40 +00002780)
2781AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002782 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002783 [
2784 if test "x$enableval" = "xno" ; then
2785 AC_DEFINE(DISABLE_UTMP)
2786 fi
2787 ]
andre2ff7b5d2000-06-03 14:57:40 +00002788)
2789AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002790 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002791 [
2792 if test "x$enableval" = "xno" ; then
2793 AC_DEFINE(DISABLE_UTMPX)
2794 fi
2795 ]
andre2ff7b5d2000-06-03 14:57:40 +00002796)
2797AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002798 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002799 [
2800 if test "x$enableval" = "xno" ; then
2801 AC_DEFINE(DISABLE_WTMP)
2802 fi
2803 ]
andre2ff7b5d2000-06-03 14:57:40 +00002804)
2805AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002806 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002807 [
2808 if test "x$enableval" = "xno" ; then
2809 AC_DEFINE(DISABLE_WTMPX)
2810 fi
2811 ]
andre2ff7b5d2000-06-03 14:57:40 +00002812)
2813AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002814 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002815 [
2816 if test "x$enableval" = "xno" ; then
2817 AC_DEFINE(DISABLE_LOGIN)
2818 fi
2819 ]
andre2ff7b5d2000-06-03 14:57:40 +00002820)
2821AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002822 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002823 [
2824 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002825 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002826 fi
2827 ]
andre2ff7b5d2000-06-03 14:57:40 +00002828)
2829AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002830 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002831 [
2832 if test "x$enableval" = "xno" ; then
2833 AC_DEFINE(DISABLE_PUTUTXLINE)
2834 fi
2835 ]
andre2ff7b5d2000-06-03 14:57:40 +00002836)
2837AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002838 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002839 [
2840 if test "x$withval" = "xno" ; then
2841 AC_DEFINE(DISABLE_LASTLOG)
2842 else
2843 conf_lastlog_location=$withval
2844 fi
2845 ]
2846)
andre2ff7b5d2000-06-03 14:57:40 +00002847
2848dnl lastlog, [uw]tmpx? detection
2849dnl NOTE: set the paths in the platform section to avoid the
2850dnl need for command-line parameters
2851dnl lastlog and [uw]tmp are subject to a file search if all else fails
2852
2853dnl lastlog detection
2854dnl NOTE: the code itself will detect if lastlog is a directory
2855AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2856AC_TRY_COMPILE([
2857#include <sys/types.h>
2858#include <utmp.h>
2859#ifdef HAVE_LASTLOG_H
2860# include <lastlog.h>
2861#endif
Damien Miller2994e082000-06-04 15:51:47 +10002862#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002863# include <paths.h>
2864#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002865#ifdef HAVE_LOGIN_H
2866# include <login.h>
2867#endif
andre2ff7b5d2000-06-03 14:57:40 +00002868 ],
2869 [ char *lastlog = LASTLOG_FILE; ],
2870 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002871 [
2872 AC_MSG_RESULT(no)
2873 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2874 AC_TRY_COMPILE([
2875#include <sys/types.h>
2876#include <utmp.h>
2877#ifdef HAVE_LASTLOG_H
2878# include <lastlog.h>
2879#endif
2880#ifdef HAVE_PATHS_H
2881# include <paths.h>
2882#endif
2883 ],
2884 [ char *lastlog = _PATH_LASTLOG; ],
2885 [ AC_MSG_RESULT(yes) ],
2886 [
andree441aa32000-06-12 22:34:38 +00002887 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002888 system_lastlog_path=no
2889 ])
2890 ]
andre2ff7b5d2000-06-03 14:57:40 +00002891)
Damien Miller2994e082000-06-04 15:51:47 +10002892
andre2ff7b5d2000-06-03 14:57:40 +00002893if test -z "$conf_lastlog_location"; then
2894 if test x"$system_lastlog_path" = x"no" ; then
2895 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002896 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002897 conf_lastlog_location=$f
2898 fi
2899 done
2900 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002901 AC_MSG_WARN([** Cannot find lastlog **])
2902 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002903 fi
2904 fi
2905fi
2906
2907if test -n "$conf_lastlog_location"; then
2908 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2909fi
2910
2911dnl utmp detection
2912AC_MSG_CHECKING([if your system defines UTMP_FILE])
2913AC_TRY_COMPILE([
2914#include <sys/types.h>
2915#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002916#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002917# include <paths.h>
2918#endif
2919 ],
2920 [ char *utmp = UTMP_FILE; ],
2921 [ AC_MSG_RESULT(yes) ],
2922 [ AC_MSG_RESULT(no)
2923 system_utmp_path=no ]
2924)
2925if test -z "$conf_utmp_location"; then
2926 if test x"$system_utmp_path" = x"no" ; then
2927 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2928 if test -f $f ; then
2929 conf_utmp_location=$f
2930 fi
2931 done
2932 if test -z "$conf_utmp_location"; then
2933 AC_DEFINE(DISABLE_UTMP)
2934 fi
2935 fi
2936fi
2937if test -n "$conf_utmp_location"; then
2938 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2939fi
2940
2941dnl wtmp detection
2942AC_MSG_CHECKING([if your system defines WTMP_FILE])
2943AC_TRY_COMPILE([
2944#include <sys/types.h>
2945#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002946#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002947# include <paths.h>
2948#endif
2949 ],
2950 [ char *wtmp = WTMP_FILE; ],
2951 [ AC_MSG_RESULT(yes) ],
2952 [ AC_MSG_RESULT(no)
2953 system_wtmp_path=no ]
2954)
2955if test -z "$conf_wtmp_location"; then
2956 if test x"$system_wtmp_path" = x"no" ; then
2957 for f in /usr/adm/wtmp /var/log/wtmp; do
2958 if test -f $f ; then
2959 conf_wtmp_location=$f
2960 fi
2961 done
2962 if test -z "$conf_wtmp_location"; then
2963 AC_DEFINE(DISABLE_WTMP)
2964 fi
2965 fi
2966fi
2967if test -n "$conf_wtmp_location"; then
2968 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2969fi
2970
2971
2972dnl utmpx detection - I don't know any system so perverse as to require
2973dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2974dnl there, though.
2975AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2976AC_TRY_COMPILE([
2977#include <sys/types.h>
2978#include <utmp.h>
2979#ifdef HAVE_UTMPX_H
2980#include <utmpx.h>
2981#endif
Damien Miller2994e082000-06-04 15:51:47 +10002982#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002983# include <paths.h>
2984#endif
2985 ],
2986 [ char *utmpx = UTMPX_FILE; ],
2987 [ AC_MSG_RESULT(yes) ],
2988 [ AC_MSG_RESULT(no)
2989 system_utmpx_path=no ]
2990)
2991if test -z "$conf_utmpx_location"; then
2992 if test x"$system_utmpx_path" = x"no" ; then
2993 AC_DEFINE(DISABLE_UTMPX)
2994 fi
2995else
2996 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2997fi
2998
2999dnl wtmpx detection
3000AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3001AC_TRY_COMPILE([
3002#include <sys/types.h>
3003#include <utmp.h>
3004#ifdef HAVE_UTMPX_H
3005#include <utmpx.h>
3006#endif
Damien Miller2994e082000-06-04 15:51:47 +10003007#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003008# include <paths.h>
3009#endif
3010 ],
3011 [ char *wtmpx = WTMPX_FILE; ],
3012 [ AC_MSG_RESULT(yes) ],
3013 [ AC_MSG_RESULT(no)
3014 system_wtmpx_path=no ]
3015)
3016if test -z "$conf_wtmpx_location"; then
3017 if test x"$system_wtmpx_path" = x"no" ; then
3018 AC_DEFINE(DISABLE_WTMPX)
3019 fi
3020else
3021 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
3022fi
3023
Damien Miller4018c192000-04-30 09:30:44 +10003024
Damien Miller29ea30d2000-03-17 10:54:15 +11003025if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003026 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3027 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003028fi
3029
Tim Rice4cec93f2002-02-26 08:40:48 -08003030dnl remove pam and dl because they are in $LIBPAM
3031if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003032 LIBS=`echo $LIBS | sed 's/-lpam //'`
3033fi
3034if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3035 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003036fi
3037
Damien Millerbac2d8a2000-09-05 16:13:06 +11003038AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003039AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3040 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003041AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003042
Damien Miller7b22d652000-06-18 14:07:04 +10003043# Print summary of options
3044
Damien Miller7b22d652000-06-18 14:07:04 +10003045# Someone please show me a better way :)
3046A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3047B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3048C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3049D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003050E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003051F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003052G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003053H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3054I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3055J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003056
3057echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003058echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003059echo " User binaries: $B"
3060echo " System binaries: $C"
3061echo " Configuration files: $D"
3062echo " Askpass program: $E"
3063echo " Manual pages: $F"
3064echo " PID file: $G"
3065echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003066if test "x$external_path_file" = "x/etc/login.conf" ; then
3067echo " At runtime, sshd will use the path defined in $external_path_file"
3068echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003069else
Damien Millerf58c6722002-05-13 13:15:42 +10003070echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003071 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003072echo " (If PATH is set in $external_path_file it will be used instead. If"
3073echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3074 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003075fi
Damien Millera18bbd32002-05-13 10:48:57 +10003076if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003077echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003078fi
Damien Millerf58c6722002-05-13 13:15:42 +10003079echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003080echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003081echo " KerberosV support: $KRB5_MSG"
3082echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003083echo " S/KEY support: $SKEY_MSG"
3084echo " TCP Wrappers support: $TCPW_MSG"
3085echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003086echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003087echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003088echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3089echo " BSD Auth support: $BSD_AUTH_MSG"
3090echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003091if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003092echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003093fi
3094
Damien Miller7b22d652000-06-18 14:07:04 +10003095echo ""
3096
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003097echo " Host: ${host}"
3098echo " Compiler: ${CC}"
3099echo " Compiler flags: ${CFLAGS}"
3100echo "Preprocessor flags: ${CPPFLAGS}"
3101echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003102echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003103
3104echo ""
3105
Tim Rice6f1f7582004-05-30 21:38:51 -07003106if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003107 echo "SVR4 style packages are supported with \"make package\""
3108 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003109fi
3110
Damien Miller82cf0ce2000-12-20 13:34:48 +11003111if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003112 echo "PAM is enabled. You may need to install a PAM control file "
3113 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003114 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003115 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003116 echo ""
3117fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003118
Damien Miller6c21c512002-01-22 21:57:53 +11003119if test ! -z "$RAND_HELPER_CMDHASH" ; then
3120 echo "WARNING: you are using the builtin random number collection "
3121 echo "service. Please read WARNING.RNG and request that your OS "
3122 echo "vendor includes kernel-based random number collection in "
3123 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003124 echo ""
3125fi
Damien Miller60396b02001-02-18 17:01:00 +11003126
Damien Millerb4097182004-05-23 14:09:40 +10003127if test ! -z "$NO_PEERCHECK" ; then
3128 echo "WARNING: the operating system that you are using does not "
3129 echo "appear to support either the getpeereid() API nor the "
3130 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3131 echo "enforce security checks to prevent unauthorised connections to "
3132 echo "ssh-agent. Their absence increases the risk that a malicious "
3133 echo "user can connect to your agent. "
3134 echo ""
3135fi
3136