blob: 2df8a5e87dd4ec75cc24edb540f5c64e61fd5d39 [file] [log] [blame]
Darren Tucker1b6f2292005-02-11 16:11:49 +11001# $Id: configure.ac,v 1.241 2005/02/11 05:11:49 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,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100769 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100770 [
771 if test "x$withval" != "xno" ; then
772
773 if test "x$withval" != "xyes" ; then
774 CPPFLAGS="$CPPFLAGS -I${withval}/include"
775 LDFLAGS="$LDFLAGS -L${withval}/lib"
776 fi
777
778 AC_DEFINE(SKEY)
779 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100780 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100781
Tim Rice4cec93f2002-02-26 08:40:48 -0800782 AC_MSG_CHECKING([for s/key support])
783 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100784 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800785#include <stdio.h>
786#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700787int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800788 ],
789 [AC_MSG_RESULT(yes)],
790 [
791 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100792 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
793 ])
Darren Tucker3b908f62004-04-14 15:26:39 +1000794 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
795 AC_TRY_COMPILE(
796 [#include <stdio.h>
797 #include <skey.h>],
798 [(void)skeychallenge(NULL,"name","",0);],
799 [AC_MSG_RESULT(yes)
800 AC_DEFINE(SKEYCHALLENGE_4ARG)],
801 [AC_MSG_RESULT(no)]
802 )
Damien Millerc547bf12001-02-16 10:18:12 +1100803 fi
804 ]
805)
806
807# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700808TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100809AC_ARG_WITH(tcp-wrappers,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100810 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100811 [
812 if test "x$withval" != "xno" ; then
813 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700814 saved_LDFLAGS="$LDFLAGS"
815 saved_CPPFLAGS="$CPPFLAGS"
816 if test -n "${withval}" -a "${withval}" != "yes"; then
817 if test -d "${withval}/lib"; then
818 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700819 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700820 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700821 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700822 fi
823 else
824 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700825 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700826 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700827 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700828 fi
829 fi
830 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700831 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700832 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700833 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700834 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700835 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800836 LIBWRAP="-lwrap"
837 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100838 AC_MSG_CHECKING(for libwrap)
839 AC_TRY_LINK(
840 [
Damien Miller0ac45002004-04-14 20:14:26 +1000841#include <sys/types.h>
842#include <sys/socket.h>
843#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +1100844#include <tcpd.h>
845 int deny_severity = 0, allow_severity = 0;
846 ],
847 [hosts_access(0);],
848 [
849 AC_MSG_RESULT(yes)
850 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800851 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700852 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100853 ],
854 [
855 AC_MSG_ERROR([*** libwrap missing])
856 ]
857 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800858 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100859 fi
860 ]
861)
862
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100863# Check whether user wants libedit support
864LIBEDIT_MSG="no"
865AC_ARG_WITH(libedit,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100866 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100867 [ if test "x$withval" != "xno" ; then
868 AC_CHECK_LIB(edit, el_init,
869 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
870 LIBEDIT="-ledit -lcurses"
871 LIBEDIT_MSG="yes"
872 AC_SUBST(LIBEDIT)
873 ],
874 [], [-lcurses]
875 )
876 fi ]
877)
878
Damien Millerfe1f1432003-02-24 15:45:42 +1100879dnl Checks for library functions. Please keep in alphabetical order
880AC_CHECK_FUNCS(\
Darren Tucker60bd4092004-06-25 14:03:34 +1000881 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
Darren Tuckerad7646a2005-02-02 10:43:59 +1100882 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
883 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
884 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100885 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000886 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100887 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000888 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100889 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000890 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000891 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100892 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100893)
Tim Rice13aae5e2001-10-21 17:53:58 -0700894
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000895# IRIX has a const char return value for gai_strerror()
896AC_CHECK_FUNCS(gai_strerror,[
897 AC_DEFINE(HAVE_GAI_STRERROR)
898 AC_TRY_COMPILE([
899#include <sys/types.h>
900#include <sys/socket.h>
901#include <netdb.h>
902
903const char *gai_strerror(int);],[
904char *str;
905
906str = gai_strerror(0);],[
907 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
908 [Define if gai_strerror() returns const char *])])])
909
Damien Millercd6853c2003-01-28 11:33:42 +1100910AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
911
Darren Tuckerf1159b52003-07-07 19:44:01 +1000912dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000913AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000914AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000915
Darren Tuckerb2427c82003-09-10 15:22:44 +1000916dnl tcsendbreak might be a macro
917AC_CHECK_DECL(tcsendbreak,
918 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100919 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000920 [#include <termios.h>]
921)
922
Darren Tucker5bb14002004-04-23 18:53:10 +1000923AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
924
Darren Tucker2a6b0292003-12-31 14:59:17 +1100925AC_CHECK_FUNCS(setresuid, [
926 dnl Some platorms have setresuid that isn't implemented, test for this
927 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000928 AC_RUN_IFELSE(
929 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100930#include <stdlib.h>
931#include <errno.h>
932int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000933 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100934 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100935 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000936 AC_MSG_RESULT(not implemented)],
937 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100938 )
939])
Darren Tuckere937be32003-12-17 18:53:26 +1100940
Darren Tucker2a6b0292003-12-31 14:59:17 +1100941AC_CHECK_FUNCS(setresgid, [
942 dnl Some platorms have setresgid that isn't implemented, test for this
943 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000944 AC_RUN_IFELSE(
945 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100946#include <stdlib.h>
947#include <errno.h>
948int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000949 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100950 [AC_MSG_RESULT(yes)],
951 [AC_DEFINE(BROKEN_SETRESGID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000952 AC_MSG_RESULT(not implemented)],
953 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100954 )
955])
Darren Tuckere937be32003-12-17 18:53:26 +1100956
Damien Millerad833b32000-08-23 10:46:23 +1000957dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000958AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000959dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000960AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000961AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000962dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000963AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000964AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100965
Damien Millera8e06ce2003-11-21 23:48:55 +1100966AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100967 [AC_DEFINE(HAVE_DAEMON)],
968 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
969)
970
Damien Millera8e06ce2003-11-21 23:48:55 +1100971AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100972 [AC_DEFINE(HAVE_GETPAGESIZE)],
973 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
974)
975
Damien Millercb170cb2000-07-01 16:52:55 +1000976# Check for broken snprintf
977if test "x$ac_cv_func_snprintf" = "xyes" ; then
978 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000979 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000980 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +1000981#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700982int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +1000983 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100984 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000985 [
986 AC_MSG_RESULT(no)
987 AC_DEFINE(BROKEN_SNPRINTF)
988 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000989 ],
990 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +1000991 )
992fi
993
Damien Millerb4097182004-05-23 14:09:40 +1000994# Check for missing getpeereid (or equiv) support
995NO_PEERCHECK=""
996if test "x$ac_cv_func_getpeereid" != "xyes" ; then
997 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
998 AC_TRY_COMPILE(
999 [#include <sys/types.h>
1000 #include <sys/socket.h>],
1001 [int i = SO_PEERCRED;],
1002 [AC_MSG_RESULT(yes)],
1003 [AC_MSG_RESULT(no)
1004 NO_PEERCHECK=1]
1005 )
1006fi
1007
Damien Millere8328192003-01-07 15:18:32 +11001008dnl see whether mkstemp() requires XXXXXX
1009if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1010AC_MSG_CHECKING([for (overly) strict mkstemp])
1011AC_TRY_RUN(
1012 [
1013#include <stdlib.h>
1014main() { char template[]="conftest.mkstemp-test";
1015if (mkstemp(template) == -1)
1016 exit(1);
1017unlink(template); exit(0);
1018}
1019 ],
1020 [
1021 AC_MSG_RESULT(no)
1022 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001023 [
Damien Millere8328192003-01-07 15:18:32 +11001024 AC_MSG_RESULT(yes)
1025 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1026 ],
1027 [
1028 AC_MSG_RESULT(yes)
1029 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001030 ]
Damien Millere8328192003-01-07 15:18:32 +11001031)
1032fi
1033
Darren Tucker70a3d552003-08-21 17:58:29 +10001034dnl make sure that openpty does not reacquire controlling terminal
1035if test ! -z "$check_for_openpty_ctty_bug"; then
1036 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1037 AC_TRY_RUN(
1038 [
1039#include <stdio.h>
1040#include <sys/fcntl.h>
1041#include <sys/types.h>
1042#include <sys/wait.h>
1043
1044int
1045main()
1046{
1047 pid_t pid;
1048 int fd, ptyfd, ttyfd, status;
1049
1050 pid = fork();
1051 if (pid < 0) { /* failed */
1052 exit(1);
1053 } else if (pid > 0) { /* parent */
1054 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001055 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001056 exit(WEXITSTATUS(status));
1057 else
1058 exit(2);
1059 } else { /* child */
1060 close(0); close(1); close(2);
1061 setsid();
1062 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1063 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1064 if (fd >= 0)
1065 exit(3); /* Acquired ctty: broken */
1066 else
1067 exit(0); /* Did not acquire ctty: OK */
1068 }
1069}
1070 ],
1071 [
1072 AC_MSG_RESULT(yes)
1073 ],
1074 [
1075 AC_MSG_RESULT(no)
1076 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1077 ]
1078 )
1079fi
1080
Darren Tucker4398cf52004-04-06 21:39:02 +10001081if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1082 AC_MSG_CHECKING(if getaddrinfo seems to work)
1083 AC_TRY_RUN(
1084 [
1085#include <stdio.h>
1086#include <sys/socket.h>
1087#include <netdb.h>
1088#include <errno.h>
1089#include <netinet/in.h>
1090
1091#define TEST_PORT "2222"
1092
1093int
1094main(void)
1095{
1096 int err, sock;
1097 struct addrinfo *gai_ai, *ai, hints;
1098 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1099
1100 memset(&hints, 0, sizeof(hints));
1101 hints.ai_family = PF_UNSPEC;
1102 hints.ai_socktype = SOCK_STREAM;
1103 hints.ai_flags = AI_PASSIVE;
1104
1105 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1106 if (err != 0) {
1107 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1108 exit(1);
1109 }
1110
1111 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1112 if (ai->ai_family != AF_INET6)
1113 continue;
1114
1115 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1116 sizeof(ntop), strport, sizeof(strport),
1117 NI_NUMERICHOST|NI_NUMERICSERV);
1118
1119 if (err != 0) {
1120 if (err == EAI_SYSTEM)
1121 perror("getnameinfo EAI_SYSTEM");
1122 else
1123 fprintf(stderr, "getnameinfo failed: %s\n",
1124 gai_strerror(err));
1125 exit(2);
1126 }
1127
1128 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1129 if (sock < 0)
1130 perror("socket");
1131 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1132 if (errno == EBADF)
1133 exit(3);
1134 }
1135 }
1136 exit(0);
1137}
1138 ],
1139 [
1140 AC_MSG_RESULT(yes)
1141 ],
1142 [
1143 AC_MSG_RESULT(no)
1144 AC_DEFINE(BROKEN_GETADDRINFO)
1145 ]
1146 )
1147fi
1148
Darren Tuckera56f1912004-11-02 20:30:54 +11001149if test "x$check_for_conflicting_getspnam" = "x1"; then
1150 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1151 AC_COMPILE_IFELSE(
1152 [
1153#include <shadow.h>
1154int main(void) {exit(0);}
1155 ],
1156 [
1157 AC_MSG_RESULT(no)
1158 ],
1159 [
1160 AC_MSG_RESULT(yes)
1161 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1162 [Conflicting defs for getspnam])
1163 ]
1164 )
1165fi
1166
Damien Miller606f8802000-09-16 15:39:56 +11001167AC_FUNC_GETPGRP
1168
Damien Millera64b57a2001-01-17 10:44:13 +11001169# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001170PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001171AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001172 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001173 [
Damien Millera64b57a2001-01-17 10:44:13 +11001174 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001175 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1176 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001177 AC_MSG_ERROR([PAM headers not found])
1178 fi
1179
1180 AC_CHECK_LIB(dl, dlopen, , )
1181 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1182 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001183 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001184
Damien Millera64b57a2001-01-17 10:44:13 +11001185 PAM_MSG="yes"
1186
1187 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001188 if test $ac_cv_lib_dl_dlopen = yes; then
1189 LIBPAM="-lpam -ldl"
1190 else
1191 LIBPAM="-lpam"
1192 fi
1193 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001194 fi
1195 ]
1196)
Damien Millera22ba012000-03-02 23:09:20 +11001197
Damien Millera64b57a2001-01-17 10:44:13 +11001198# Check for older PAM
1199if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001200 # Check PAM strerror arguments (old PAM)
1201 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1202 AC_TRY_COMPILE(
1203 [
Damien Miller81171112000-04-23 11:14:01 +10001204#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001205#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001206#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001207#elif defined (HAVE_PAM_PAM_APPL_H)
1208#include <pam/pam_appl.h>
1209#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001210 ],
1211 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001212 [AC_MSG_RESULT(no)],
1213 [
1214 AC_DEFINE(HAVE_OLD_PAM)
1215 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001216 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001217 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001218 )
Damien Millera22ba012000-03-02 23:09:20 +11001219fi
1220
Tim Riceaef73712002-05-11 13:17:42 -07001221# Search for OpenSSL
1222saved_CPPFLAGS="$CPPFLAGS"
1223saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001224AC_ARG_WITH(ssl-dir,
1225 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1226 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001227 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001228 case "$withval" in
1229 # Relative paths
1230 ./*|../*) withval="`pwd`/$withval"
1231 esac
Tim Riceaef73712002-05-11 13:17:42 -07001232 if test -d "$withval/lib"; then
1233 if test -n "${need_dash_r}"; then
1234 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1235 else
1236 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1237 fi
1238 else
1239 if test -n "${need_dash_r}"; then
1240 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1241 else
1242 LDFLAGS="-L${withval} ${LDFLAGS}"
1243 fi
1244 fi
1245 if test -d "$withval/include"; then
1246 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1247 else
1248 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1249 fi
Damien Millera22ba012000-03-02 23:09:20 +11001250 fi
1251 ]
1252)
Tim Rice3d5352e2004-02-12 09:27:21 -08001253LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001254AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001255 [
Tim Riceaef73712002-05-11 13:17:42 -07001256 dnl Check default openssl install dir
1257 if test -n "${need_dash_r}"; then
1258 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001259 else
Tim Riceaef73712002-05-11 13:17:42 -07001260 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001261 fi
Tim Riceaef73712002-05-11 13:17:42 -07001262 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1263 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1264 [
1265 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1266 ]
1267 )
1268 ]
1269)
1270
Tim Riced730b782002-08-13 18:52:10 -07001271# Determine OpenSSL header version
1272AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001273AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001274 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001275#include <stdio.h>
1276#include <string.h>
1277#include <openssl/opensslv.h>
1278#define DATA "conftest.sslincver"
1279int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001280 FILE *fd;
1281 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001282
Damien Millera8e06ce2003-11-21 23:48:55 +11001283 fd = fopen(DATA,"w");
1284 if(fd == NULL)
1285 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001286
1287 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1288 exit(1);
1289
1290 exit(0);
1291}
Darren Tucker623d92f2004-09-12 22:36:15 +10001292 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001293 [
1294 ssl_header_ver=`cat conftest.sslincver`
1295 AC_MSG_RESULT($ssl_header_ver)
1296 ],
1297 [
1298 AC_MSG_RESULT(not found)
1299 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001300 ],
1301 [
1302 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001303 ]
1304)
1305
1306# Determine OpenSSL library version
1307AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001308AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001309 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001310#include <stdio.h>
1311#include <string.h>
1312#include <openssl/opensslv.h>
1313#include <openssl/crypto.h>
1314#define DATA "conftest.ssllibver"
1315int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001316 FILE *fd;
1317 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001318
Damien Millera8e06ce2003-11-21 23:48:55 +11001319 fd = fopen(DATA,"w");
1320 if(fd == NULL)
1321 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001322
1323 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1324 exit(1);
1325
1326 exit(0);
1327}
Darren Tucker623d92f2004-09-12 22:36:15 +10001328 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001329 [
1330 ssl_library_ver=`cat conftest.ssllibver`
1331 AC_MSG_RESULT($ssl_library_ver)
1332 ],
1333 [
1334 AC_MSG_RESULT(not found)
1335 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001336 ],
1337 [
1338 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001339 ]
1340)
Damien Millera22ba012000-03-02 23:09:20 +11001341
Damien Millerec932372002-01-22 22:16:03 +11001342# Sanity check OpenSSL headers
1343AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001344AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001345 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001346#include <string.h>
1347#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001348int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001349 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001350 [
1351 AC_MSG_RESULT(yes)
1352 ],
1353 [
1354 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001355 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1356Check config.log for details.
1357Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001358 ],
1359 [
1360 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001361 ]
1362)
1363
Tim Rice3d5352e2004-02-12 09:27:21 -08001364# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1365# because the system crypt() is more featureful.
1366if test "x$check_for_libcrypt_before" = "x1"; then
1367 AC_CHECK_LIB(crypt, crypt)
1368fi
1369
Damien Millera8e06ce2003-11-21 23:48:55 +11001370# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001371# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001372if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001373 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001374fi
1375
Damien Miller6c21c512002-01-22 21:57:53 +11001376
1377### Configure cryptographic random number support
1378
1379# Check wheter OpenSSL seeds itself
1380AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001381AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001382 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001383#include <string.h>
1384#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001385int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001386 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001387 [
1388 OPENSSL_SEEDS_ITSELF=yes
1389 AC_MSG_RESULT(yes)
1390 ],
1391 [
1392 AC_MSG_RESULT(no)
1393 # Default to use of the rand helper if OpenSSL doesn't
1394 # seed itself
1395 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001396 ],
1397 [
1398 AC_MSG_WARN([cross compiling: assuming yes])
1399 # This is safe, since all recent OpenSSL versions will
1400 # complain at runtime if not seeded correctly.
1401 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001402 ]
1403)
1404
1405
1406# Do we want to force the use of the rand helper?
1407AC_ARG_WITH(rand-helper,
1408 [ --with-rand-helper Use subprocess to gather strong randomness ],
1409 [
1410 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001411 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001412 # the previous test showed it to be unseeded.
1413 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1414 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1415 OPENSSL_SEEDS_ITSELF=yes
1416 USE_RAND_HELPER=""
1417 fi
1418 else
1419 USE_RAND_HELPER=yes
1420 fi
1421 ],
1422)
1423
1424# Which randomness source do we use?
1425if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1426 # OpenSSL only
1427 AC_DEFINE(OPENSSL_PRNG_ONLY)
1428 RAND_MSG="OpenSSL internal ONLY"
1429 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001430elif test ! -z "$USE_RAND_HELPER" ; then
1431 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001432 RAND_MSG="ssh-rand-helper"
1433 INSTALL_SSH_RAND_HELPER="yes"
1434fi
1435AC_SUBST(INSTALL_SSH_RAND_HELPER)
1436
1437### Configuration of ssh-rand-helper
1438
1439# PRNGD TCP socket
1440AC_ARG_WITH(prngd-port,
1441 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1442 [
Damien Millere996d722002-01-23 11:20:59 +11001443 case "$withval" in
1444 no)
1445 withval=""
1446 ;;
1447 [[0-9]]*)
1448 ;;
1449 *)
1450 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1451 ;;
1452 esac
1453 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001454 PRNGD_PORT="$withval"
1455 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1456 fi
1457 ]
1458)
1459
1460# PRNGD Unix domain socket
1461AC_ARG_WITH(prngd-socket,
1462 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1463 [
Damien Millere996d722002-01-23 11:20:59 +11001464 case "$withval" in
1465 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001466 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001467 ;;
1468 no)
1469 withval=""
1470 ;;
1471 /*)
1472 ;;
1473 *)
1474 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1475 ;;
1476 esac
1477
1478 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001479 if test ! -z "$PRNGD_PORT" ; then
1480 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1481 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001482 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001483 AC_MSG_WARN(Entropy socket is not readable)
1484 fi
1485 PRNGD_SOCKET="$withval"
1486 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1487 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001488 ],
1489 [
1490 # Check for existing socket only if we don't have a random device already
1491 if test "$USE_RAND_HELPER" = yes ; then
1492 AC_MSG_CHECKING(for PRNGD/EGD socket)
1493 # Insert other locations here
1494 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1495 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1496 PRNGD_SOCKET="$sock"
1497 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1498 break;
1499 fi
1500 done
1501 if test ! -z "$PRNGD_SOCKET" ; then
1502 AC_MSG_RESULT($PRNGD_SOCKET)
1503 else
1504 AC_MSG_RESULT(not found)
1505 fi
1506 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001507 ]
1508)
1509
1510# Change default command timeout for hashing entropy source
1511entropy_timeout=200
1512AC_ARG_WITH(entropy-timeout,
1513 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1514 [
1515 if test "x$withval" != "xno" ; then
1516 entropy_timeout=$withval
1517 fi
1518 ]
1519)
Damien Miller6c21c512002-01-22 21:57:53 +11001520AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1521
Damien Millerd3f6ad22002-06-25 10:24:47 +10001522SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001523AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001524 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001525 [
1526 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001527 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001528 fi
1529 ]
1530)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001531AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1532AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001533
Tim Rice88f2ab52002-03-17 12:17:34 -08001534# We do this little dance with the search path to insure
1535# that programs that we select for use by installed programs
1536# (which may be run by the super-user) come from trusted
1537# locations before they come from the user's private area.
1538# This should help avoid accidentally configuring some
1539# random version of a program in someone's personal bin.
1540
1541OPATH=$PATH
1542PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001543test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001544test -d /sbin && PATH=$PATH:/sbin
1545test -d /usr/sbin && PATH=$PATH:/usr/sbin
1546PATH=$PATH:/etc:$OPATH
1547
Damien Millera8e06ce2003-11-21 23:48:55 +11001548# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001549OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1550OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1551OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1552OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1553OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1554OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1555OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1556OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1557OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1558OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1559OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1560OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1561OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1562OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1563OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1564OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001565# restore PATH
1566PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001567
1568# Where does ssh-rand-helper get its randomness from?
1569INSTALL_SSH_PRNG_CMDS=""
1570if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1571 if test ! -z "$PRNGD_PORT" ; then
1572 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1573 elif test ! -z "$PRNGD_SOCKET" ; then
1574 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1575 else
1576 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1577 RAND_HELPER_CMDHASH=yes
1578 INSTALL_SSH_PRNG_CMDS="yes"
1579 fi
1580fi
1581AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1582
1583
Ben Lindstromb5628642000-10-18 00:02:25 +00001584# Cheap hack to ensure NEWS-OS libraries are arranged right.
1585if test ! -z "$SONY" ; then
1586 LIBS="$LIBS -liberty";
1587fi
1588
Damien Millera22ba012000-03-02 23:09:20 +11001589# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001590AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001591AC_CHECK_SIZEOF(short int, 2)
1592AC_CHECK_SIZEOF(int, 4)
1593AC_CHECK_SIZEOF(long int, 4)
1594AC_CHECK_SIZEOF(long long int, 8)
1595
Damien Millerfa2bb692002-04-23 23:22:25 +10001596# Sanity check long long for some platforms (AIX)
1597if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1598 ac_cv_sizeof_long_long_int=0
1599fi
1600
Damien Millera22ba012000-03-02 23:09:20 +11001601# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001602AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1603 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001604 [ #include <sys/types.h> ],
1605 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001606 [ ac_cv_have_u_int="yes" ],
1607 [ ac_cv_have_u_int="no" ]
1608 )
1609])
1610if test "x$ac_cv_have_u_int" = "xyes" ; then
1611 AC_DEFINE(HAVE_U_INT)
1612 have_u_int=1
1613fi
1614
Damien Miller61e50f12000-05-08 20:49:37 +10001615AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1616 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001617 [ #include <sys/types.h> ],
1618 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001619 [ ac_cv_have_intxx_t="yes" ],
1620 [ ac_cv_have_intxx_t="no" ]
1621 )
1622])
1623if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1624 AC_DEFINE(HAVE_INTXX_T)
1625 have_intxx_t=1
1626fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001627
1628if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001629 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001630then
1631 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1632 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001633 [ #include <stdint.h> ],
1634 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001635 [
1636 AC_DEFINE(HAVE_INTXX_T)
1637 AC_MSG_RESULT(yes)
1638 ],
1639 [ AC_MSG_RESULT(no) ]
1640 )
1641fi
1642
Damien Miller578783e2000-09-23 14:12:24 +11001643AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1644 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001645 [
1646#include <sys/types.h>
1647#ifdef HAVE_STDINT_H
1648# include <stdint.h>
1649#endif
1650#include <sys/socket.h>
1651#ifdef HAVE_SYS_BITYPES_H
1652# include <sys/bitypes.h>
1653#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001654 ],
1655 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001656 [ ac_cv_have_int64_t="yes" ],
1657 [ ac_cv_have_int64_t="no" ]
1658 )
1659])
1660if test "x$ac_cv_have_int64_t" = "xyes" ; then
1661 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001662fi
1663
Damien Miller61e50f12000-05-08 20:49:37 +10001664AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1665 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001666 [ #include <sys/types.h> ],
1667 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001668 [ ac_cv_have_u_intxx_t="yes" ],
1669 [ ac_cv_have_u_intxx_t="no" ]
1670 )
1671])
1672if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1673 AC_DEFINE(HAVE_U_INTXX_T)
1674 have_u_intxx_t=1
1675fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001676
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001677if test -z "$have_u_intxx_t" ; then
1678 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1679 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001680 [ #include <sys/socket.h> ],
1681 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001682 [
1683 AC_DEFINE(HAVE_U_INTXX_T)
1684 AC_MSG_RESULT(yes)
1685 ],
1686 [ AC_MSG_RESULT(no) ]
1687 )
1688fi
1689
Damien Miller578783e2000-09-23 14:12:24 +11001690AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1691 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001692 [ #include <sys/types.h> ],
1693 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001694 [ ac_cv_have_u_int64_t="yes" ],
1695 [ ac_cv_have_u_int64_t="no" ]
1696 )
1697])
1698if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1699 AC_DEFINE(HAVE_U_INT64_T)
1700 have_u_int64_t=1
1701fi
1702
Tim Rice4cec93f2002-02-26 08:40:48 -08001703if test -z "$have_u_int64_t" ; then
1704 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1705 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001706 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001707 [ u_int64_t a; a = 1],
1708 [
1709 AC_DEFINE(HAVE_U_INT64_T)
1710 AC_MSG_RESULT(yes)
1711 ],
1712 [ AC_MSG_RESULT(no) ]
1713 )
1714fi
1715
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001716if test -z "$have_u_intxx_t" ; then
1717 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1718 AC_TRY_COMPILE(
1719 [
1720#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001721 ],
1722 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001723 [ ac_cv_have_uintxx_t="yes" ],
1724 [ ac_cv_have_uintxx_t="no" ]
1725 )
1726 ])
1727 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1728 AC_DEFINE(HAVE_UINTXX_T)
1729 fi
1730fi
1731
1732if test -z "$have_uintxx_t" ; then
1733 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1734 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001735 [ #include <stdint.h> ],
1736 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001737 [
1738 AC_DEFINE(HAVE_UINTXX_T)
1739 AC_MSG_RESULT(yes)
1740 ],
1741 [ AC_MSG_RESULT(no) ]
1742 )
1743fi
1744
Damien Milleredb82922000-06-20 13:25:52 +10001745if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001746 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001747then
1748 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1749 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001750 [
1751#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001752 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001753 [
Damien Miller70494d12000-04-03 15:57:06 +10001754 int8_t a; int16_t b; int32_t c;
1755 u_int8_t e; u_int16_t f; u_int32_t g;
1756 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001757 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001758 [
1759 AC_DEFINE(HAVE_U_INTXX_T)
1760 AC_DEFINE(HAVE_INTXX_T)
1761 AC_MSG_RESULT(yes)
1762 ],
1763 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001764 )
Damien Millerb29ea912000-01-15 14:12:03 +11001765fi
1766
Damien Miller58be7382001-09-15 21:31:54 +10001767
1768AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1769 AC_TRY_COMPILE(
1770 [
1771#include <sys/types.h>
1772 ],
1773 [ u_char foo; foo = 125; ],
1774 [ ac_cv_have_u_char="yes" ],
1775 [ ac_cv_have_u_char="no" ]
1776 )
1777])
1778if test "x$ac_cv_have_u_char" = "xyes" ; then
1779 AC_DEFINE(HAVE_U_CHAR)
1780fi
1781
Tim Rice13aae5e2001-10-21 17:53:58 -07001782TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001783
Tim Rice200a5c02002-02-26 22:12:34 -08001784AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001785
Damien Miller61e50f12000-05-08 20:49:37 +10001786AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1787 AC_TRY_COMPILE(
1788 [
1789#include <sys/types.h>
1790 ],
1791 [ size_t foo; foo = 1235; ],
1792 [ ac_cv_have_size_t="yes" ],
1793 [ ac_cv_have_size_t="no" ]
1794 )
1795])
1796if test "x$ac_cv_have_size_t" = "xyes" ; then
1797 AC_DEFINE(HAVE_SIZE_T)
1798fi
Damien Miller95058511999-12-29 10:36:45 +11001799
Damien Miller615f9392000-05-17 22:53:33 +10001800AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1801 AC_TRY_COMPILE(
1802 [
1803#include <sys/types.h>
1804 ],
1805 [ ssize_t foo; foo = 1235; ],
1806 [ ac_cv_have_ssize_t="yes" ],
1807 [ ac_cv_have_ssize_t="no" ]
1808 )
1809])
1810if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1811 AC_DEFINE(HAVE_SSIZE_T)
1812fi
1813
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001814AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1815 AC_TRY_COMPILE(
1816 [
1817#include <time.h>
1818 ],
1819 [ clock_t foo; foo = 1235; ],
1820 [ ac_cv_have_clock_t="yes" ],
1821 [ ac_cv_have_clock_t="no" ]
1822 )
1823])
1824if test "x$ac_cv_have_clock_t" = "xyes" ; then
1825 AC_DEFINE(HAVE_CLOCK_T)
1826fi
1827
Damien Millerb54b40e2000-06-23 08:23:34 +10001828AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1829 AC_TRY_COMPILE(
1830 [
1831#include <sys/types.h>
1832#include <sys/socket.h>
1833 ],
1834 [ sa_family_t foo; foo = 1235; ],
1835 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001836 [ AC_TRY_COMPILE(
1837 [
1838#include <sys/types.h>
1839#include <sys/socket.h>
1840#include <netinet/in.h>
1841 ],
1842 [ sa_family_t foo; foo = 1235; ],
1843 [ ac_cv_have_sa_family_t="yes" ],
1844
Damien Millerb54b40e2000-06-23 08:23:34 +10001845 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001846 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001847 )
1848])
1849if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1850 AC_DEFINE(HAVE_SA_FAMILY_T)
1851fi
1852
Damien Miller0f91b4e2000-06-18 15:43:25 +10001853AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1854 AC_TRY_COMPILE(
1855 [
1856#include <sys/types.h>
1857 ],
1858 [ pid_t foo; foo = 1235; ],
1859 [ ac_cv_have_pid_t="yes" ],
1860 [ ac_cv_have_pid_t="no" ]
1861 )
1862])
1863if test "x$ac_cv_have_pid_t" = "xyes" ; then
1864 AC_DEFINE(HAVE_PID_T)
1865fi
1866
1867AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1868 AC_TRY_COMPILE(
1869 [
1870#include <sys/types.h>
1871 ],
1872 [ mode_t foo; foo = 1235; ],
1873 [ ac_cv_have_mode_t="yes" ],
1874 [ ac_cv_have_mode_t="no" ]
1875 )
1876])
1877if test "x$ac_cv_have_mode_t" = "xyes" ; then
1878 AC_DEFINE(HAVE_MODE_T)
1879fi
1880
Damien Miller61e50f12000-05-08 20:49:37 +10001881
1882AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1883 AC_TRY_COMPILE(
1884 [
Damien Miller81171112000-04-23 11:14:01 +10001885#include <sys/types.h>
1886#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001887 ],
1888 [ struct sockaddr_storage s; ],
1889 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1890 [ ac_cv_have_struct_sockaddr_storage="no" ]
1891 )
1892])
1893if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1894 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1895fi
Damien Miller34132e52000-01-14 15:45:46 +11001896
Damien Miller61e50f12000-05-08 20:49:37 +10001897AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1898 AC_TRY_COMPILE(
1899 [
Damien Miller7b22d652000-06-18 14:07:04 +10001900#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001901#include <netinet/in.h>
1902 ],
1903 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1904 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1905 [ ac_cv_have_struct_sockaddr_in6="no" ]
1906 )
1907])
1908if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1909 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1910fi
Damien Miller34132e52000-01-14 15:45:46 +11001911
Damien Miller61e50f12000-05-08 20:49:37 +10001912AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1913 AC_TRY_COMPILE(
1914 [
Damien Miller7b22d652000-06-18 14:07:04 +10001915#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001916#include <netinet/in.h>
1917 ],
1918 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1919 [ ac_cv_have_struct_in6_addr="yes" ],
1920 [ ac_cv_have_struct_in6_addr="no" ]
1921 )
1922])
1923if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1924 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1925fi
Damien Miller34132e52000-01-14 15:45:46 +11001926
Damien Miller61e50f12000-05-08 20:49:37 +10001927AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1928 AC_TRY_COMPILE(
1929 [
Damien Miller81171112000-04-23 11:14:01 +10001930#include <sys/types.h>
1931#include <sys/socket.h>
1932#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001933 ],
1934 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1935 [ ac_cv_have_struct_addrinfo="yes" ],
1936 [ ac_cv_have_struct_addrinfo="no" ]
1937 )
1938])
1939if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1940 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1941fi
1942
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001943AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1944 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001945 [ #include <sys/time.h> ],
1946 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001947 [ ac_cv_have_struct_timeval="yes" ],
1948 [ ac_cv_have_struct_timeval="no" ]
1949 )
1950])
1951if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1952 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1953 have_struct_timeval=1
1954fi
1955
Tim Rice4e4dc562003-03-18 10:21:40 -08001956AC_CHECK_TYPES(struct timespec)
1957
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001958# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001959if test "x$ac_cv_have_int64_t" = "xno" -a \
1960 "x$ac_cv_sizeof_long_int" != "x8" -a \
1961 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001962 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1963 echo "an alternative compiler (I.E., GCC) before continuing."
1964 echo ""
1965 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001966else
1967dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001968 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001969 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08001970#include <stdio.h>
1971#include <string.h>
1972#ifdef HAVE_SNPRINTF
1973main()
1974{
1975 char buf[50];
1976 char expected_out[50];
1977 int mazsize = 50 ;
1978#if (SIZEOF_LONG_INT == 8)
1979 long int num = 0x7fffffffffffffff;
1980#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001981 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001982#endif
1983 strcpy(expected_out, "9223372036854775807");
1984 snprintf(buf, mazsize, "%lld", num);
1985 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001986 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001987 exit(0);
1988}
1989#else
1990main() { exit(0); }
1991#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10001992 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10001993 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08001994 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001995fi
1996
Damien Miller78315eb2000-09-29 23:01:36 +11001997dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001998OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1999OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2000OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2001OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2002OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002003OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002004OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2005OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002006OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002007OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2008OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2009OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2010OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002011OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2012OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2013OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2014OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002015
2016AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00002017
Damien Miller61e50f12000-05-08 20:49:37 +10002018AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2019 ac_cv_have_ss_family_in_struct_ss, [
2020 AC_TRY_COMPILE(
2021 [
Damien Miller81171112000-04-23 11:14:01 +10002022#include <sys/types.h>
2023#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002024 ],
2025 [ struct sockaddr_storage s; s.ss_family = 1; ],
2026 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2027 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2028 )
2029])
2030if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2031 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
2032fi
2033
Damien Miller61e50f12000-05-08 20:49:37 +10002034AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2035 ac_cv_have___ss_family_in_struct_ss, [
2036 AC_TRY_COMPILE(
2037 [
Damien Miller81171112000-04-23 11:14:01 +10002038#include <sys/types.h>
2039#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002040 ],
2041 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2042 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2043 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2044 )
2045])
2046if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2047 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
2048fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002049
Damien Millerad833b32000-08-23 10:46:23 +10002050AC_CACHE_CHECK([for pw_class field in struct passwd],
2051 ac_cv_have_pw_class_in_struct_passwd, [
2052 AC_TRY_COMPILE(
2053 [
Damien Millerad833b32000-08-23 10:46:23 +10002054#include <pwd.h>
2055 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002056 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002057 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2058 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2059 )
2060])
2061if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2062 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
2063fi
2064
Kevin Steves82456952001-06-22 21:14:18 +00002065AC_CACHE_CHECK([for pw_expire field in struct passwd],
2066 ac_cv_have_pw_expire_in_struct_passwd, [
2067 AC_TRY_COMPILE(
2068 [
2069#include <pwd.h>
2070 ],
2071 [ struct passwd p; p.pw_expire = 0; ],
2072 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2073 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2074 )
2075])
2076if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2077 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
2078fi
2079
2080AC_CACHE_CHECK([for pw_change field in struct passwd],
2081 ac_cv_have_pw_change_in_struct_passwd, [
2082 AC_TRY_COMPILE(
2083 [
2084#include <pwd.h>
2085 ],
2086 [ struct passwd p; p.pw_change = 0; ],
2087 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2088 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2089 )
2090])
2091if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2092 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
2093fi
Damien Miller61e50f12000-05-08 20:49:37 +10002094
Tim Rice28bbb0c2002-05-27 17:37:32 -07002095dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002096AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2097 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002098 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002099 [
Tim Riceae49fe62002-04-12 10:26:21 -07002100#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002101#include <sys/socket.h>
2102#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002103int main() {
2104#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002105#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002106exit(1);
2107#endif
2108struct msghdr m;
2109m.msg_accrights = 0;
2110exit(0);
2111}
Kevin Steves939c9db2002-03-22 17:23:25 +00002112 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002113 [ ac_cv_have_accrights_in_msghdr="yes" ],
2114 [ ac_cv_have_accrights_in_msghdr="no" ]
2115 )
2116])
2117if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2118 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2119fi
2120
Kevin Stevesa44e0352002-04-07 16:18:03 +00002121AC_CACHE_CHECK([for msg_control field in struct msghdr],
2122 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002123 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002124 [
Tim Riceae49fe62002-04-12 10:26:21 -07002125#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002126#include <sys/socket.h>
2127#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002128int main() {
2129#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002130#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002131exit(1);
2132#endif
2133struct msghdr m;
2134m.msg_control = 0;
2135exit(0);
2136}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002137 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002138 [ ac_cv_have_control_in_msghdr="yes" ],
2139 [ ac_cv_have_control_in_msghdr="no" ]
2140 )
2141])
2142if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2143 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2144fi
2145
Damien Miller61e50f12000-05-08 20:49:37 +10002146AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002147 AC_TRY_LINK([],
2148 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002149 [ ac_cv_libc_defines___progname="yes" ],
2150 [ ac_cv_libc_defines___progname="no" ]
2151 )
2152])
2153if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2154 AC_DEFINE(HAVE___PROGNAME)
2155fi
2156
Kevin Steves4846f4a2002-03-22 18:19:53 +00002157AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2158 AC_TRY_LINK([
2159#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002160],
2161 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002162 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2163 [ ac_cv_cc_implements___FUNCTION__="no" ]
2164 )
2165])
2166if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2167 AC_DEFINE(HAVE___FUNCTION__)
2168fi
2169
2170AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2171 AC_TRY_LINK([
2172#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002173],
2174 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002175 [ ac_cv_cc_implements___func__="yes" ],
2176 [ ac_cv_cc_implements___func__="no" ]
2177 )
2178])
2179if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2180 AC_DEFINE(HAVE___func__)
2181fi
2182
Damien Miller4f8e6692001-07-14 13:22:53 +10002183AC_CACHE_CHECK([whether getopt has optreset support],
2184 ac_cv_have_getopt_optreset, [
2185 AC_TRY_LINK(
2186 [
2187#include <getopt.h>
2188 ],
2189 [ extern int optreset; optreset = 0; ],
2190 [ ac_cv_have_getopt_optreset="yes" ],
2191 [ ac_cv_have_getopt_optreset="no" ]
2192 )
2193])
2194if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2195 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2196fi
Damien Millera22ba012000-03-02 23:09:20 +11002197
Damien Millerecbb26d2000-07-15 14:59:14 +10002198AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002199 AC_TRY_LINK([],
2200 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002201 [ ac_cv_libc_defines_sys_errlist="yes" ],
2202 [ ac_cv_libc_defines_sys_errlist="no" ]
2203 )
2204])
2205if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2206 AC_DEFINE(HAVE_SYS_ERRLIST)
2207fi
2208
2209
Damien Miller11fa2cc2000-08-16 10:35:58 +10002210AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002211 AC_TRY_LINK([],
2212 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002213 [ ac_cv_libc_defines_sys_nerr="yes" ],
2214 [ ac_cv_libc_defines_sys_nerr="no" ]
2215 )
2216])
2217if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2218 AC_DEFINE(HAVE_SYS_NERR)
2219fi
2220
Damien Millera8e06ce2003-11-21 23:48:55 +11002221SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002222# Check whether user wants sectok support
2223AC_ARG_WITH(sectok,
2224 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002225 [
2226 if test "x$withval" != "xno" ; then
2227 if test "x$withval" != "xyes" ; then
2228 CPPFLAGS="$CPPFLAGS -I${withval}"
2229 LDFLAGS="$LDFLAGS -L${withval}"
2230 if test ! -z "$need_dash_r" ; then
2231 LDFLAGS="$LDFLAGS -R${withval}"
2232 fi
2233 if test ! -z "$blibpath" ; then
2234 blibpath="$blibpath:${withval}"
2235 fi
2236 fi
2237 AC_CHECK_HEADERS(sectok.h)
2238 if test "$ac_cv_header_sectok_h" != yes; then
2239 AC_MSG_ERROR(Can't find sectok.h)
2240 fi
2241 AC_CHECK_LIB(sectok, sectok_open)
2242 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2243 AC_MSG_ERROR(Can't find libsectok)
2244 fi
2245 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002246 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002247 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002248 fi
2249 ]
2250)
2251
2252# Check whether user wants OpenSC support
2253AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002254 AC_HELP_STRING([--with-opensc=PFX],
2255 [Enable smartcard support using OpenSC]),
2256 opensc_config_prefix="$withval", opensc_config_prefix="")
2257if test x$opensc_config_prefix != x ; then
2258 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2259 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2260 if test "$OPENSC_CONFIG" != "no"; then
2261 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2262 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2263 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2264 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2265 AC_DEFINE(SMARTCARD)
2266 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002267 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002268 fi
2269fi
Damien Miller85de5802001-09-18 14:01:11 +10002270
Darren Tucker5f88d342003-10-15 16:57:57 +10002271# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002272AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002273 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002274 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002275 # Needed by our getrrsetbyname()
2276 AC_SEARCH_LIBS(res_query, resolv)
2277 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002278 AC_MSG_CHECKING(if res_query will link)
2279 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2280 [AC_MSG_RESULT(no)
2281 saved_LIBS="$LIBS"
2282 LIBS="$LIBS -lresolv"
2283 AC_MSG_CHECKING(for res_query in -lresolv)
2284 AC_LINK_IFELSE([
2285#include <resolv.h>
2286int main()
2287{
2288 res_query (0, 0, 0, 0, 0);
2289 return 0;
2290}
2291 ],
2292 [LIBS="$LIBS -lresolv"
2293 AC_MSG_RESULT(yes)],
2294 [LIBS="$saved_LIBS"
2295 AC_MSG_RESULT(no)])
2296 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002297 AC_CHECK_FUNCS(_getshort _getlong)
2298 AC_CHECK_MEMBER(HEADER.ad,
2299 [AC_DEFINE(HAVE_HEADER_AD)],,
2300 [#include <arpa/nameser.h>])
2301 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002302
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002303# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002304KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002305AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002306 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002307 [ if test "x$withval" != "xno" ; then
2308 if test "x$withval" = "xyes" ; then
2309 KRB5ROOT="/usr/local"
2310 else
2311 KRB5ROOT=${withval}
2312 fi
2313
2314 AC_DEFINE(KRB5)
2315 KRB5_MSG="yes"
2316
2317 AC_MSG_CHECKING(for krb5-config)
2318 if test -x $KRB5ROOT/bin/krb5-config ; then
2319 KRB5CONF=$KRB5ROOT/bin/krb5-config
2320 AC_MSG_RESULT($KRB5CONF)
2321
2322 AC_MSG_CHECKING(for gssapi support)
2323 if $KRB5CONF | grep gssapi >/dev/null ; then
2324 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002325 AC_DEFINE(GSSAPI)
2326 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002327 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002328 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002329 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002330 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002331 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2332 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002333 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002334 AC_MSG_CHECKING(whether we are using Heimdal)
2335 AC_TRY_COMPILE([ #include <krb5.h> ],
2336 [ char *tmp = heimdal_version; ],
2337 [ AC_MSG_RESULT(yes)
2338 AC_DEFINE(HEIMDAL) ],
2339 AC_MSG_RESULT(no)
2340 )
2341 else
2342 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002343 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002344 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002345 AC_MSG_CHECKING(whether we are using Heimdal)
2346 AC_TRY_COMPILE([ #include <krb5.h> ],
2347 [ char *tmp = heimdal_version; ],
2348 [ AC_MSG_RESULT(yes)
2349 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10002350 K5LIBS="-lkrb5 -ldes"
2351 K5LIBS="$K5LIBS -lcom_err -lasn1"
2352 AC_CHECK_LIB(roken, net_write,
2353 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11002354 ],
2355 [ AC_MSG_RESULT(no)
2356 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2357 ]
2358 )
Damien Miller200d0a72003-06-30 19:21:36 +10002359 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002360
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002361 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2362 [ AC_DEFINE(GSSAPI)
2363 K5LIBS="-lgssapi $K5LIBS" ],
2364 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2365 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002366 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002367 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2368 $K5LIBS)
2369 ],
2370 $K5LIBS)
2371
2372 AC_CHECK_HEADER(gssapi.h, ,
2373 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002374 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002375 AC_CHECK_HEADERS(gssapi.h, ,
2376 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002377 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002378 ]
2379 )
2380
2381 oldCPP="$CPPFLAGS"
2382 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2383 AC_CHECK_HEADER(gssapi_krb5.h, ,
2384 [ CPPFLAGS="$oldCPP" ])
2385
Damien Millera8e06ce2003-11-21 23:48:55 +11002386 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002387 if test ! -z "$need_dash_r" ; then
2388 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2389 fi
2390 if test ! -z "$blibpath" ; then
2391 blibpath="$blibpath:${KRB5ROOT}/lib"
2392 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002393 fi
2394
2395 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2396 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2397 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2398
2399 LIBS="$LIBS $K5LIBS"
2400 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
Ben Lindstroma8104b52004-04-07 04:16:11 +00002401 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
Darren Tucker0d27ed12004-02-24 10:37:33 +11002402 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002403)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002404
Damien Millera22ba012000-03-02 23:09:20 +11002405# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002406
Damien Millerf58c6722002-05-13 13:15:42 +10002407PRIVSEP_PATH=/var/empty
2408AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002409 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002410 [
2411 if test "x$withval" != "$no" ; then
2412 PRIVSEP_PATH=$withval
2413 fi
2414 ]
2415)
2416AC_SUBST(PRIVSEP_PATH)
2417
Damien Millera22ba012000-03-02 23:09:20 +11002418AC_ARG_WITH(xauth,
2419 [ --with-xauth=PATH Specify path to xauth program ],
2420 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002421 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002422 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002423 fi
2424 ],
2425 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002426 TestPath="$PATH"
2427 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2428 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2429 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2430 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2431 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002432 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002433 xauth_path="/usr/openwin/bin/xauth"
2434 fi
2435 ]
2436)
2437
Damien Miller7d901272003-01-13 16:55:22 +11002438STRIP_OPT=-s
2439AC_ARG_ENABLE(strip,
2440 [ --disable-strip Disable calling strip(1) on install],
2441 [
2442 if test "x$enableval" = "xno" ; then
2443 STRIP_OPT=
2444 fi
2445 ]
2446)
2447AC_SUBST(STRIP_OPT)
2448
Damien Millera19cf472000-11-29 13:28:50 +11002449if test -z "$xauth_path" ; then
2450 XAUTH_PATH="undefined"
2451 AC_SUBST(XAUTH_PATH)
2452else
Damien Millera22ba012000-03-02 23:09:20 +11002453 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002454 XAUTH_PATH=$xauth_path
2455 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002456fi
Damien Millera22ba012000-03-02 23:09:20 +11002457
2458# Check for mail directory (last resort if we cannot get it from headers)
2459if test ! -z "$MAIL" ; then
2460 maildir=`dirname $MAIL`
2461 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2462fi
2463
Darren Tucker623d92f2004-09-12 22:36:15 +10002464if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002465 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2466 disable_ptmx_check=yes
2467fi
Damien Millera22ba012000-03-02 23:09:20 +11002468if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002469 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002470 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002471 [
2472 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2473 have_dev_ptmx=1
2474 ]
2475 )
2476 fi
Damien Millera22ba012000-03-02 23:09:20 +11002477fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10002478
Darren Tucker623d92f2004-09-12 22:36:15 +10002479if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002480 AC_CHECK_FILE("/dev/ptc",
2481 [
2482 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2483 have_dev_ptc=1
2484 ]
2485 )
2486else
2487 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2488fi
Damien Miller204ad072000-03-02 23:56:12 +11002489
Damien Millera22ba012000-03-02 23:09:20 +11002490# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002491AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002492 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002493 [
Damien Miller897741e2001-04-16 10:41:46 +10002494 case "$withval" in
2495 man|cat|doc)
2496 MANTYPE=$withval
2497 ;;
2498 *)
2499 AC_MSG_ERROR(invalid man type: $withval)
2500 ;;
2501 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002502 ]
2503)
Ben Lindstrombc709922001-04-18 18:04:21 +00002504if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002505 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2506 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002507 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2508 MANTYPE=doc
2509 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2510 MANTYPE=man
2511 else
2512 MANTYPE=cat
2513 fi
2514fi
Damien Miller670a4b82000-01-22 13:53:11 +11002515AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002516if test "$MANTYPE" = "doc"; then
2517 mansubdir=man;
2518else
2519 mansubdir=$MANTYPE;
2520fi
2521AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002522
Damien Millera22ba012000-03-02 23:09:20 +11002523# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002524MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002525AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002526 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002527 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002528 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002529 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002530 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002531 fi
2532 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002533)
2534
Damien Millera22ba012000-03-02 23:09:20 +11002535# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002536AC_ARG_WITH(shadow,
2537 [ --without-shadow Disable shadow password support],
2538 [
2539 if test "x$withval" = "xno" ; then
2540 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002541 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002542 fi
2543 ]
2544)
2545
Damien Miller1f335fb2000-06-26 11:31:33 +10002546if test -z "$disable_shadow" ; then
2547 AC_MSG_CHECKING([if the systems has expire shadow information])
2548 AC_TRY_COMPILE(
2549 [
2550#include <sys/types.h>
2551#include <shadow.h>
2552 struct spwd sp;
2553 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2554 [ sp_expire_available=yes ], []
2555 )
2556
2557 if test "x$sp_expire_available" = "xyes" ; then
2558 AC_MSG_RESULT(yes)
2559 AC_DEFINE(HAS_SHADOW_EXPIRE)
2560 else
2561 AC_MSG_RESULT(no)
2562 fi
2563fi
2564
Damien Millera22ba012000-03-02 23:09:20 +11002565# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002566if test ! -z "$IPADDR_IN_DISPLAY" ; then
2567 DISPLAY_HACK_MSG="yes"
2568 AC_DEFINE(IPADDR_IN_DISPLAY)
2569else
Damien Millera8e06ce2003-11-21 23:48:55 +11002570 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002571 AC_ARG_WITH(ipaddr-display,
2572 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2573 [
2574 if test "x$withval" != "xno" ; then
2575 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002576 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002577 fi
2578 ]
2579 )
2580fi
Damien Miller76112de1999-12-21 11:18:08 +11002581
Darren Tuckere1a790d2003-09-16 11:52:19 +10002582# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002583AC_ARG_ENABLE(etc-default-login,
Darren Tucker1b6f2292005-02-11 16:11:49 +11002584 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
Darren Tucker2f9573d2005-02-10 22:28:54 +11002585 [ if test "x$enableval" = "xno"; then
2586 AC_MSG_NOTICE([/etc/default/login handling disabled])
2587 etc_default_login=no
2588 else
2589 etc_default_login=yes
2590 fi ],
2591 [ etc_default_login=yes ]
2592)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002593
Darren Tucker2f9573d2005-02-10 22:28:54 +11002594if test "x$etc_default_login" != "xno"; then
2595 AC_CHECK_FILE("/etc/default/login",
2596 [ external_path_file=/etc/default/login ])
Darren Tucker623d92f2004-09-12 22:36:15 +10002597 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2598 then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002599 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2600 elif test "x$external_path_file" = "x/etc/default/login"; then
2601 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2602 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11002603fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002604
Tim Rice43a1c132002-04-17 21:19:14 -07002605dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2606if test $ac_cv_func_login_getcapbool = "yes" -a \
2607 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002608 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002609fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002610
Damien Millera22ba012000-03-02 23:09:20 +11002611# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002612SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002613AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002614 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002615 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002616 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002617 AC_MSG_WARN([
2618--with-default-path=PATH has no effect on this system.
2619Edit /etc/login.conf instead.])
2620 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002621 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002622 AC_MSG_WARN([
2623--with-default-path=PATH will only be used if PATH is not defined in
2624$external_path_file .])
2625 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002626 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002627 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002628 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002629 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002630 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2631 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002632 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002633 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002634 AC_MSG_WARN([
2635If PATH is defined in $external_path_file, ensure the path to scp is included,
2636otherwise scp will not work.])
2637 fi
2638 AC_TRY_RUN(
2639 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002640/* find out what STDPATH is */
2641#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002642#ifdef HAVE_PATHS_H
2643# include <paths.h>
2644#endif
2645#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002646# ifdef _PATH_USERPATH /* Irix */
2647# define _PATH_STDPATH _PATH_USERPATH
2648# else
2649# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2650# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002651#endif
2652#include <sys/types.h>
2653#include <sys/stat.h>
2654#include <fcntl.h>
2655#define DATA "conftest.stdpath"
2656
2657main()
2658{
2659 FILE *fd;
2660 int rc;
2661
2662 fd = fopen(DATA,"w");
2663 if(fd == NULL)
2664 exit(1);
2665
2666 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2667 exit(1);
2668
2669 exit(0);
2670}
2671 ], [ user_path=`cat conftest.stdpath` ],
2672 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2673 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2674 )
2675# make sure $bindir is in USER_PATH so scp will work
2676 t_bindir=`eval echo ${bindir}`
2677 case $t_bindir in
2678 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2679 esac
2680 case $t_bindir in
2681 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2682 esac
2683 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2684 if test $? -ne 0 ; then
2685 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2686 if test $? -ne 0 ; then
2687 user_path=$user_path:$t_bindir
2688 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2689 fi
2690 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002691 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002692)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002693if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002694 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2695 AC_SUBST(user_path)
2696fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002697
Damien Millera18bbd32002-05-13 10:48:57 +10002698# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002699AC_ARG_WITH(superuser-path,
2700 [ --with-superuser-path= Specify different path for super-user],
2701 [
2702 if test "x$withval" != "xno" ; then
2703 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2704 superuser_path=$withval
2705 fi
2706 ]
2707)
2708
2709
Damien Miller61e50f12000-05-08 20:49:37 +10002710AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002711IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002712AC_ARG_WITH(4in6,
2713 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2714 [
2715 if test "x$withval" != "xno" ; then
2716 AC_MSG_RESULT(yes)
2717 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002718 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002719 else
2720 AC_MSG_RESULT(no)
2721 fi
2722 ],[
2723 if test "x$inet6_default_4in6" = "xyes"; then
2724 AC_MSG_RESULT([yes (default)])
2725 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002726 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002727 else
2728 AC_MSG_RESULT([no (default)])
2729 fi
2730 ]
2731)
2732
Damien Miller60396b02001-02-18 17:01:00 +11002733# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002734BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002735AC_ARG_WITH(bsd-auth,
2736 [ --with-bsd-auth Enable BSD auth support],
2737 [
2738 if test "x$withval" != "xno" ; then
2739 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002740 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002741 fi
2742 ]
2743)
2744
Damien Millera22ba012000-03-02 23:09:20 +11002745# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002746piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002747# make sure the directory exists
2748if test ! -d $piddir ; then
2749 piddir=`eval echo ${sysconfdir}`
2750 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002751 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002752 esac
2753fi
2754
Tim Rice88f2ab52002-03-17 12:17:34 -08002755AC_ARG_WITH(pid-dir,
2756 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2757 [
2758 if test "x$withval" != "xno" ; then
2759 piddir=$withval
2760 if test ! -d $piddir ; then
2761 AC_MSG_WARN([** no $piddir directory on this system **])
2762 fi
2763 fi
2764 ]
2765)
2766
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002767AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002768AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002769
andre2ff7b5d2000-06-03 14:57:40 +00002770dnl allow user to disable some login recording features
2771AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002772 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002773 [
2774 if test "x$enableval" = "xno" ; then
2775 AC_DEFINE(DISABLE_LASTLOG)
2776 fi
2777 ]
andre2ff7b5d2000-06-03 14:57:40 +00002778)
2779AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002780 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002781 [
2782 if test "x$enableval" = "xno" ; then
2783 AC_DEFINE(DISABLE_UTMP)
2784 fi
2785 ]
andre2ff7b5d2000-06-03 14:57:40 +00002786)
2787AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002788 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002789 [
2790 if test "x$enableval" = "xno" ; then
2791 AC_DEFINE(DISABLE_UTMPX)
2792 fi
2793 ]
andre2ff7b5d2000-06-03 14:57:40 +00002794)
2795AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002796 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002797 [
2798 if test "x$enableval" = "xno" ; then
2799 AC_DEFINE(DISABLE_WTMP)
2800 fi
2801 ]
andre2ff7b5d2000-06-03 14:57:40 +00002802)
2803AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002804 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002805 [
2806 if test "x$enableval" = "xno" ; then
2807 AC_DEFINE(DISABLE_WTMPX)
2808 fi
2809 ]
andre2ff7b5d2000-06-03 14:57:40 +00002810)
2811AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002812 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002813 [
2814 if test "x$enableval" = "xno" ; then
2815 AC_DEFINE(DISABLE_LOGIN)
2816 fi
2817 ]
andre2ff7b5d2000-06-03 14:57:40 +00002818)
2819AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002820 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002821 [
2822 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002823 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002824 fi
2825 ]
andre2ff7b5d2000-06-03 14:57:40 +00002826)
2827AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002828 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002829 [
2830 if test "x$enableval" = "xno" ; then
2831 AC_DEFINE(DISABLE_PUTUTXLINE)
2832 fi
2833 ]
andre2ff7b5d2000-06-03 14:57:40 +00002834)
2835AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002836 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002837 [
2838 if test "x$withval" = "xno" ; then
2839 AC_DEFINE(DISABLE_LASTLOG)
2840 else
2841 conf_lastlog_location=$withval
2842 fi
2843 ]
2844)
andre2ff7b5d2000-06-03 14:57:40 +00002845
2846dnl lastlog, [uw]tmpx? detection
2847dnl NOTE: set the paths in the platform section to avoid the
2848dnl need for command-line parameters
2849dnl lastlog and [uw]tmp are subject to a file search if all else fails
2850
2851dnl lastlog detection
2852dnl NOTE: the code itself will detect if lastlog is a directory
2853AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2854AC_TRY_COMPILE([
2855#include <sys/types.h>
2856#include <utmp.h>
2857#ifdef HAVE_LASTLOG_H
2858# include <lastlog.h>
2859#endif
Damien Miller2994e082000-06-04 15:51:47 +10002860#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002861# include <paths.h>
2862#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002863#ifdef HAVE_LOGIN_H
2864# include <login.h>
2865#endif
andre2ff7b5d2000-06-03 14:57:40 +00002866 ],
2867 [ char *lastlog = LASTLOG_FILE; ],
2868 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002869 [
2870 AC_MSG_RESULT(no)
2871 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2872 AC_TRY_COMPILE([
2873#include <sys/types.h>
2874#include <utmp.h>
2875#ifdef HAVE_LASTLOG_H
2876# include <lastlog.h>
2877#endif
2878#ifdef HAVE_PATHS_H
2879# include <paths.h>
2880#endif
2881 ],
2882 [ char *lastlog = _PATH_LASTLOG; ],
2883 [ AC_MSG_RESULT(yes) ],
2884 [
andree441aa32000-06-12 22:34:38 +00002885 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002886 system_lastlog_path=no
2887 ])
2888 ]
andre2ff7b5d2000-06-03 14:57:40 +00002889)
Damien Miller2994e082000-06-04 15:51:47 +10002890
andre2ff7b5d2000-06-03 14:57:40 +00002891if test -z "$conf_lastlog_location"; then
2892 if test x"$system_lastlog_path" = x"no" ; then
2893 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002894 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002895 conf_lastlog_location=$f
2896 fi
2897 done
2898 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002899 AC_MSG_WARN([** Cannot find lastlog **])
2900 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002901 fi
2902 fi
2903fi
2904
2905if test -n "$conf_lastlog_location"; then
2906 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2907fi
2908
2909dnl utmp detection
2910AC_MSG_CHECKING([if your system defines UTMP_FILE])
2911AC_TRY_COMPILE([
2912#include <sys/types.h>
2913#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002914#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002915# include <paths.h>
2916#endif
2917 ],
2918 [ char *utmp = UTMP_FILE; ],
2919 [ AC_MSG_RESULT(yes) ],
2920 [ AC_MSG_RESULT(no)
2921 system_utmp_path=no ]
2922)
2923if test -z "$conf_utmp_location"; then
2924 if test x"$system_utmp_path" = x"no" ; then
2925 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2926 if test -f $f ; then
2927 conf_utmp_location=$f
2928 fi
2929 done
2930 if test -z "$conf_utmp_location"; then
2931 AC_DEFINE(DISABLE_UTMP)
2932 fi
2933 fi
2934fi
2935if test -n "$conf_utmp_location"; then
2936 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2937fi
2938
2939dnl wtmp detection
2940AC_MSG_CHECKING([if your system defines WTMP_FILE])
2941AC_TRY_COMPILE([
2942#include <sys/types.h>
2943#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002944#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002945# include <paths.h>
2946#endif
2947 ],
2948 [ char *wtmp = WTMP_FILE; ],
2949 [ AC_MSG_RESULT(yes) ],
2950 [ AC_MSG_RESULT(no)
2951 system_wtmp_path=no ]
2952)
2953if test -z "$conf_wtmp_location"; then
2954 if test x"$system_wtmp_path" = x"no" ; then
2955 for f in /usr/adm/wtmp /var/log/wtmp; do
2956 if test -f $f ; then
2957 conf_wtmp_location=$f
2958 fi
2959 done
2960 if test -z "$conf_wtmp_location"; then
2961 AC_DEFINE(DISABLE_WTMP)
2962 fi
2963 fi
2964fi
2965if test -n "$conf_wtmp_location"; then
2966 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2967fi
2968
2969
2970dnl utmpx detection - I don't know any system so perverse as to require
2971dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2972dnl there, though.
2973AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2974AC_TRY_COMPILE([
2975#include <sys/types.h>
2976#include <utmp.h>
2977#ifdef HAVE_UTMPX_H
2978#include <utmpx.h>
2979#endif
Damien Miller2994e082000-06-04 15:51:47 +10002980#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002981# include <paths.h>
2982#endif
2983 ],
2984 [ char *utmpx = UTMPX_FILE; ],
2985 [ AC_MSG_RESULT(yes) ],
2986 [ AC_MSG_RESULT(no)
2987 system_utmpx_path=no ]
2988)
2989if test -z "$conf_utmpx_location"; then
2990 if test x"$system_utmpx_path" = x"no" ; then
2991 AC_DEFINE(DISABLE_UTMPX)
2992 fi
2993else
2994 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2995fi
2996
2997dnl wtmpx detection
2998AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2999AC_TRY_COMPILE([
3000#include <sys/types.h>
3001#include <utmp.h>
3002#ifdef HAVE_UTMPX_H
3003#include <utmpx.h>
3004#endif
Damien Miller2994e082000-06-04 15:51:47 +10003005#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003006# include <paths.h>
3007#endif
3008 ],
3009 [ char *wtmpx = WTMPX_FILE; ],
3010 [ AC_MSG_RESULT(yes) ],
3011 [ AC_MSG_RESULT(no)
3012 system_wtmpx_path=no ]
3013)
3014if test -z "$conf_wtmpx_location"; then
3015 if test x"$system_wtmpx_path" = x"no" ; then
3016 AC_DEFINE(DISABLE_WTMPX)
3017 fi
3018else
3019 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
3020fi
3021
Damien Miller4018c192000-04-30 09:30:44 +10003022
Damien Miller29ea30d2000-03-17 10:54:15 +11003023if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003024 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3025 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003026fi
3027
Tim Rice4cec93f2002-02-26 08:40:48 -08003028dnl remove pam and dl because they are in $LIBPAM
3029if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003030 LIBS=`echo $LIBS | sed 's/-lpam //'`
3031fi
3032if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3033 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003034fi
3035
Damien Millerbac2d8a2000-09-05 16:13:06 +11003036AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003037AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3038 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003039AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003040
Damien Miller7b22d652000-06-18 14:07:04 +10003041# Print summary of options
3042
Damien Miller7b22d652000-06-18 14:07:04 +10003043# Someone please show me a better way :)
3044A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3045B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3046C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3047D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003048E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003049F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003050G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003051H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3052I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3053J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003054
3055echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003056echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003057echo " User binaries: $B"
3058echo " System binaries: $C"
3059echo " Configuration files: $D"
3060echo " Askpass program: $E"
3061echo " Manual pages: $F"
3062echo " PID file: $G"
3063echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003064if test "x$external_path_file" = "x/etc/login.conf" ; then
3065echo " At runtime, sshd will use the path defined in $external_path_file"
3066echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003067else
Damien Millerf58c6722002-05-13 13:15:42 +10003068echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003069 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003070echo " (If PATH is set in $external_path_file it will be used instead. If"
3071echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3072 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003073fi
Damien Millera18bbd32002-05-13 10:48:57 +10003074if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003075echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003076fi
Damien Millerf58c6722002-05-13 13:15:42 +10003077echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003078echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003079echo " KerberosV support: $KRB5_MSG"
3080echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003081echo " S/KEY support: $SKEY_MSG"
3082echo " TCP Wrappers support: $TCPW_MSG"
3083echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003084echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003085echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003086echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3087echo " BSD Auth support: $BSD_AUTH_MSG"
3088echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003089if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003090echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003091fi
3092
Damien Miller7b22d652000-06-18 14:07:04 +10003093echo ""
3094
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003095echo " Host: ${host}"
3096echo " Compiler: ${CC}"
3097echo " Compiler flags: ${CFLAGS}"
3098echo "Preprocessor flags: ${CPPFLAGS}"
3099echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003100echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003101
3102echo ""
3103
Tim Rice6f1f7582004-05-30 21:38:51 -07003104if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003105 echo "SVR4 style packages are supported with \"make package\""
3106 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003107fi
3108
Damien Miller82cf0ce2000-12-20 13:34:48 +11003109if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003110 echo "PAM is enabled. You may need to install a PAM control file "
3111 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003112 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003113 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003114 echo ""
3115fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003116
Damien Miller6c21c512002-01-22 21:57:53 +11003117if test ! -z "$RAND_HELPER_CMDHASH" ; then
3118 echo "WARNING: you are using the builtin random number collection "
3119 echo "service. Please read WARNING.RNG and request that your OS "
3120 echo "vendor includes kernel-based random number collection in "
3121 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003122 echo ""
3123fi
Damien Miller60396b02001-02-18 17:01:00 +11003124
Damien Millerb4097182004-05-23 14:09:40 +10003125if test ! -z "$NO_PEERCHECK" ; then
3126 echo "WARNING: the operating system that you are using does not "
3127 echo "appear to support either the getpeereid() API nor the "
3128 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3129 echo "enforce security checks to prevent unauthorised connections to "
3130 echo "ssh-agent. Their absence increases the risk that a malicious "
3131 echo "user can connect to your agent. "
3132 echo ""
3133fi
3134