blob: e48028b7b1d6284ffc4fc12877eeedec2aa68c15 [file] [log] [blame]
Tim Ricec390c8d2005-03-07 01:21:37 -08001# $Id: configure.ac,v 1.250 2005/03/07 09:21:37 tim Exp $
Damien Miller4fefe242004-03-11 14:20:10 +11002#
3# Copyright (c) 1999-2004 Damien Miller
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Damien Millere9cf3572001-02-09 12:55:35 +110016
Darren Tucker59f79c42004-09-30 21:17:08 +100017AC_INIT(OpenSSH, Portable)
Tim Rice13aae5e2001-10-21 17:53:58 -070018AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +100019
20AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +110021AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +110022AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +110023AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100024
Damien Millera22ba012000-03-02 23:09:20 +110025# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100026AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110027AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100028AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110029AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000030AC_PATH_PROG(AR, ar)
Tim Rice5af9db92004-06-19 19:31:06 -070031AC_PATH_PROG(CAT, cat)
32AC_PATH_PROG(KILL, kill)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070033AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080034AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110035AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100036AC_PATH_PROG(ENT, ent)
37AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110038AC_PATH_PROG(TEST_MINUS_S_SH, bash)
39AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
40AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070041AC_PATH_PROG(SH, sh)
Tim Ricef7ba8f62004-06-20 10:37:32 -070042AC_SUBST(TEST_SHELL,sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110043
Tim Rice6f1f7582004-05-30 21:38:51 -070044dnl for buildpkg.sh
45AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
46 [/usr/sbin${PATH_SEPARATOR}/etc])
47AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd,
48 [/usr/sbin${PATH_SEPARATOR}/etc])
49AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no)
50
Damien Millere8bb4502001-09-25 16:39:35 +100051# System features
52AC_SYS_LARGEFILE
53
Damien Miller3f62aba2000-11-29 11:56:35 +110054if test -z "$AR" ; then
55 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
56fi
57
Damien Millerad833b32000-08-23 10:46:23 +100058# Use LOGIN_PROGRAM from environment if possible
59if test ! -z "$LOGIN_PROGRAM" ; then
60 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
61else
62 # Search for login
63 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
64 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
65 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
66 fi
67fi
68
Darren Tucker23bc8d02004-02-06 16:24:31 +110069AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
70if test ! -z "$PATH_PASSWD_PROG" ; then
71 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
72fi
73
Damien Miller166bd442000-03-16 10:48:25 +110074if test -z "$LD" ; then
75 LD=$CC
76fi
77AC_SUBST(LD)
78
Damien Miller166bd442000-03-16 10:48:25 +110079AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110080if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100081 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110082fi
83
Tim Rice88368a32003-12-08 12:35:59 -080084AC_ARG_WITH(rpath,
85 [ --without-rpath Disable auto-added -R linker paths],
86 [
87 if test "x$withval" = "xno" ; then
88 need_dash_r=""
89 fi
90 if test "x$withval" = "xyes" ; then
91 need_dash_r=1
92 fi
93 ]
94)
95
Damien Millera22ba012000-03-02 23:09:20 +110096# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110097case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110098*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110099 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +1000100 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -0800101 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100102 fi
Damien Millereab4bae2003-04-29 23:22:40 +1000103 saved_LDFLAGS="$LDFLAGS"
104 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
105 if (test -z "$blibflags"); then
106 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
107 AC_TRY_LINK([], [], [blibflags=$tryflags])
108 fi
109 done
110 if (test -z "$blibflags"); then
111 AC_MSG_RESULT(not found)
112 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
113 else
114 AC_MSG_RESULT($blibflags)
115 fi
116 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000117 dnl Check for authenticate. Might be in libs.a on older AIXes
118 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -0700119 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000120 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -0700121 LIBS="$LIBS -ls"
122 ])
123 ])
Darren Tucker3c774c52005-02-16 22:49:31 +1100124 dnl Check for various auth function declarations in headers.
Darren Tucker04cfbe02005-02-20 23:27:11 +1100125 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
126 passwdexpired], , , [#include <usersec.h>])
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000127 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
Darren Tucker3c774c52005-02-16 22:49:31 +1100128 AC_CHECK_DECLS(loginfailed,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000129 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
130 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000131 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000132 [(void)loginfailed("user","host","tty",0);],
133 [AC_MSG_RESULT(yes)
134 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000135 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000136 )],
137 [],
138 [#include <usersec.h>]
139 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000140 AC_CHECK_FUNCS(setauthdb)
Darren Tucker691d5232005-02-15 21:45:57 +1100141 check_for_aix_broken_getaddrinfo=1
Damien Millerf5fea442002-04-23 22:52:45 +1000142 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000143 AC_DEFINE(SETEUID_BREAKS_SETUID)
144 AC_DEFINE(BROKEN_SETREUID)
145 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000146 dnl AIX handles lastlog as part of its login message
147 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000148 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000149 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100150 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100151*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100152 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800153 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100154 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000155 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100156 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100157 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000158 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000159 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700160 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100161 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000162*-*-dgux*)
163 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100164 AC_DEFINE(SETEUID_BREAKS_SETUID)
165 AC_DEFINE(BROKEN_SETREUID)
166 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000167 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000168*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000169 AC_MSG_CHECKING(if we have working getaddrinfo)
170 AC_TRY_RUN([#include <mach-o/dyld.h>
171main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
172 exit(0);
173 else
174 exit(1);
175}], [AC_MSG_RESULT(working)],
176 [AC_MSG_RESULT(buggy)
177 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700178 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000179 AC_DEFINE(SETEUID_BREAKS_SETUID)
180 AC_DEFINE(BROKEN_SETREUID)
181 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100182 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000183 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000184*-*-hpux10.26)
185 if test -z "$GCC"; then
186 CFLAGS="$CFLAGS -Ae"
187 fi
188 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
189 IPADDR_IN_DISPLAY=yes
190 AC_DEFINE(HAVE_SECUREWARE)
191 AC_DEFINE(USE_PIPES)
192 AC_DEFINE(LOGIN_NO_ENDOPT)
193 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000194 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000195 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700196 LIBS="$LIBS -lsec -lsecpw"
197 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000198 disable_ptmx_check=yes
199 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100200*-*-hpux10*)
201 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000202 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100203 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000204 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100205 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000206 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000207 AC_DEFINE(LOGIN_NO_ENDOPT)
208 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000209 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000210 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700211 LIBS="$LIBS -lsec"
212 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100213 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000214*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000215 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100216 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100217 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100218 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000219 AC_DEFINE(LOGIN_NO_ENDOPT)
220 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100221 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000222 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000223 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tucker2fba9932005-02-02 23:30:24 +1100224 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Darren Tucker4398cf52004-04-06 21:39:02 +1000225 check_for_hpux_broken_getaddrinfo=1
Darren Tuckera56f1912004-11-02 20:30:54 +1100226 check_for_conflicting_getspnam=1
Tim Ricef028f1e2002-07-19 12:41:10 -0700227 LIBS="$LIBS -lsec"
228 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000229 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100230*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100231 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000232 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000233 AC_DEFINE(SETEUID_BREAKS_SETUID)
234 AC_DEFINE(BROKEN_SETREUID)
235 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000236 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000237 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100238 ;;
239*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100240 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000241 AC_DEFINE(WITH_IRIX_ARRAY)
242 AC_DEFINE(WITH_IRIX_PROJECT)
243 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000244 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000245 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000246 AC_DEFINE(SETEUID_BREAKS_SETUID)
247 AC_DEFINE(BROKEN_SETREUID)
248 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker8db9a0f2004-04-06 21:31:12 +1000249 AC_DEFINE(BROKEN_UPDWTMPX)
Damien Millerf1b9d112002-04-23 23:09:19 +1000250 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000251 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100252 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100253*-*-linux*)
254 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100255 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000256 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100257 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000258 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker809031f2004-03-30 14:03:45 +1000259 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!")
Damien Miller35276252003-06-03 10:14:28 +1000260 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Darren Tuckere59b5082004-06-28 16:01:19 +1000261 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM)
Darren Tucker2fba9932005-02-02 23:30:24 +1100262 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
263 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Damien Miller7bcb0892000-03-11 20:45:40 +1100264 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000265 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000266 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000267 AC_DEFINE(BROKEN_CMSG_TYPE)
268 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000269 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100270 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000271mips-sony-bsd|mips-sony-newsos4)
272 AC_DEFINE(HAVE_NEWS4)
273 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000274 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100275*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000276 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800277 if test "x$withval" != "xno" ; then
278 need_dash_r=1
279 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100280 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100281*-*-freebsd*)
282 check_for_libcrypt_later=1
283 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000284*-*-bsdi*)
285 AC_DEFINE(SETEUID_BREAKS_SETUID)
286 AC_DEFINE(BROKEN_SETREUID)
287 AC_DEFINE(BROKEN_SETREGID)
288 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000289*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000290 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100291 conf_utmp_location=/etc/utmp
292 conf_wtmp_location=/usr/adm/wtmp
293 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000294 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000295 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000296 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100297 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000298 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100299*-*-solaris*)
Tim Ricead4a1882004-02-29 15:53:37 -0800300 if test "x$withval" != "xno" ; then
301 need_dash_r=1
302 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100303 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000304 AC_DEFINE(LOGIN_NEEDS_UTMPX)
305 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000306 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker21dd0892004-08-16 23:12:05 +1000307 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID)
Darren Tuckere41bba52003-08-25 11:51:19 +1000308 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000309 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
310 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000311 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000312 # hardwire lastlog location (can't detect it on some versions)
313 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000314 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
315 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
316 if test "$sol2ver" -ge 8; then
317 AC_MSG_RESULT(yes)
318 AC_DEFINE(DISABLE_UTMP)
319 AC_DEFINE(DISABLE_WTMP)
320 else
321 AC_MSG_RESULT(no)
322 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100323 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000324*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000325 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000326 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100327 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000328 conf_utmp_location=/etc/utmp
329 conf_wtmp_location=/var/adm/wtmp
330 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000331 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000332 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000333*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700334 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000335 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000336 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000337 AC_DEFINE(SETEUID_BREAKS_SETUID)
338 AC_DEFINE(BROKEN_SETREUID)
339 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000340 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000341*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700342 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000343 AC_CHECK_LIB(dl, dlsym, ,)
Darren Tuckerca6e7a72005-02-16 16:19:17 +1100344 # -lresolv needs to be at then end of LIBS or DNS lookups break
345 AC_CHECK_LIB(res_query, resolv, [ LIBS="$LIBS -lresolv" ])
Damien Millerfd9885e2001-01-10 08:16:53 +1100346 IPADDR_IN_DISPLAY=yes
347 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000348 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000349 AC_DEFINE(SETEUID_BREAKS_SETUID)
350 AC_DEFINE(BROKEN_SETREUID)
351 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000352 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000353 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700354 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
355 # Attention: always take care to bind libsocket and libnsl before libc,
356 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000357 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800358# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
Damien Miller78315eb2000-09-29 23:01:36 +1100359*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100360 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700361 AC_DEFINE(SETEUID_BREAKS_SETUID)
362 AC_DEFINE(BROKEN_SETREUID)
363 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100364 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800365# UnixWare 7.x, OpenUNIX 8
Damien Miller78315eb2000-09-29 23:01:36 +1100366*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100367 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700368 AC_DEFINE(SETEUID_BREAKS_SETUID)
369 AC_DEFINE(BROKEN_SETREUID)
370 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100371 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100372*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100373 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800374# SCO UNIX and OEM versions of SCO UNIX
Damien Miller78315eb2000-09-29 23:01:36 +1100375*-*-sco3.2v4*)
Tim Ricec390c8d2005-03-07 01:21:37 -0800376 AC_MSG_ERROR("This Platform is no longer supported.")
Damien Miller78315eb2000-09-29 23:01:36 +1100377 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800378# SCO OpenServer 5.x
Damien Miller78315eb2000-09-29 23:01:36 +1100379*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800380 if test -z "$GCC"; then
381 CFLAGS="$CFLAGS -belf"
382 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100383 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000384 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100385 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000386 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000387 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700388 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700389 AC_DEFINE(SETEUID_BREAKS_SETUID)
390 AC_DEFINE(BROKEN_SETREUID)
391 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700392 AC_DEFINE(WITH_ABBREV_NO_TTY)
Tim Rice816bd0d2004-07-19 10:19:26 -0700393 AC_DEFINE(BROKEN_UPDWTMPX)
Darren Tucker33370e02005-02-09 22:17:28 +1100394 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
Damien Miller217f5672001-02-16 12:12:41 +1100395 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700396 MANTYPE=man
Tim Ricef7ba8f62004-06-20 10:37:32 -0700397 TEST_SHELL=ksh
Damien Millera66626b2000-06-13 18:57:53 +1000398 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000399*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100400 AC_DEFINE(NO_SSH_LASTLOG)
401 AC_DEFINE(SETEUID_BREAKS_SETUID)
402 AC_DEFINE(BROKEN_SETREUID)
403 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000404 AC_DEFINE(USE_PIPES)
405 AC_DEFINE(DISABLE_FD_PASSING)
406 LDFLAGS="$LDFLAGS"
407 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
408 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000409 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000410*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100411 AC_DEFINE(SETEUID_BREAKS_SETUID)
412 AC_DEFINE(BROKEN_SETREUID)
413 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000414 AC_DEFINE(WITH_ABBREV_NO_TTY)
415 AC_DEFINE(USE_PIPES)
416 AC_DEFINE(DISABLE_FD_PASSING)
417 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100418 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000419 MANTYPE=cat
420 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000421*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100422 AC_DEFINE(SETEUID_BREAKS_SETUID)
423 AC_DEFINE(BROKEN_SETREUID)
424 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000425 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700426 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700427 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000428 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
429 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
430 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700431 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000432*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000433 AC_MSG_CHECKING(for Digital Unix SIA)
434 no_osfsia=""
435 AC_ARG_WITH(osfsia,
436 [ --with-osfsia Enable Digital Unix SIA],
437 [
438 if test "x$withval" = "xno" ; then
439 AC_MSG_RESULT(disabled)
440 no_osfsia=1
441 fi
442 ],
443 )
444 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000445 if test -f /etc/sia/matrix.conf; then
446 AC_MSG_RESULT(yes)
447 AC_DEFINE(HAVE_OSF_SIA)
448 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000449 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000450 LIBS="$LIBS -lsecurity -ldb -lm -laud"
451 else
452 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100453 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000454 fi
455 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000456 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700457 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000458 AC_DEFINE(BROKEN_SETREUID)
459 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000460 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000461
462*-*-nto-qnx)
463 AC_DEFINE(USE_PIPES)
464 AC_DEFINE(NO_X11_UNIX_SOCKETS)
465 AC_DEFINE(MISSING_NFDBITS)
466 AC_DEFINE(MISSING_HOWMANY)
467 AC_DEFINE(MISSING_FD_MASK)
468 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100469esac
470
Damien Millere37bfc12000-06-05 09:37:43 +1000471# Allow user to specify flags
472AC_ARG_WITH(cflags,
473 [ --with-cflags Specify additional flags to pass to compiler],
474 [
475 if test "x$withval" != "xno" ; then
476 CFLAGS="$CFLAGS $withval"
477 fi
478 ]
479)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000480AC_ARG_WITH(cppflags,
481 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
482 [
483 if test "x$withval" != "xno"; then
484 CPPFLAGS="$CPPFLAGS $withval"
485 fi
486 ]
487)
Damien Millere37bfc12000-06-05 09:37:43 +1000488AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000489 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000490 [
491 if test "x$withval" != "xno" ; then
492 LDFLAGS="$LDFLAGS $withval"
493 fi
494 ]
495)
496AC_ARG_WITH(libs,
497 [ --with-libs Specify additional libraries to link with],
498 [
499 if test "x$withval" != "xno" ; then
500 LIBS="$LIBS $withval"
501 fi
502 ]
503)
504
Darren Tucker6eb93042003-06-29 21:30:41 +1000505AC_MSG_CHECKING(compiler and flags for sanity)
Darren Tucker623d92f2004-09-12 22:36:15 +1000506AC_RUN_IFELSE(
507 [AC_LANG_SOURCE([
Darren Tucker6eb93042003-06-29 21:30:41 +1000508#include <stdio.h>
509int main(){exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000510 ])],
Darren Tucker6eb93042003-06-29 21:30:41 +1000511 [ AC_MSG_RESULT(yes) ],
512 [
513 AC_MSG_RESULT(no)
514 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000515 ],
516 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
Darren Tucker6eb93042003-06-29 21:30:41 +1000517)
518
Tim Rice4cec93f2002-02-26 08:40:48 -0800519# Checks for header files.
Damien Miller36f49652004-08-15 18:40:59 +1000520AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \
521 floatingpoint.h getopt.h glob.h ia.h lastlog.h limits.h login.h \
522 login_cap.h maillock.h ndir.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100523 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000524 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Damien Miller36f49652004-08-15 18:40:59 +1000525 strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \
526 sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \
Darren Tucker48d99d32004-08-29 17:04:50 +1000527 sys/pstat.h sys/select.h sys/stat.h sys/stream.h \
Damien Miller36f49652004-08-15 18:40:59 +1000528 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \
529 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 -0800530
Darren Tucker48d99d32004-08-29 17:04:50 +1000531# sys/ptms.h requires sys/stream.h to be included first on Solaris
532AC_CHECK_HEADERS(sys/ptms.h, [], [], [
533#ifdef HAVE_SYS_STREAM_H
534# include <sys/stream.h>
535#endif
536])
537
Damien Millera22ba012000-03-02 23:09:20 +1100538# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700539AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
540AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000541
Tim Rice1e1ef642003-09-11 22:19:31 -0700542dnl IRIX and Solaris 2.5.1 have dirname() in libgen
543AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
544 AC_CHECK_LIB(gen, dirname,[
545 AC_CACHE_CHECK([for broken dirname],
546 ac_cv_have_broken_dirname, [
547 save_LIBS="$LIBS"
548 LIBS="$LIBS -lgen"
549 AC_TRY_RUN(
550 [
551#include <libgen.h>
552#include <string.h>
553
554int main(int argc, char **argv) {
555 char *s, buf[32];
556
557 strncpy(buf,"/etc", 32);
558 s = dirname(buf);
559 if (!s || strncmp(s, "/", 32) != 0) {
560 exit(1);
561 } else {
562 exit(0);
563 }
564}
565 ],
566 [ ac_cv_have_broken_dirname="no" ],
567 [ ac_cv_have_broken_dirname="yes" ]
568 )
569 LIBS="$save_LIBS"
570 ])
571 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
572 LIBS="$LIBS -lgen"
573 AC_DEFINE(HAVE_DIRNAME)
574 AC_CHECK_HEADERS(libgen.h)
575 fi
576 ])
577])
578
579AC_CHECK_FUNC(getspnam, ,
580 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
581AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
582
Tim Rice13aae5e2001-10-21 17:53:58 -0700583dnl zlib is required
584AC_ARG_WITH(zlib,
585 [ --with-zlib=PATH Use zlib in PATH],
586 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000587 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100588 AC_MSG_ERROR([*** zlib is required ***])
589 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700590 if test -d "$withval/lib"; then
591 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700592 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700593 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700594 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700595 fi
596 else
597 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700598 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700599 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700600 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700601 fi
602 fi
603 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700604 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700605 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700606 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700607 fi
608 ]
609)
610
Tim Ricefcb62202004-01-23 18:35:16 -0800611AC_CHECK_LIB(z, deflate, ,
612 [
613 saved_CPPFLAGS="$CPPFLAGS"
614 saved_LDFLAGS="$LDFLAGS"
615 save_LIBS="$LIBS"
616 dnl Check default zlib install dir
617 if test -n "${need_dash_r}"; then
618 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
619 else
620 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
621 fi
622 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
623 LIBS="$LIBS -lz"
624 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
625 [
626 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
627 ]
628 )
629 ]
630)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100631AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100632
633AC_ARG_WITH(zlib-version-check,
634 [ --without-zlib-version-check Disable zlib version check],
635 [ if test "x$withval" = "xno" ; then
636 zlib_check_nonfatal=1
637 fi
638 ]
639)
640
Darren Tucker2dcd2392004-01-23 17:13:33 +1100641AC_MSG_CHECKING(for zlib 1.1.4 or greater)
Darren Tucker623d92f2004-09-12 22:36:15 +1000642AC_RUN_IFELSE([AC_LANG_SOURCE([[
Darren Tucker2dcd2392004-01-23 17:13:33 +1100643#include <zlib.h>
644int main()
645{
646 int a, b, c, v;
647 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
648 exit(1);
649 v = a*1000000 + b*1000 + c;
650 if (v >= 1001004)
651 exit(0);
652 exit(2);
653}
Darren Tucker623d92f2004-09-12 22:36:15 +1000654 ]])],
Darren Tucker2dcd2392004-01-23 17:13:33 +1100655 AC_MSG_RESULT(yes),
656 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100657 if test -z "$zlib_check_nonfatal" ; then
658 AC_MSG_ERROR([*** zlib too old - check config.log ***
659Your reported zlib version has known security problems. It's possible your
660vendor has fixed these problems without changing the version number. If you
661are sure this is the case, you can disable the check by running
662"./configure --without-zlib-version-check".
663If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
664 else
665 AC_MSG_WARN([zlib version may have security problems])
666 fi
Darren Tuckera0c2b392004-09-11 23:26:37 +1000667 ],
668 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100669)
Damien Miller6f9c3372000-10-25 10:06:04 +1100670
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000671dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100672AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000673 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
674)
Damien Millera8e06ce2003-11-21 23:48:55 +1100675AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700676 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
677 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000678)
Damien Millerab18c411999-11-11 10:40:23 +1100679
Tim Ricee589a292001-11-03 11:09:32 -0800680dnl Checks for libutil functions
681AC_CHECK_HEADERS(libutil.h)
682AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
683AC_CHECK_FUNCS(logout updwtmp logwtmp)
684
Ben Lindstrom8697e082001-02-24 21:41:10 +0000685AC_FUNC_STRFTIME
686
Damien Miller3c027682001-03-14 11:39:45 +1100687# Check for ALTDIRFUNC glob() extension
688AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
689AC_EGREP_CPP(FOUNDIT,
690 [
691 #include <glob.h>
692 #ifdef GLOB_ALTDIRFUNC
693 FOUNDIT
694 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100695 ],
Damien Miller3c027682001-03-14 11:39:45 +1100696 [
697 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
698 AC_MSG_RESULT(yes)
699 ],
700 [
701 AC_MSG_RESULT(no)
702 ]
703)
Damien Millerab18c411999-11-11 10:40:23 +1100704
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000705# Check for g.gl_matchc glob() extension
706AC_MSG_CHECKING(for gl_matchc field in glob_t)
707AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100708 [
709 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000710 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100711 ],
712 [
713 AC_DEFINE(GLOB_HAS_GL_MATCHC)
714 AC_MSG_RESULT(yes)
715 ],
716 [
717 AC_MSG_RESULT(no)
718 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000719)
720
Damien Miller18bb4732001-03-28 14:35:30 +1000721AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000722AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000723 [AC_LANG_SOURCE([[
Damien Miller18bb4732001-03-28 14:35:30 +1000724#include <sys/types.h>
725#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700726int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Darren Tucker623d92f2004-09-12 22:36:15 +1000727 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100728 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000729 [
730 AC_MSG_RESULT(no)
731 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000732 ],
733 [
734 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
735 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Damien Miller18bb4732001-03-28 14:35:30 +1000736 ]
737)
738
Damien Miller36f49652004-08-15 18:40:59 +1000739AC_MSG_CHECKING([for /proc/pid/fd directory])
740if test -d "/proc/$$/fd" ; then
741 AC_DEFINE(HAVE_PROC_PID)
742 AC_MSG_RESULT(yes)
743else
744 AC_MSG_RESULT(no)
745fi
746
Damien Millerc547bf12001-02-16 10:18:12 +1100747# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100748SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100749AC_ARG_WITH(skey,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100750 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100751 [
752 if test "x$withval" != "xno" ; then
753
754 if test "x$withval" != "xyes" ; then
755 CPPFLAGS="$CPPFLAGS -I${withval}/include"
756 LDFLAGS="$LDFLAGS -L${withval}/lib"
757 fi
758
759 AC_DEFINE(SKEY)
760 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100761 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100762
Tim Rice4cec93f2002-02-26 08:40:48 -0800763 AC_MSG_CHECKING([for s/key support])
764 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100765 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800766#include <stdio.h>
767#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700768int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800769 ],
770 [AC_MSG_RESULT(yes)],
771 [
772 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100773 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
774 ])
Darren Tucker3b908f62004-04-14 15:26:39 +1000775 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
776 AC_TRY_COMPILE(
777 [#include <stdio.h>
778 #include <skey.h>],
779 [(void)skeychallenge(NULL,"name","",0);],
780 [AC_MSG_RESULT(yes)
781 AC_DEFINE(SKEYCHALLENGE_4ARG)],
782 [AC_MSG_RESULT(no)]
783 )
Damien Millerc547bf12001-02-16 10:18:12 +1100784 fi
785 ]
786)
787
788# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700789TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100790AC_ARG_WITH(tcp-wrappers,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100791 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100792 [
793 if test "x$withval" != "xno" ; then
794 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700795 saved_LDFLAGS="$LDFLAGS"
796 saved_CPPFLAGS="$CPPFLAGS"
797 if test -n "${withval}" -a "${withval}" != "yes"; then
798 if test -d "${withval}/lib"; then
799 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700800 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700801 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700802 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700803 fi
804 else
805 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700806 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700807 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700808 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700809 fi
810 fi
811 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700812 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700813 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700814 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700815 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700816 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800817 LIBWRAP="-lwrap"
818 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100819 AC_MSG_CHECKING(for libwrap)
820 AC_TRY_LINK(
821 [
Damien Miller0ac45002004-04-14 20:14:26 +1000822#include <sys/types.h>
823#include <sys/socket.h>
824#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +1100825#include <tcpd.h>
826 int deny_severity = 0, allow_severity = 0;
827 ],
828 [hosts_access(0);],
829 [
830 AC_MSG_RESULT(yes)
831 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800832 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700833 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100834 ],
835 [
836 AC_MSG_ERROR([*** libwrap missing])
837 ]
838 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800839 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100840 fi
841 ]
842)
843
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100844# Check whether user wants libedit support
845LIBEDIT_MSG="no"
846AC_ARG_WITH(libedit,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100847 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100848 [ if test "x$withval" != "xno" ; then
849 AC_CHECK_LIB(edit, el_init,
850 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
851 LIBEDIT="-ledit -lcurses"
852 LIBEDIT_MSG="yes"
853 AC_SUBST(LIBEDIT)
854 ],
855 [], [-lcurses]
856 )
857 fi ]
858)
859
Darren Tuckerd9f88912005-02-20 21:01:48 +1100860AUDIT_MODULE=none
861AC_ARG_WITH(audit,
862 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)],
863 [
864 AC_MSG_CHECKING(for supported audit module)
865 case "$withval" in
866 bsm)
867 AC_MSG_RESULT(bsm)
868 AUDIT_MODULE=bsm
869 dnl Checks for headers, libs and functions
870 AC_CHECK_HEADERS(bsm/audit.h, [],
871 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)])
872 AC_CHECK_LIB(bsm, getaudit, [],
873 [AC_MSG_ERROR(BSM enabled and required library not found)])
874 AC_CHECK_FUNCS(getaudit, [],
875 [AC_MSG_ERROR(BSM enabled and required function not found)])
876 # These are optional
Darren Tucker0d096692005-03-07 17:34:45 +1100877 AC_CHECK_FUNCS(getaudit_addr)
Darren Tuckerd9f88912005-02-20 21:01:48 +1100878 AC_DEFINE(USE_BSM_AUDIT, [], [Use BSM audit module])
879 ;;
880 debug)
881 AUDIT_MODULE=debug
882 AC_MSG_RESULT(debug)
883 AC_DEFINE(SSH_AUDIT_EVENTS, [], Use audit debugging module)
884 ;;
885 *)
886 AC_MSG_ERROR([Unknown audit module $withval])
887 ;;
888 esac ]
889)
890
Damien Millerfe1f1432003-02-24 15:45:42 +1100891dnl Checks for library functions. Please keep in alphabetical order
892AC_CHECK_FUNCS(\
Darren Tucker60bd4092004-06-25 14:03:34 +1000893 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
Darren Tuckerad7646a2005-02-02 10:43:59 +1100894 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
895 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
896 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100897 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000898 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100899 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000900 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100901 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000902 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000903 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100904 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100905)
Tim Rice13aae5e2001-10-21 17:53:58 -0700906
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000907# IRIX has a const char return value for gai_strerror()
908AC_CHECK_FUNCS(gai_strerror,[
909 AC_DEFINE(HAVE_GAI_STRERROR)
910 AC_TRY_COMPILE([
911#include <sys/types.h>
912#include <sys/socket.h>
913#include <netdb.h>
914
915const char *gai_strerror(int);],[
916char *str;
917
918str = gai_strerror(0);],[
919 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
920 [Define if gai_strerror() returns const char *])])])
921
Damien Millercd6853c2003-01-28 11:33:42 +1100922AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
923
Darren Tuckerf1159b52003-07-07 19:44:01 +1000924dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000925AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000926AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000927
Darren Tuckerb2427c82003-09-10 15:22:44 +1000928dnl tcsendbreak might be a macro
929AC_CHECK_DECL(tcsendbreak,
930 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100931 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000932 [#include <termios.h>]
933)
934
Darren Tucker5bb14002004-04-23 18:53:10 +1000935AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
936
Darren Tucker2a6b0292003-12-31 14:59:17 +1100937AC_CHECK_FUNCS(setresuid, [
938 dnl Some platorms have setresuid that isn't implemented, test for this
939 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000940 AC_RUN_IFELSE(
941 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100942#include <stdlib.h>
943#include <errno.h>
944int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000945 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100946 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100947 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000948 AC_MSG_RESULT(not implemented)],
949 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100950 )
951])
Darren Tuckere937be32003-12-17 18:53:26 +1100952
Darren Tucker2a6b0292003-12-31 14:59:17 +1100953AC_CHECK_FUNCS(setresgid, [
954 dnl Some platorms have setresgid that isn't implemented, test for this
955 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000956 AC_RUN_IFELSE(
957 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100958#include <stdlib.h>
959#include <errno.h>
960int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000961 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100962 [AC_MSG_RESULT(yes)],
963 [AC_DEFINE(BROKEN_SETRESGID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000964 AC_MSG_RESULT(not implemented)],
965 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100966 )
967])
Darren Tuckere937be32003-12-17 18:53:26 +1100968
Damien Millerad833b32000-08-23 10:46:23 +1000969dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000970AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000971dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000972AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000973AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000974dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000975AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000976AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100977
Damien Millera8e06ce2003-11-21 23:48:55 +1100978AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100979 [AC_DEFINE(HAVE_DAEMON)],
980 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
981)
982
Damien Millera8e06ce2003-11-21 23:48:55 +1100983AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100984 [AC_DEFINE(HAVE_GETPAGESIZE)],
985 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
986)
987
Damien Millercb170cb2000-07-01 16:52:55 +1000988# Check for broken snprintf
989if test "x$ac_cv_func_snprintf" = "xyes" ; then
990 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000991 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000992 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +1000993#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700994int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +1000995 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100996 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000997 [
998 AC_MSG_RESULT(no)
999 AC_DEFINE(BROKEN_SNPRINTF)
1000 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001001 ],
1002 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +10001003 )
1004fi
1005
Damien Millerb4097182004-05-23 14:09:40 +10001006# Check for missing getpeereid (or equiv) support
1007NO_PEERCHECK=""
1008if test "x$ac_cv_func_getpeereid" != "xyes" ; then
1009 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1010 AC_TRY_COMPILE(
1011 [#include <sys/types.h>
1012 #include <sys/socket.h>],
1013 [int i = SO_PEERCRED;],
1014 [AC_MSG_RESULT(yes)],
1015 [AC_MSG_RESULT(no)
1016 NO_PEERCHECK=1]
1017 )
1018fi
1019
Damien Millere8328192003-01-07 15:18:32 +11001020dnl see whether mkstemp() requires XXXXXX
1021if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1022AC_MSG_CHECKING([for (overly) strict mkstemp])
1023AC_TRY_RUN(
1024 [
1025#include <stdlib.h>
1026main() { char template[]="conftest.mkstemp-test";
1027if (mkstemp(template) == -1)
1028 exit(1);
1029unlink(template); exit(0);
1030}
1031 ],
1032 [
1033 AC_MSG_RESULT(no)
1034 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001035 [
Damien Millere8328192003-01-07 15:18:32 +11001036 AC_MSG_RESULT(yes)
1037 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1038 ],
1039 [
1040 AC_MSG_RESULT(yes)
1041 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001042 ]
Damien Millere8328192003-01-07 15:18:32 +11001043)
1044fi
1045
Darren Tucker70a3d552003-08-21 17:58:29 +10001046dnl make sure that openpty does not reacquire controlling terminal
1047if test ! -z "$check_for_openpty_ctty_bug"; then
1048 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1049 AC_TRY_RUN(
1050 [
1051#include <stdio.h>
1052#include <sys/fcntl.h>
1053#include <sys/types.h>
1054#include <sys/wait.h>
1055
1056int
1057main()
1058{
1059 pid_t pid;
1060 int fd, ptyfd, ttyfd, status;
1061
1062 pid = fork();
1063 if (pid < 0) { /* failed */
1064 exit(1);
1065 } else if (pid > 0) { /* parent */
1066 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001067 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001068 exit(WEXITSTATUS(status));
1069 else
1070 exit(2);
1071 } else { /* child */
1072 close(0); close(1); close(2);
1073 setsid();
1074 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1075 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1076 if (fd >= 0)
1077 exit(3); /* Acquired ctty: broken */
1078 else
1079 exit(0); /* Did not acquire ctty: OK */
1080 }
1081}
1082 ],
1083 [
1084 AC_MSG_RESULT(yes)
1085 ],
1086 [
1087 AC_MSG_RESULT(no)
1088 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1089 ]
1090 )
1091fi
1092
Darren Tucker4398cf52004-04-06 21:39:02 +10001093if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1094 AC_MSG_CHECKING(if getaddrinfo seems to work)
1095 AC_TRY_RUN(
1096 [
1097#include <stdio.h>
1098#include <sys/socket.h>
1099#include <netdb.h>
1100#include <errno.h>
1101#include <netinet/in.h>
1102
1103#define TEST_PORT "2222"
1104
1105int
1106main(void)
1107{
1108 int err, sock;
1109 struct addrinfo *gai_ai, *ai, hints;
1110 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1111
1112 memset(&hints, 0, sizeof(hints));
1113 hints.ai_family = PF_UNSPEC;
1114 hints.ai_socktype = SOCK_STREAM;
1115 hints.ai_flags = AI_PASSIVE;
1116
1117 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1118 if (err != 0) {
1119 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1120 exit(1);
1121 }
1122
1123 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1124 if (ai->ai_family != AF_INET6)
1125 continue;
1126
1127 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1128 sizeof(ntop), strport, sizeof(strport),
1129 NI_NUMERICHOST|NI_NUMERICSERV);
1130
1131 if (err != 0) {
1132 if (err == EAI_SYSTEM)
1133 perror("getnameinfo EAI_SYSTEM");
1134 else
1135 fprintf(stderr, "getnameinfo failed: %s\n",
1136 gai_strerror(err));
1137 exit(2);
1138 }
1139
1140 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1141 if (sock < 0)
1142 perror("socket");
1143 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1144 if (errno == EBADF)
1145 exit(3);
1146 }
1147 }
1148 exit(0);
1149}
1150 ],
1151 [
1152 AC_MSG_RESULT(yes)
1153 ],
1154 [
1155 AC_MSG_RESULT(no)
1156 AC_DEFINE(BROKEN_GETADDRINFO)
1157 ]
1158 )
1159fi
1160
Darren Tucker691d5232005-02-15 21:45:57 +11001161if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1162 AC_MSG_CHECKING(if getaddrinfo seems to work)
1163 AC_TRY_RUN(
1164 [
1165#include <stdio.h>
1166#include <sys/socket.h>
1167#include <netdb.h>
1168#include <errno.h>
1169#include <netinet/in.h>
1170
1171#define TEST_PORT "2222"
1172
1173int
1174main(void)
1175{
1176 int err, sock;
1177 struct addrinfo *gai_ai, *ai, hints;
1178 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1179
1180 memset(&hints, 0, sizeof(hints));
1181 hints.ai_family = PF_UNSPEC;
1182 hints.ai_socktype = SOCK_STREAM;
1183 hints.ai_flags = AI_PASSIVE;
1184
1185 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1186 if (err != 0) {
1187 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1188 exit(1);
1189 }
1190
1191 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1192 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1193 continue;
1194
1195 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1196 sizeof(ntop), strport, sizeof(strport),
1197 NI_NUMERICHOST|NI_NUMERICSERV);
1198
1199 if (ai->ai_family == AF_INET && err != 0) {
1200 perror("getnameinfo");
1201 exit(2);
1202 }
1203 }
1204 exit(0);
1205}
1206 ],
1207 [
1208 AC_MSG_RESULT(yes)
1209 AC_DEFINE(AIX_GETNAMEINFO_HACK, [],
1210[Define if you have a getaddrinfo that fails for the all-zeros IPv6 address])
1211 ],
1212 [
1213 AC_MSG_RESULT(no)
1214 AC_DEFINE(BROKEN_GETADDRINFO)
1215 ]
1216 )
1217fi
1218
Darren Tuckera56f1912004-11-02 20:30:54 +11001219if test "x$check_for_conflicting_getspnam" = "x1"; then
1220 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1221 AC_COMPILE_IFELSE(
1222 [
1223#include <shadow.h>
1224int main(void) {exit(0);}
1225 ],
1226 [
1227 AC_MSG_RESULT(no)
1228 ],
1229 [
1230 AC_MSG_RESULT(yes)
1231 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1232 [Conflicting defs for getspnam])
1233 ]
1234 )
1235fi
1236
Damien Miller606f8802000-09-16 15:39:56 +11001237AC_FUNC_GETPGRP
1238
Damien Millera64b57a2001-01-17 10:44:13 +11001239# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001240PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001241AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001242 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001243 [
Damien Millera64b57a2001-01-17 10:44:13 +11001244 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001245 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1246 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001247 AC_MSG_ERROR([PAM headers not found])
1248 fi
1249
1250 AC_CHECK_LIB(dl, dlopen, , )
1251 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1252 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001253 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001254
Damien Millera64b57a2001-01-17 10:44:13 +11001255 PAM_MSG="yes"
1256
1257 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001258 if test $ac_cv_lib_dl_dlopen = yes; then
1259 LIBPAM="-lpam -ldl"
1260 else
1261 LIBPAM="-lpam"
1262 fi
1263 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001264 fi
1265 ]
1266)
Damien Millera22ba012000-03-02 23:09:20 +11001267
Damien Millera64b57a2001-01-17 10:44:13 +11001268# Check for older PAM
1269if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001270 # Check PAM strerror arguments (old PAM)
1271 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1272 AC_TRY_COMPILE(
1273 [
Damien Miller81171112000-04-23 11:14:01 +10001274#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001275#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001276#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001277#elif defined (HAVE_PAM_PAM_APPL_H)
1278#include <pam/pam_appl.h>
1279#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001280 ],
1281 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001282 [AC_MSG_RESULT(no)],
1283 [
1284 AC_DEFINE(HAVE_OLD_PAM)
1285 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001286 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001287 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001288 )
Damien Millera22ba012000-03-02 23:09:20 +11001289fi
1290
Tim Riceaef73712002-05-11 13:17:42 -07001291# Search for OpenSSL
1292saved_CPPFLAGS="$CPPFLAGS"
1293saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001294AC_ARG_WITH(ssl-dir,
1295 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1296 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001297 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001298 case "$withval" in
1299 # Relative paths
1300 ./*|../*) withval="`pwd`/$withval"
1301 esac
Tim Riceaef73712002-05-11 13:17:42 -07001302 if test -d "$withval/lib"; then
1303 if test -n "${need_dash_r}"; then
1304 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1305 else
1306 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1307 fi
1308 else
1309 if test -n "${need_dash_r}"; then
1310 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1311 else
1312 LDFLAGS="-L${withval} ${LDFLAGS}"
1313 fi
1314 fi
1315 if test -d "$withval/include"; then
1316 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1317 else
1318 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1319 fi
Damien Millera22ba012000-03-02 23:09:20 +11001320 fi
1321 ]
1322)
Tim Rice3d5352e2004-02-12 09:27:21 -08001323LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001324AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001325 [
Tim Riceaef73712002-05-11 13:17:42 -07001326 dnl Check default openssl install dir
1327 if test -n "${need_dash_r}"; then
1328 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001329 else
Tim Riceaef73712002-05-11 13:17:42 -07001330 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001331 fi
Tim Riceaef73712002-05-11 13:17:42 -07001332 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1333 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1334 [
1335 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1336 ]
1337 )
1338 ]
1339)
1340
Tim Riced730b782002-08-13 18:52:10 -07001341# Determine OpenSSL header version
1342AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001343AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001344 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001345#include <stdio.h>
1346#include <string.h>
1347#include <openssl/opensslv.h>
1348#define DATA "conftest.sslincver"
1349int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001350 FILE *fd;
1351 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001352
Damien Millera8e06ce2003-11-21 23:48:55 +11001353 fd = fopen(DATA,"w");
1354 if(fd == NULL)
1355 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001356
1357 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1358 exit(1);
1359
1360 exit(0);
1361}
Darren Tucker623d92f2004-09-12 22:36:15 +10001362 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001363 [
1364 ssl_header_ver=`cat conftest.sslincver`
1365 AC_MSG_RESULT($ssl_header_ver)
1366 ],
1367 [
1368 AC_MSG_RESULT(not found)
1369 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001370 ],
1371 [
1372 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001373 ]
1374)
1375
1376# Determine OpenSSL library version
1377AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001378AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001379 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001380#include <stdio.h>
1381#include <string.h>
1382#include <openssl/opensslv.h>
1383#include <openssl/crypto.h>
1384#define DATA "conftest.ssllibver"
1385int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001386 FILE *fd;
1387 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001388
Damien Millera8e06ce2003-11-21 23:48:55 +11001389 fd = fopen(DATA,"w");
1390 if(fd == NULL)
1391 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001392
1393 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1394 exit(1);
1395
1396 exit(0);
1397}
Darren Tucker623d92f2004-09-12 22:36:15 +10001398 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001399 [
1400 ssl_library_ver=`cat conftest.ssllibver`
1401 AC_MSG_RESULT($ssl_library_ver)
1402 ],
1403 [
1404 AC_MSG_RESULT(not found)
1405 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001406 ],
1407 [
1408 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001409 ]
1410)
Damien Millera22ba012000-03-02 23:09:20 +11001411
Damien Millerec932372002-01-22 22:16:03 +11001412# Sanity check OpenSSL headers
1413AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001414AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001415 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001416#include <string.h>
1417#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001418int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001419 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001420 [
1421 AC_MSG_RESULT(yes)
1422 ],
1423 [
1424 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001425 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1426Check config.log for details.
1427Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001428 ],
1429 [
1430 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001431 ]
1432)
1433
Tim Rice3d5352e2004-02-12 09:27:21 -08001434# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1435# because the system crypt() is more featureful.
1436if test "x$check_for_libcrypt_before" = "x1"; then
1437 AC_CHECK_LIB(crypt, crypt)
1438fi
1439
Damien Millera8e06ce2003-11-21 23:48:55 +11001440# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001441# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001442if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001443 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001444fi
1445
Damien Miller6c21c512002-01-22 21:57:53 +11001446
1447### Configure cryptographic random number support
1448
1449# Check wheter OpenSSL seeds itself
1450AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001451AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001452 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001453#include <string.h>
1454#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001455int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001456 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001457 [
1458 OPENSSL_SEEDS_ITSELF=yes
1459 AC_MSG_RESULT(yes)
1460 ],
1461 [
1462 AC_MSG_RESULT(no)
1463 # Default to use of the rand helper if OpenSSL doesn't
1464 # seed itself
1465 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001466 ],
1467 [
1468 AC_MSG_WARN([cross compiling: assuming yes])
1469 # This is safe, since all recent OpenSSL versions will
1470 # complain at runtime if not seeded correctly.
1471 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001472 ]
1473)
1474
1475
1476# Do we want to force the use of the rand helper?
1477AC_ARG_WITH(rand-helper,
1478 [ --with-rand-helper Use subprocess to gather strong randomness ],
1479 [
1480 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001481 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001482 # the previous test showed it to be unseeded.
1483 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1484 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1485 OPENSSL_SEEDS_ITSELF=yes
1486 USE_RAND_HELPER=""
1487 fi
1488 else
1489 USE_RAND_HELPER=yes
1490 fi
1491 ],
1492)
1493
1494# Which randomness source do we use?
1495if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1496 # OpenSSL only
1497 AC_DEFINE(OPENSSL_PRNG_ONLY)
1498 RAND_MSG="OpenSSL internal ONLY"
1499 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001500elif test ! -z "$USE_RAND_HELPER" ; then
1501 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001502 RAND_MSG="ssh-rand-helper"
1503 INSTALL_SSH_RAND_HELPER="yes"
1504fi
1505AC_SUBST(INSTALL_SSH_RAND_HELPER)
1506
1507### Configuration of ssh-rand-helper
1508
1509# PRNGD TCP socket
1510AC_ARG_WITH(prngd-port,
1511 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1512 [
Damien Millere996d722002-01-23 11:20:59 +11001513 case "$withval" in
1514 no)
1515 withval=""
1516 ;;
1517 [[0-9]]*)
1518 ;;
1519 *)
1520 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1521 ;;
1522 esac
1523 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001524 PRNGD_PORT="$withval"
1525 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1526 fi
1527 ]
1528)
1529
1530# PRNGD Unix domain socket
1531AC_ARG_WITH(prngd-socket,
1532 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1533 [
Damien Millere996d722002-01-23 11:20:59 +11001534 case "$withval" in
1535 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001536 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001537 ;;
1538 no)
1539 withval=""
1540 ;;
1541 /*)
1542 ;;
1543 *)
1544 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1545 ;;
1546 esac
1547
1548 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001549 if test ! -z "$PRNGD_PORT" ; then
1550 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1551 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001552 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001553 AC_MSG_WARN(Entropy socket is not readable)
1554 fi
1555 PRNGD_SOCKET="$withval"
1556 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1557 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001558 ],
1559 [
1560 # Check for existing socket only if we don't have a random device already
1561 if test "$USE_RAND_HELPER" = yes ; then
1562 AC_MSG_CHECKING(for PRNGD/EGD socket)
1563 # Insert other locations here
1564 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1565 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1566 PRNGD_SOCKET="$sock"
1567 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1568 break;
1569 fi
1570 done
1571 if test ! -z "$PRNGD_SOCKET" ; then
1572 AC_MSG_RESULT($PRNGD_SOCKET)
1573 else
1574 AC_MSG_RESULT(not found)
1575 fi
1576 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001577 ]
1578)
1579
1580# Change default command timeout for hashing entropy source
1581entropy_timeout=200
1582AC_ARG_WITH(entropy-timeout,
1583 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1584 [
1585 if test "x$withval" != "xno" ; then
1586 entropy_timeout=$withval
1587 fi
1588 ]
1589)
Damien Miller6c21c512002-01-22 21:57:53 +11001590AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1591
Damien Millerd3f6ad22002-06-25 10:24:47 +10001592SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001593AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001594 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001595 [
1596 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001597 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001598 fi
1599 ]
1600)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001601AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1602AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001603
Tim Rice88f2ab52002-03-17 12:17:34 -08001604# We do this little dance with the search path to insure
1605# that programs that we select for use by installed programs
1606# (which may be run by the super-user) come from trusted
1607# locations before they come from the user's private area.
1608# This should help avoid accidentally configuring some
1609# random version of a program in someone's personal bin.
1610
1611OPATH=$PATH
1612PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001613test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001614test -d /sbin && PATH=$PATH:/sbin
1615test -d /usr/sbin && PATH=$PATH:/usr/sbin
1616PATH=$PATH:/etc:$OPATH
1617
Damien Millera8e06ce2003-11-21 23:48:55 +11001618# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001619OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1620OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1621OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1622OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1623OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1624OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1625OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1626OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1627OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1628OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1629OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1630OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1631OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1632OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1633OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1634OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001635# restore PATH
1636PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001637
1638# Where does ssh-rand-helper get its randomness from?
1639INSTALL_SSH_PRNG_CMDS=""
1640if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1641 if test ! -z "$PRNGD_PORT" ; then
1642 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1643 elif test ! -z "$PRNGD_SOCKET" ; then
1644 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1645 else
1646 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1647 RAND_HELPER_CMDHASH=yes
1648 INSTALL_SSH_PRNG_CMDS="yes"
1649 fi
1650fi
1651AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1652
1653
Ben Lindstromb5628642000-10-18 00:02:25 +00001654# Cheap hack to ensure NEWS-OS libraries are arranged right.
1655if test ! -z "$SONY" ; then
1656 LIBS="$LIBS -liberty";
1657fi
1658
Damien Millera22ba012000-03-02 23:09:20 +11001659# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001660AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001661AC_CHECK_SIZEOF(short int, 2)
1662AC_CHECK_SIZEOF(int, 4)
1663AC_CHECK_SIZEOF(long int, 4)
1664AC_CHECK_SIZEOF(long long int, 8)
1665
Damien Millerfa2bb692002-04-23 23:22:25 +10001666# Sanity check long long for some platforms (AIX)
1667if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1668 ac_cv_sizeof_long_long_int=0
1669fi
1670
Damien Millera22ba012000-03-02 23:09:20 +11001671# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001672AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1673 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001674 [ #include <sys/types.h> ],
1675 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001676 [ ac_cv_have_u_int="yes" ],
1677 [ ac_cv_have_u_int="no" ]
1678 )
1679])
1680if test "x$ac_cv_have_u_int" = "xyes" ; then
1681 AC_DEFINE(HAVE_U_INT)
1682 have_u_int=1
1683fi
1684
Damien Miller61e50f12000-05-08 20:49:37 +10001685AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1686 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001687 [ #include <sys/types.h> ],
1688 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001689 [ ac_cv_have_intxx_t="yes" ],
1690 [ ac_cv_have_intxx_t="no" ]
1691 )
1692])
1693if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1694 AC_DEFINE(HAVE_INTXX_T)
1695 have_intxx_t=1
1696fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001697
1698if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001699 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001700then
1701 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1702 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001703 [ #include <stdint.h> ],
1704 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001705 [
1706 AC_DEFINE(HAVE_INTXX_T)
1707 AC_MSG_RESULT(yes)
1708 ],
1709 [ AC_MSG_RESULT(no) ]
1710 )
1711fi
1712
Damien Miller578783e2000-09-23 14:12:24 +11001713AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1714 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001715 [
1716#include <sys/types.h>
1717#ifdef HAVE_STDINT_H
1718# include <stdint.h>
1719#endif
1720#include <sys/socket.h>
1721#ifdef HAVE_SYS_BITYPES_H
1722# include <sys/bitypes.h>
1723#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001724 ],
1725 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001726 [ ac_cv_have_int64_t="yes" ],
1727 [ ac_cv_have_int64_t="no" ]
1728 )
1729])
1730if test "x$ac_cv_have_int64_t" = "xyes" ; then
1731 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001732fi
1733
Damien Miller61e50f12000-05-08 20:49:37 +10001734AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1735 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001736 [ #include <sys/types.h> ],
1737 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001738 [ ac_cv_have_u_intxx_t="yes" ],
1739 [ ac_cv_have_u_intxx_t="no" ]
1740 )
1741])
1742if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1743 AC_DEFINE(HAVE_U_INTXX_T)
1744 have_u_intxx_t=1
1745fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001746
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001747if test -z "$have_u_intxx_t" ; then
1748 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1749 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001750 [ #include <sys/socket.h> ],
1751 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001752 [
1753 AC_DEFINE(HAVE_U_INTXX_T)
1754 AC_MSG_RESULT(yes)
1755 ],
1756 [ AC_MSG_RESULT(no) ]
1757 )
1758fi
1759
Damien Miller578783e2000-09-23 14:12:24 +11001760AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1761 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001762 [ #include <sys/types.h> ],
1763 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001764 [ ac_cv_have_u_int64_t="yes" ],
1765 [ ac_cv_have_u_int64_t="no" ]
1766 )
1767])
1768if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1769 AC_DEFINE(HAVE_U_INT64_T)
1770 have_u_int64_t=1
1771fi
1772
Tim Rice4cec93f2002-02-26 08:40:48 -08001773if test -z "$have_u_int64_t" ; then
1774 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1775 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001776 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001777 [ u_int64_t a; a = 1],
1778 [
1779 AC_DEFINE(HAVE_U_INT64_T)
1780 AC_MSG_RESULT(yes)
1781 ],
1782 [ AC_MSG_RESULT(no) ]
1783 )
1784fi
1785
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001786if test -z "$have_u_intxx_t" ; then
1787 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1788 AC_TRY_COMPILE(
1789 [
1790#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001791 ],
1792 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001793 [ ac_cv_have_uintxx_t="yes" ],
1794 [ ac_cv_have_uintxx_t="no" ]
1795 )
1796 ])
1797 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1798 AC_DEFINE(HAVE_UINTXX_T)
1799 fi
1800fi
1801
1802if test -z "$have_uintxx_t" ; then
1803 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1804 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001805 [ #include <stdint.h> ],
1806 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001807 [
1808 AC_DEFINE(HAVE_UINTXX_T)
1809 AC_MSG_RESULT(yes)
1810 ],
1811 [ AC_MSG_RESULT(no) ]
1812 )
1813fi
1814
Damien Milleredb82922000-06-20 13:25:52 +10001815if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001816 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001817then
1818 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1819 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001820 [
1821#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001822 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001823 [
Damien Miller70494d12000-04-03 15:57:06 +10001824 int8_t a; int16_t b; int32_t c;
1825 u_int8_t e; u_int16_t f; u_int32_t g;
1826 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001827 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001828 [
1829 AC_DEFINE(HAVE_U_INTXX_T)
1830 AC_DEFINE(HAVE_INTXX_T)
1831 AC_MSG_RESULT(yes)
1832 ],
1833 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001834 )
Damien Millerb29ea912000-01-15 14:12:03 +11001835fi
1836
Damien Miller58be7382001-09-15 21:31:54 +10001837
1838AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1839 AC_TRY_COMPILE(
1840 [
1841#include <sys/types.h>
1842 ],
1843 [ u_char foo; foo = 125; ],
1844 [ ac_cv_have_u_char="yes" ],
1845 [ ac_cv_have_u_char="no" ]
1846 )
1847])
1848if test "x$ac_cv_have_u_char" = "xyes" ; then
1849 AC_DEFINE(HAVE_U_CHAR)
1850fi
1851
Tim Rice13aae5e2001-10-21 17:53:58 -07001852TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001853
Tim Rice200a5c02002-02-26 22:12:34 -08001854AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001855
Damien Miller848b9932005-02-24 12:12:34 +11001856AC_CHECK_TYPES(in_addr_t,,,
1857[#include <sys/types.h>
1858#include <netinet/in.h>])
Darren Tuckerd9f88912005-02-20 21:01:48 +11001859
Damien Miller61e50f12000-05-08 20:49:37 +10001860AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1861 AC_TRY_COMPILE(
1862 [
1863#include <sys/types.h>
1864 ],
1865 [ size_t foo; foo = 1235; ],
1866 [ ac_cv_have_size_t="yes" ],
1867 [ ac_cv_have_size_t="no" ]
1868 )
1869])
1870if test "x$ac_cv_have_size_t" = "xyes" ; then
1871 AC_DEFINE(HAVE_SIZE_T)
1872fi
Damien Miller95058511999-12-29 10:36:45 +11001873
Damien Miller615f9392000-05-17 22:53:33 +10001874AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1875 AC_TRY_COMPILE(
1876 [
1877#include <sys/types.h>
1878 ],
1879 [ ssize_t foo; foo = 1235; ],
1880 [ ac_cv_have_ssize_t="yes" ],
1881 [ ac_cv_have_ssize_t="no" ]
1882 )
1883])
1884if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1885 AC_DEFINE(HAVE_SSIZE_T)
1886fi
1887
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001888AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1889 AC_TRY_COMPILE(
1890 [
1891#include <time.h>
1892 ],
1893 [ clock_t foo; foo = 1235; ],
1894 [ ac_cv_have_clock_t="yes" ],
1895 [ ac_cv_have_clock_t="no" ]
1896 )
1897])
1898if test "x$ac_cv_have_clock_t" = "xyes" ; then
1899 AC_DEFINE(HAVE_CLOCK_T)
1900fi
1901
Damien Millerb54b40e2000-06-23 08:23:34 +10001902AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1903 AC_TRY_COMPILE(
1904 [
1905#include <sys/types.h>
1906#include <sys/socket.h>
1907 ],
1908 [ sa_family_t foo; foo = 1235; ],
1909 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001910 [ AC_TRY_COMPILE(
1911 [
1912#include <sys/types.h>
1913#include <sys/socket.h>
1914#include <netinet/in.h>
1915 ],
1916 [ sa_family_t foo; foo = 1235; ],
1917 [ ac_cv_have_sa_family_t="yes" ],
1918
Damien Millerb54b40e2000-06-23 08:23:34 +10001919 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001920 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001921 )
1922])
1923if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1924 AC_DEFINE(HAVE_SA_FAMILY_T)
1925fi
1926
Damien Miller0f91b4e2000-06-18 15:43:25 +10001927AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1928 AC_TRY_COMPILE(
1929 [
1930#include <sys/types.h>
1931 ],
1932 [ pid_t foo; foo = 1235; ],
1933 [ ac_cv_have_pid_t="yes" ],
1934 [ ac_cv_have_pid_t="no" ]
1935 )
1936])
1937if test "x$ac_cv_have_pid_t" = "xyes" ; then
1938 AC_DEFINE(HAVE_PID_T)
1939fi
1940
1941AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1942 AC_TRY_COMPILE(
1943 [
1944#include <sys/types.h>
1945 ],
1946 [ mode_t foo; foo = 1235; ],
1947 [ ac_cv_have_mode_t="yes" ],
1948 [ ac_cv_have_mode_t="no" ]
1949 )
1950])
1951if test "x$ac_cv_have_mode_t" = "xyes" ; then
1952 AC_DEFINE(HAVE_MODE_T)
1953fi
1954
Damien Miller61e50f12000-05-08 20:49:37 +10001955
1956AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1957 AC_TRY_COMPILE(
1958 [
Damien Miller81171112000-04-23 11:14:01 +10001959#include <sys/types.h>
1960#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001961 ],
1962 [ struct sockaddr_storage s; ],
1963 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1964 [ ac_cv_have_struct_sockaddr_storage="no" ]
1965 )
1966])
1967if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1968 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1969fi
Damien Miller34132e52000-01-14 15:45:46 +11001970
Damien Miller61e50f12000-05-08 20:49:37 +10001971AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1972 AC_TRY_COMPILE(
1973 [
Damien Miller7b22d652000-06-18 14:07:04 +10001974#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001975#include <netinet/in.h>
1976 ],
1977 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1978 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1979 [ ac_cv_have_struct_sockaddr_in6="no" ]
1980 )
1981])
1982if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1983 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1984fi
Damien Miller34132e52000-01-14 15:45:46 +11001985
Damien Miller61e50f12000-05-08 20:49:37 +10001986AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1987 AC_TRY_COMPILE(
1988 [
Damien Miller7b22d652000-06-18 14:07:04 +10001989#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001990#include <netinet/in.h>
1991 ],
1992 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1993 [ ac_cv_have_struct_in6_addr="yes" ],
1994 [ ac_cv_have_struct_in6_addr="no" ]
1995 )
1996])
1997if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1998 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1999fi
Damien Miller34132e52000-01-14 15:45:46 +11002000
Damien Miller61e50f12000-05-08 20:49:37 +10002001AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2002 AC_TRY_COMPILE(
2003 [
Damien Miller81171112000-04-23 11:14:01 +10002004#include <sys/types.h>
2005#include <sys/socket.h>
2006#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002007 ],
2008 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
2009 [ ac_cv_have_struct_addrinfo="yes" ],
2010 [ ac_cv_have_struct_addrinfo="no" ]
2011 )
2012])
2013if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
2014 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
2015fi
2016
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002017AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2018 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002019 [ #include <sys/time.h> ],
2020 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002021 [ ac_cv_have_struct_timeval="yes" ],
2022 [ ac_cv_have_struct_timeval="no" ]
2023 )
2024])
2025if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
2026 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
2027 have_struct_timeval=1
2028fi
2029
Tim Rice4e4dc562003-03-18 10:21:40 -08002030AC_CHECK_TYPES(struct timespec)
2031
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002032# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002033if test "x$ac_cv_have_int64_t" = "xno" -a \
2034 "x$ac_cv_sizeof_long_int" != "x8" -a \
2035 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002036 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2037 echo "an alternative compiler (I.E., GCC) before continuing."
2038 echo ""
2039 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08002040else
2041dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10002042 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10002043 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08002044#include <stdio.h>
2045#include <string.h>
2046#ifdef HAVE_SNPRINTF
2047main()
2048{
2049 char buf[50];
2050 char expected_out[50];
2051 int mazsize = 50 ;
2052#if (SIZEOF_LONG_INT == 8)
2053 long int num = 0x7fffffffffffffff;
2054#else
Kevin Steves6482ec82001-07-15 02:09:28 +00002055 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08002056#endif
2057 strcpy(expected_out, "9223372036854775807");
2058 snprintf(buf, mazsize, "%lld", num);
2059 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11002060 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08002061 exit(0);
2062}
2063#else
2064main() { exit(0); }
2065#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10002066 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10002067 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08002068 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002069fi
2070
Damien Miller78315eb2000-09-29 23:01:36 +11002071dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10002072OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2073OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2074OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2075OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2076OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002077OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002078OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2079OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002080OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002081OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2082OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2083OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2084OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002085OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2086OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2087OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2088OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002089
2090AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00002091
Damien Miller61e50f12000-05-08 20:49:37 +10002092AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2093 ac_cv_have_ss_family_in_struct_ss, [
2094 AC_TRY_COMPILE(
2095 [
Damien Miller81171112000-04-23 11:14:01 +10002096#include <sys/types.h>
2097#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002098 ],
2099 [ struct sockaddr_storage s; s.ss_family = 1; ],
2100 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2101 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2102 )
2103])
2104if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2105 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
2106fi
2107
Damien Miller61e50f12000-05-08 20:49:37 +10002108AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2109 ac_cv_have___ss_family_in_struct_ss, [
2110 AC_TRY_COMPILE(
2111 [
Damien Miller81171112000-04-23 11:14:01 +10002112#include <sys/types.h>
2113#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002114 ],
2115 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2116 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2117 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2118 )
2119])
2120if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2121 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
2122fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002123
Damien Millerad833b32000-08-23 10:46:23 +10002124AC_CACHE_CHECK([for pw_class field in struct passwd],
2125 ac_cv_have_pw_class_in_struct_passwd, [
2126 AC_TRY_COMPILE(
2127 [
Damien Millerad833b32000-08-23 10:46:23 +10002128#include <pwd.h>
2129 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002130 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002131 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2132 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2133 )
2134])
2135if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2136 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
2137fi
2138
Kevin Steves82456952001-06-22 21:14:18 +00002139AC_CACHE_CHECK([for pw_expire field in struct passwd],
2140 ac_cv_have_pw_expire_in_struct_passwd, [
2141 AC_TRY_COMPILE(
2142 [
2143#include <pwd.h>
2144 ],
2145 [ struct passwd p; p.pw_expire = 0; ],
2146 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2147 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2148 )
2149])
2150if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2151 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
2152fi
2153
2154AC_CACHE_CHECK([for pw_change field in struct passwd],
2155 ac_cv_have_pw_change_in_struct_passwd, [
2156 AC_TRY_COMPILE(
2157 [
2158#include <pwd.h>
2159 ],
2160 [ struct passwd p; p.pw_change = 0; ],
2161 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2162 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2163 )
2164])
2165if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2166 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
2167fi
Damien Miller61e50f12000-05-08 20:49:37 +10002168
Tim Rice28bbb0c2002-05-27 17:37:32 -07002169dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002170AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2171 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002172 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002173 [
Tim Riceae49fe62002-04-12 10:26:21 -07002174#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002175#include <sys/socket.h>
2176#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002177int main() {
2178#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002179#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002180exit(1);
2181#endif
2182struct msghdr m;
2183m.msg_accrights = 0;
2184exit(0);
2185}
Kevin Steves939c9db2002-03-22 17:23:25 +00002186 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002187 [ ac_cv_have_accrights_in_msghdr="yes" ],
2188 [ ac_cv_have_accrights_in_msghdr="no" ]
2189 )
2190])
2191if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2192 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2193fi
2194
Kevin Stevesa44e0352002-04-07 16:18:03 +00002195AC_CACHE_CHECK([for msg_control field in struct msghdr],
2196 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002197 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002198 [
Tim Riceae49fe62002-04-12 10:26:21 -07002199#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002200#include <sys/socket.h>
2201#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002202int main() {
2203#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002204#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002205exit(1);
2206#endif
2207struct msghdr m;
2208m.msg_control = 0;
2209exit(0);
2210}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002211 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002212 [ ac_cv_have_control_in_msghdr="yes" ],
2213 [ ac_cv_have_control_in_msghdr="no" ]
2214 )
2215])
2216if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2217 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2218fi
2219
Damien Miller61e50f12000-05-08 20:49:37 +10002220AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002221 AC_TRY_LINK([],
2222 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002223 [ ac_cv_libc_defines___progname="yes" ],
2224 [ ac_cv_libc_defines___progname="no" ]
2225 )
2226])
2227if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2228 AC_DEFINE(HAVE___PROGNAME)
2229fi
2230
Kevin Steves4846f4a2002-03-22 18:19:53 +00002231AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2232 AC_TRY_LINK([
2233#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002234],
2235 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002236 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2237 [ ac_cv_cc_implements___FUNCTION__="no" ]
2238 )
2239])
2240if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2241 AC_DEFINE(HAVE___FUNCTION__)
2242fi
2243
2244AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2245 AC_TRY_LINK([
2246#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002247],
2248 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002249 [ ac_cv_cc_implements___func__="yes" ],
2250 [ ac_cv_cc_implements___func__="no" ]
2251 )
2252])
2253if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2254 AC_DEFINE(HAVE___func__)
2255fi
2256
Damien Miller4f8e6692001-07-14 13:22:53 +10002257AC_CACHE_CHECK([whether getopt has optreset support],
2258 ac_cv_have_getopt_optreset, [
2259 AC_TRY_LINK(
2260 [
2261#include <getopt.h>
2262 ],
2263 [ extern int optreset; optreset = 0; ],
2264 [ ac_cv_have_getopt_optreset="yes" ],
2265 [ ac_cv_have_getopt_optreset="no" ]
2266 )
2267])
2268if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2269 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2270fi
Damien Millera22ba012000-03-02 23:09:20 +11002271
Damien Millerecbb26d2000-07-15 14:59:14 +10002272AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002273 AC_TRY_LINK([],
2274 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002275 [ ac_cv_libc_defines_sys_errlist="yes" ],
2276 [ ac_cv_libc_defines_sys_errlist="no" ]
2277 )
2278])
2279if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2280 AC_DEFINE(HAVE_SYS_ERRLIST)
2281fi
2282
2283
Damien Miller11fa2cc2000-08-16 10:35:58 +10002284AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002285 AC_TRY_LINK([],
2286 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002287 [ ac_cv_libc_defines_sys_nerr="yes" ],
2288 [ ac_cv_libc_defines_sys_nerr="no" ]
2289 )
2290])
2291if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2292 AC_DEFINE(HAVE_SYS_NERR)
2293fi
2294
Damien Millera8e06ce2003-11-21 23:48:55 +11002295SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002296# Check whether user wants sectok support
2297AC_ARG_WITH(sectok,
2298 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002299 [
2300 if test "x$withval" != "xno" ; then
2301 if test "x$withval" != "xyes" ; then
2302 CPPFLAGS="$CPPFLAGS -I${withval}"
2303 LDFLAGS="$LDFLAGS -L${withval}"
2304 if test ! -z "$need_dash_r" ; then
2305 LDFLAGS="$LDFLAGS -R${withval}"
2306 fi
2307 if test ! -z "$blibpath" ; then
2308 blibpath="$blibpath:${withval}"
2309 fi
2310 fi
2311 AC_CHECK_HEADERS(sectok.h)
2312 if test "$ac_cv_header_sectok_h" != yes; then
2313 AC_MSG_ERROR(Can't find sectok.h)
2314 fi
2315 AC_CHECK_LIB(sectok, sectok_open)
2316 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2317 AC_MSG_ERROR(Can't find libsectok)
2318 fi
2319 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002320 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002321 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002322 fi
2323 ]
2324)
2325
2326# Check whether user wants OpenSC support
2327AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002328 AC_HELP_STRING([--with-opensc=PFX],
2329 [Enable smartcard support using OpenSC]),
2330 opensc_config_prefix="$withval", opensc_config_prefix="")
2331if test x$opensc_config_prefix != x ; then
2332 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2333 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2334 if test "$OPENSC_CONFIG" != "no"; then
2335 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2336 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2337 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2338 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2339 AC_DEFINE(SMARTCARD)
2340 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002341 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002342 fi
2343fi
Damien Miller85de5802001-09-18 14:01:11 +10002344
Darren Tucker5f88d342003-10-15 16:57:57 +10002345# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002346AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002347 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002348 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002349 # Needed by our getrrsetbyname()
2350 AC_SEARCH_LIBS(res_query, resolv)
2351 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002352 AC_MSG_CHECKING(if res_query will link)
2353 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2354 [AC_MSG_RESULT(no)
2355 saved_LIBS="$LIBS"
2356 LIBS="$LIBS -lresolv"
2357 AC_MSG_CHECKING(for res_query in -lresolv)
2358 AC_LINK_IFELSE([
2359#include <resolv.h>
2360int main()
2361{
2362 res_query (0, 0, 0, 0, 0);
2363 return 0;
2364}
2365 ],
2366 [LIBS="$LIBS -lresolv"
2367 AC_MSG_RESULT(yes)],
2368 [LIBS="$saved_LIBS"
2369 AC_MSG_RESULT(no)])
2370 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002371 AC_CHECK_FUNCS(_getshort _getlong)
2372 AC_CHECK_MEMBER(HEADER.ad,
2373 [AC_DEFINE(HAVE_HEADER_AD)],,
2374 [#include <arpa/nameser.h>])
2375 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002376
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002377# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002378KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002379AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002380 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002381 [ if test "x$withval" != "xno" ; then
2382 if test "x$withval" = "xyes" ; then
2383 KRB5ROOT="/usr/local"
2384 else
2385 KRB5ROOT=${withval}
2386 fi
2387
2388 AC_DEFINE(KRB5)
2389 KRB5_MSG="yes"
2390
2391 AC_MSG_CHECKING(for krb5-config)
2392 if test -x $KRB5ROOT/bin/krb5-config ; then
2393 KRB5CONF=$KRB5ROOT/bin/krb5-config
2394 AC_MSG_RESULT($KRB5CONF)
2395
2396 AC_MSG_CHECKING(for gssapi support)
2397 if $KRB5CONF | grep gssapi >/dev/null ; then
2398 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002399 AC_DEFINE(GSSAPI)
2400 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002401 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002402 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002403 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002404 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002405 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2406 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002407 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002408 AC_MSG_CHECKING(whether we are using Heimdal)
2409 AC_TRY_COMPILE([ #include <krb5.h> ],
2410 [ char *tmp = heimdal_version; ],
2411 [ AC_MSG_RESULT(yes)
2412 AC_DEFINE(HEIMDAL) ],
2413 AC_MSG_RESULT(no)
2414 )
2415 else
2416 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002417 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002418 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002419 AC_MSG_CHECKING(whether we are using Heimdal)
2420 AC_TRY_COMPILE([ #include <krb5.h> ],
2421 [ char *tmp = heimdal_version; ],
2422 [ AC_MSG_RESULT(yes)
2423 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10002424 K5LIBS="-lkrb5 -ldes"
2425 K5LIBS="$K5LIBS -lcom_err -lasn1"
2426 AC_CHECK_LIB(roken, net_write,
2427 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11002428 ],
2429 [ AC_MSG_RESULT(no)
2430 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2431 ]
2432 )
Damien Miller200d0a72003-06-30 19:21:36 +10002433 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002434
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002435 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2436 [ AC_DEFINE(GSSAPI)
2437 K5LIBS="-lgssapi $K5LIBS" ],
2438 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2439 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002440 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002441 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2442 $K5LIBS)
2443 ],
2444 $K5LIBS)
2445
2446 AC_CHECK_HEADER(gssapi.h, ,
2447 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002448 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002449 AC_CHECK_HEADERS(gssapi.h, ,
2450 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002451 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002452 ]
2453 )
2454
2455 oldCPP="$CPPFLAGS"
2456 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2457 AC_CHECK_HEADER(gssapi_krb5.h, ,
2458 [ CPPFLAGS="$oldCPP" ])
2459
Damien Millera8e06ce2003-11-21 23:48:55 +11002460 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002461 if test ! -z "$need_dash_r" ; then
2462 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2463 fi
2464 if test ! -z "$blibpath" ; then
2465 blibpath="$blibpath:${KRB5ROOT}/lib"
2466 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002467 fi
2468
2469 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2470 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2471 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2472
2473 LIBS="$LIBS $K5LIBS"
2474 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
Ben Lindstroma8104b52004-04-07 04:16:11 +00002475 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
Darren Tucker0d27ed12004-02-24 10:37:33 +11002476 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002477)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002478
Damien Millera22ba012000-03-02 23:09:20 +11002479# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002480
Damien Millerf58c6722002-05-13 13:15:42 +10002481PRIVSEP_PATH=/var/empty
2482AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002483 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002484 [
2485 if test "x$withval" != "$no" ; then
2486 PRIVSEP_PATH=$withval
2487 fi
2488 ]
2489)
2490AC_SUBST(PRIVSEP_PATH)
2491
Damien Millera22ba012000-03-02 23:09:20 +11002492AC_ARG_WITH(xauth,
2493 [ --with-xauth=PATH Specify path to xauth program ],
2494 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002495 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002496 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002497 fi
2498 ],
2499 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002500 TestPath="$PATH"
2501 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2502 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2503 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2504 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2505 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002506 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002507 xauth_path="/usr/openwin/bin/xauth"
2508 fi
2509 ]
2510)
2511
Damien Miller7d901272003-01-13 16:55:22 +11002512STRIP_OPT=-s
2513AC_ARG_ENABLE(strip,
2514 [ --disable-strip Disable calling strip(1) on install],
2515 [
2516 if test "x$enableval" = "xno" ; then
2517 STRIP_OPT=
2518 fi
2519 ]
2520)
2521AC_SUBST(STRIP_OPT)
2522
Damien Millera19cf472000-11-29 13:28:50 +11002523if test -z "$xauth_path" ; then
2524 XAUTH_PATH="undefined"
2525 AC_SUBST(XAUTH_PATH)
2526else
Damien Millera22ba012000-03-02 23:09:20 +11002527 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002528 XAUTH_PATH=$xauth_path
2529 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002530fi
Damien Millera22ba012000-03-02 23:09:20 +11002531
2532# Check for mail directory (last resort if we cannot get it from headers)
2533if test ! -z "$MAIL" ; then
2534 maildir=`dirname $MAIL`
2535 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2536fi
2537
Darren Tucker623d92f2004-09-12 22:36:15 +10002538if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002539 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2540 disable_ptmx_check=yes
2541fi
Damien Millera22ba012000-03-02 23:09:20 +11002542if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002543 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002544 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002545 [
2546 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2547 have_dev_ptmx=1
2548 ]
2549 )
2550 fi
Damien Millera22ba012000-03-02 23:09:20 +11002551fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10002552
Darren Tucker623d92f2004-09-12 22:36:15 +10002553if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002554 AC_CHECK_FILE("/dev/ptc",
2555 [
2556 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2557 have_dev_ptc=1
2558 ]
2559 )
2560else
2561 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2562fi
Damien Miller204ad072000-03-02 23:56:12 +11002563
Damien Millera22ba012000-03-02 23:09:20 +11002564# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002565AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002566 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002567 [
Damien Miller897741e2001-04-16 10:41:46 +10002568 case "$withval" in
2569 man|cat|doc)
2570 MANTYPE=$withval
2571 ;;
2572 *)
2573 AC_MSG_ERROR(invalid man type: $withval)
2574 ;;
2575 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002576 ]
2577)
Ben Lindstrombc709922001-04-18 18:04:21 +00002578if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002579 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2580 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002581 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2582 MANTYPE=doc
2583 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2584 MANTYPE=man
2585 else
2586 MANTYPE=cat
2587 fi
2588fi
Damien Miller670a4b82000-01-22 13:53:11 +11002589AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002590if test "$MANTYPE" = "doc"; then
2591 mansubdir=man;
2592else
2593 mansubdir=$MANTYPE;
2594fi
2595AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002596
Damien Millera22ba012000-03-02 23:09:20 +11002597# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002598MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002599AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002600 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002601 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002602 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002603 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002604 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002605 fi
2606 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002607)
2608
Damien Millera22ba012000-03-02 23:09:20 +11002609# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002610AC_ARG_WITH(shadow,
2611 [ --without-shadow Disable shadow password support],
2612 [
2613 if test "x$withval" = "xno" ; then
2614 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002615 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002616 fi
2617 ]
2618)
2619
Damien Miller1f335fb2000-06-26 11:31:33 +10002620if test -z "$disable_shadow" ; then
2621 AC_MSG_CHECKING([if the systems has expire shadow information])
2622 AC_TRY_COMPILE(
2623 [
2624#include <sys/types.h>
2625#include <shadow.h>
2626 struct spwd sp;
2627 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2628 [ sp_expire_available=yes ], []
2629 )
2630
2631 if test "x$sp_expire_available" = "xyes" ; then
2632 AC_MSG_RESULT(yes)
2633 AC_DEFINE(HAS_SHADOW_EXPIRE)
2634 else
2635 AC_MSG_RESULT(no)
2636 fi
2637fi
2638
Damien Millera22ba012000-03-02 23:09:20 +11002639# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002640if test ! -z "$IPADDR_IN_DISPLAY" ; then
2641 DISPLAY_HACK_MSG="yes"
2642 AC_DEFINE(IPADDR_IN_DISPLAY)
2643else
Damien Millera8e06ce2003-11-21 23:48:55 +11002644 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002645 AC_ARG_WITH(ipaddr-display,
2646 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2647 [
2648 if test "x$withval" != "xno" ; then
2649 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002650 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002651 fi
2652 ]
2653 )
2654fi
Damien Miller76112de1999-12-21 11:18:08 +11002655
Darren Tuckere1a790d2003-09-16 11:52:19 +10002656# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002657AC_ARG_ENABLE(etc-default-login,
Darren Tucker1b6f2292005-02-11 16:11:49 +11002658 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
Darren Tucker2f9573d2005-02-10 22:28:54 +11002659 [ if test "x$enableval" = "xno"; then
2660 AC_MSG_NOTICE([/etc/default/login handling disabled])
2661 etc_default_login=no
2662 else
2663 etc_default_login=yes
2664 fi ],
2665 [ etc_default_login=yes ]
2666)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002667
Darren Tucker2f9573d2005-02-10 22:28:54 +11002668if test "x$etc_default_login" != "xno"; then
2669 AC_CHECK_FILE("/etc/default/login",
2670 [ external_path_file=/etc/default/login ])
Darren Tucker623d92f2004-09-12 22:36:15 +10002671 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2672 then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002673 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2674 elif test "x$external_path_file" = "x/etc/default/login"; then
2675 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2676 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11002677fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002678
Tim Rice43a1c132002-04-17 21:19:14 -07002679dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2680if test $ac_cv_func_login_getcapbool = "yes" -a \
2681 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002682 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002683fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002684
Damien Millera22ba012000-03-02 23:09:20 +11002685# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002686SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002687AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002688 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002689 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002690 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002691 AC_MSG_WARN([
2692--with-default-path=PATH has no effect on this system.
2693Edit /etc/login.conf instead.])
2694 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002695 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002696 AC_MSG_WARN([
2697--with-default-path=PATH will only be used if PATH is not defined in
2698$external_path_file .])
2699 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002700 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002701 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002702 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002703 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002704 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2705 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002706 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002707 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002708 AC_MSG_WARN([
2709If PATH is defined in $external_path_file, ensure the path to scp is included,
2710otherwise scp will not work.])
2711 fi
2712 AC_TRY_RUN(
2713 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002714/* find out what STDPATH is */
2715#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002716#ifdef HAVE_PATHS_H
2717# include <paths.h>
2718#endif
2719#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002720# ifdef _PATH_USERPATH /* Irix */
2721# define _PATH_STDPATH _PATH_USERPATH
2722# else
2723# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2724# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002725#endif
2726#include <sys/types.h>
2727#include <sys/stat.h>
2728#include <fcntl.h>
2729#define DATA "conftest.stdpath"
2730
2731main()
2732{
2733 FILE *fd;
2734 int rc;
2735
2736 fd = fopen(DATA,"w");
2737 if(fd == NULL)
2738 exit(1);
2739
2740 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2741 exit(1);
2742
2743 exit(0);
2744}
2745 ], [ user_path=`cat conftest.stdpath` ],
2746 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2747 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2748 )
2749# make sure $bindir is in USER_PATH so scp will work
2750 t_bindir=`eval echo ${bindir}`
2751 case $t_bindir in
2752 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2753 esac
2754 case $t_bindir in
2755 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2756 esac
2757 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2758 if test $? -ne 0 ; then
2759 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2760 if test $? -ne 0 ; then
2761 user_path=$user_path:$t_bindir
2762 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2763 fi
2764 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002765 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002766)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002767if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002768 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2769 AC_SUBST(user_path)
2770fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002771
Damien Millera18bbd32002-05-13 10:48:57 +10002772# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002773AC_ARG_WITH(superuser-path,
2774 [ --with-superuser-path= Specify different path for super-user],
2775 [
2776 if test "x$withval" != "xno" ; then
2777 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2778 superuser_path=$withval
2779 fi
2780 ]
2781)
2782
2783
Damien Miller61e50f12000-05-08 20:49:37 +10002784AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002785IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002786AC_ARG_WITH(4in6,
2787 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2788 [
2789 if test "x$withval" != "xno" ; then
2790 AC_MSG_RESULT(yes)
2791 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002792 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002793 else
2794 AC_MSG_RESULT(no)
2795 fi
2796 ],[
2797 if test "x$inet6_default_4in6" = "xyes"; then
2798 AC_MSG_RESULT([yes (default)])
2799 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002800 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002801 else
2802 AC_MSG_RESULT([no (default)])
2803 fi
2804 ]
2805)
2806
Damien Miller60396b02001-02-18 17:01:00 +11002807# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002808BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002809AC_ARG_WITH(bsd-auth,
2810 [ --with-bsd-auth Enable BSD auth support],
2811 [
2812 if test "x$withval" != "xno" ; then
2813 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002814 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002815 fi
2816 ]
2817)
2818
Damien Millera22ba012000-03-02 23:09:20 +11002819# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002820piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002821# make sure the directory exists
2822if test ! -d $piddir ; then
2823 piddir=`eval echo ${sysconfdir}`
2824 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002825 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002826 esac
2827fi
2828
Tim Rice88f2ab52002-03-17 12:17:34 -08002829AC_ARG_WITH(pid-dir,
2830 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2831 [
2832 if test "x$withval" != "xno" ; then
2833 piddir=$withval
2834 if test ! -d $piddir ; then
2835 AC_MSG_WARN([** no $piddir directory on this system **])
2836 fi
2837 fi
2838 ]
2839)
2840
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002841AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002842AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002843
andre2ff7b5d2000-06-03 14:57:40 +00002844dnl allow user to disable some login recording features
2845AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002846 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002847 [
2848 if test "x$enableval" = "xno" ; then
2849 AC_DEFINE(DISABLE_LASTLOG)
2850 fi
2851 ]
andre2ff7b5d2000-06-03 14:57:40 +00002852)
2853AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002854 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002855 [
2856 if test "x$enableval" = "xno" ; then
2857 AC_DEFINE(DISABLE_UTMP)
2858 fi
2859 ]
andre2ff7b5d2000-06-03 14:57:40 +00002860)
2861AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002862 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002863 [
2864 if test "x$enableval" = "xno" ; then
2865 AC_DEFINE(DISABLE_UTMPX)
2866 fi
2867 ]
andre2ff7b5d2000-06-03 14:57:40 +00002868)
2869AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002870 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002871 [
2872 if test "x$enableval" = "xno" ; then
2873 AC_DEFINE(DISABLE_WTMP)
2874 fi
2875 ]
andre2ff7b5d2000-06-03 14:57:40 +00002876)
2877AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002878 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002879 [
2880 if test "x$enableval" = "xno" ; then
2881 AC_DEFINE(DISABLE_WTMPX)
2882 fi
2883 ]
andre2ff7b5d2000-06-03 14:57:40 +00002884)
2885AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002886 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002887 [
2888 if test "x$enableval" = "xno" ; then
2889 AC_DEFINE(DISABLE_LOGIN)
2890 fi
2891 ]
andre2ff7b5d2000-06-03 14:57:40 +00002892)
2893AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002894 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002895 [
2896 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002897 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002898 fi
2899 ]
andre2ff7b5d2000-06-03 14:57:40 +00002900)
2901AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002902 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002903 [
2904 if test "x$enableval" = "xno" ; then
2905 AC_DEFINE(DISABLE_PUTUTXLINE)
2906 fi
2907 ]
andre2ff7b5d2000-06-03 14:57:40 +00002908)
2909AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002910 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002911 [
2912 if test "x$withval" = "xno" ; then
2913 AC_DEFINE(DISABLE_LASTLOG)
2914 else
2915 conf_lastlog_location=$withval
2916 fi
2917 ]
2918)
andre2ff7b5d2000-06-03 14:57:40 +00002919
2920dnl lastlog, [uw]tmpx? detection
2921dnl NOTE: set the paths in the platform section to avoid the
2922dnl need for command-line parameters
2923dnl lastlog and [uw]tmp are subject to a file search if all else fails
2924
2925dnl lastlog detection
2926dnl NOTE: the code itself will detect if lastlog is a directory
2927AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2928AC_TRY_COMPILE([
2929#include <sys/types.h>
2930#include <utmp.h>
2931#ifdef HAVE_LASTLOG_H
2932# include <lastlog.h>
2933#endif
Damien Miller2994e082000-06-04 15:51:47 +10002934#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002935# include <paths.h>
2936#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002937#ifdef HAVE_LOGIN_H
2938# include <login.h>
2939#endif
andre2ff7b5d2000-06-03 14:57:40 +00002940 ],
2941 [ char *lastlog = LASTLOG_FILE; ],
2942 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002943 [
2944 AC_MSG_RESULT(no)
2945 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2946 AC_TRY_COMPILE([
2947#include <sys/types.h>
2948#include <utmp.h>
2949#ifdef HAVE_LASTLOG_H
2950# include <lastlog.h>
2951#endif
2952#ifdef HAVE_PATHS_H
2953# include <paths.h>
2954#endif
2955 ],
2956 [ char *lastlog = _PATH_LASTLOG; ],
2957 [ AC_MSG_RESULT(yes) ],
2958 [
andree441aa32000-06-12 22:34:38 +00002959 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002960 system_lastlog_path=no
2961 ])
2962 ]
andre2ff7b5d2000-06-03 14:57:40 +00002963)
Damien Miller2994e082000-06-04 15:51:47 +10002964
andre2ff7b5d2000-06-03 14:57:40 +00002965if test -z "$conf_lastlog_location"; then
2966 if test x"$system_lastlog_path" = x"no" ; then
2967 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002968 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002969 conf_lastlog_location=$f
2970 fi
2971 done
2972 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002973 AC_MSG_WARN([** Cannot find lastlog **])
2974 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002975 fi
2976 fi
2977fi
2978
2979if test -n "$conf_lastlog_location"; then
2980 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2981fi
2982
2983dnl utmp detection
2984AC_MSG_CHECKING([if your system defines UTMP_FILE])
2985AC_TRY_COMPILE([
2986#include <sys/types.h>
2987#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002988#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002989# include <paths.h>
2990#endif
2991 ],
2992 [ char *utmp = UTMP_FILE; ],
2993 [ AC_MSG_RESULT(yes) ],
2994 [ AC_MSG_RESULT(no)
2995 system_utmp_path=no ]
2996)
2997if test -z "$conf_utmp_location"; then
2998 if test x"$system_utmp_path" = x"no" ; then
2999 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
3000 if test -f $f ; then
3001 conf_utmp_location=$f
3002 fi
3003 done
3004 if test -z "$conf_utmp_location"; then
3005 AC_DEFINE(DISABLE_UTMP)
3006 fi
3007 fi
3008fi
3009if test -n "$conf_utmp_location"; then
3010 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
3011fi
3012
3013dnl wtmp detection
3014AC_MSG_CHECKING([if your system defines WTMP_FILE])
3015AC_TRY_COMPILE([
3016#include <sys/types.h>
3017#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003018#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003019# include <paths.h>
3020#endif
3021 ],
3022 [ char *wtmp = WTMP_FILE; ],
3023 [ AC_MSG_RESULT(yes) ],
3024 [ AC_MSG_RESULT(no)
3025 system_wtmp_path=no ]
3026)
3027if test -z "$conf_wtmp_location"; then
3028 if test x"$system_wtmp_path" = x"no" ; then
3029 for f in /usr/adm/wtmp /var/log/wtmp; do
3030 if test -f $f ; then
3031 conf_wtmp_location=$f
3032 fi
3033 done
3034 if test -z "$conf_wtmp_location"; then
3035 AC_DEFINE(DISABLE_WTMP)
3036 fi
3037 fi
3038fi
3039if test -n "$conf_wtmp_location"; then
3040 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
3041fi
3042
3043
3044dnl utmpx detection - I don't know any system so perverse as to require
3045dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3046dnl there, though.
3047AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3048AC_TRY_COMPILE([
3049#include <sys/types.h>
3050#include <utmp.h>
3051#ifdef HAVE_UTMPX_H
3052#include <utmpx.h>
3053#endif
Damien Miller2994e082000-06-04 15:51:47 +10003054#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003055# include <paths.h>
3056#endif
3057 ],
3058 [ char *utmpx = UTMPX_FILE; ],
3059 [ AC_MSG_RESULT(yes) ],
3060 [ AC_MSG_RESULT(no)
3061 system_utmpx_path=no ]
3062)
3063if test -z "$conf_utmpx_location"; then
3064 if test x"$system_utmpx_path" = x"no" ; then
3065 AC_DEFINE(DISABLE_UTMPX)
3066 fi
3067else
3068 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
3069fi
3070
3071dnl wtmpx detection
3072AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3073AC_TRY_COMPILE([
3074#include <sys/types.h>
3075#include <utmp.h>
3076#ifdef HAVE_UTMPX_H
3077#include <utmpx.h>
3078#endif
Damien Miller2994e082000-06-04 15:51:47 +10003079#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003080# include <paths.h>
3081#endif
3082 ],
3083 [ char *wtmpx = WTMPX_FILE; ],
3084 [ AC_MSG_RESULT(yes) ],
3085 [ AC_MSG_RESULT(no)
3086 system_wtmpx_path=no ]
3087)
3088if test -z "$conf_wtmpx_location"; then
3089 if test x"$system_wtmpx_path" = x"no" ; then
3090 AC_DEFINE(DISABLE_WTMPX)
3091 fi
3092else
3093 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
3094fi
3095
Damien Miller4018c192000-04-30 09:30:44 +10003096
Damien Miller29ea30d2000-03-17 10:54:15 +11003097if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003098 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3099 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003100fi
3101
Tim Rice4cec93f2002-02-26 08:40:48 -08003102dnl remove pam and dl because they are in $LIBPAM
3103if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003104 LIBS=`echo $LIBS | sed 's/-lpam //'`
3105fi
3106if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3107 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003108fi
3109
Damien Millerbac2d8a2000-09-05 16:13:06 +11003110AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003111AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3112 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003113AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003114
Damien Miller7b22d652000-06-18 14:07:04 +10003115# Print summary of options
3116
Damien Miller7b22d652000-06-18 14:07:04 +10003117# Someone please show me a better way :)
3118A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3119B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3120C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3121D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003122E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003123F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003124G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003125H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3126I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3127J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003128
3129echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003130echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003131echo " User binaries: $B"
3132echo " System binaries: $C"
3133echo " Configuration files: $D"
3134echo " Askpass program: $E"
3135echo " Manual pages: $F"
3136echo " PID file: $G"
3137echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003138if test "x$external_path_file" = "x/etc/login.conf" ; then
3139echo " At runtime, sshd will use the path defined in $external_path_file"
3140echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003141else
Damien Millerf58c6722002-05-13 13:15:42 +10003142echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003143 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003144echo " (If PATH is set in $external_path_file it will be used instead. If"
3145echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3146 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003147fi
Damien Millera18bbd32002-05-13 10:48:57 +10003148if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003149echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003150fi
Damien Millerf58c6722002-05-13 13:15:42 +10003151echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003152echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003153echo " KerberosV support: $KRB5_MSG"
3154echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003155echo " S/KEY support: $SKEY_MSG"
3156echo " TCP Wrappers support: $TCPW_MSG"
3157echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003158echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003159echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003160echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3161echo " BSD Auth support: $BSD_AUTH_MSG"
3162echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003163if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003164echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003165fi
3166
Damien Miller7b22d652000-06-18 14:07:04 +10003167echo ""
3168
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003169echo " Host: ${host}"
3170echo " Compiler: ${CC}"
3171echo " Compiler flags: ${CFLAGS}"
3172echo "Preprocessor flags: ${CPPFLAGS}"
3173echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003174echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003175
3176echo ""
3177
Tim Rice6f1f7582004-05-30 21:38:51 -07003178if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003179 echo "SVR4 style packages are supported with \"make package\""
3180 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003181fi
3182
Damien Miller82cf0ce2000-12-20 13:34:48 +11003183if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003184 echo "PAM is enabled. You may need to install a PAM control file "
3185 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003186 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003187 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003188 echo ""
3189fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003190
Damien Miller6c21c512002-01-22 21:57:53 +11003191if test ! -z "$RAND_HELPER_CMDHASH" ; then
3192 echo "WARNING: you are using the builtin random number collection "
3193 echo "service. Please read WARNING.RNG and request that your OS "
3194 echo "vendor includes kernel-based random number collection in "
3195 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003196 echo ""
3197fi
Damien Miller60396b02001-02-18 17:01:00 +11003198
Damien Millerb4097182004-05-23 14:09:40 +10003199if test ! -z "$NO_PEERCHECK" ; then
3200 echo "WARNING: the operating system that you are using does not "
3201 echo "appear to support either the getpeereid() API nor the "
3202 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3203 echo "enforce security checks to prevent unauthorised connections to "
3204 echo "ssh-agent. Their absence increases the risk that a malicious "
3205 echo "user can connect to your agent. "
3206 echo ""
3207fi
3208
Darren Tuckerd9f88912005-02-20 21:01:48 +11003209if test "$AUDIT_MODULE" = "bsm" ; then
3210 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
3211 echo "See the Solaris section in README.platform for details."
3212fi