blob: ca41ecc7703ab904c43a38d0546772be90c8cf9a [file] [log] [blame]
Tim Rice8bb561b2005-03-17 16:23:19 -08001# $Id: configure.ac,v 1.252 2005/03/18 00:23:19 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"
Tim Rice8bb561b2005-03-17 16:23:19 -0800797 if test -n "${withval}" && \
798 test "${withval}" != "yes"; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700799 if test -d "${withval}/lib"; then
800 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700801 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700802 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700803 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700804 fi
805 else
806 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700807 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700808 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700809 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700810 fi
811 fi
812 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700813 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700814 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700815 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700816 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700817 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800818 LIBWRAP="-lwrap"
819 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100820 AC_MSG_CHECKING(for libwrap)
821 AC_TRY_LINK(
822 [
Damien Miller0ac45002004-04-14 20:14:26 +1000823#include <sys/types.h>
824#include <sys/socket.h>
825#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +1100826#include <tcpd.h>
827 int deny_severity = 0, allow_severity = 0;
828 ],
829 [hosts_access(0);],
830 [
831 AC_MSG_RESULT(yes)
832 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800833 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700834 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100835 ],
836 [
837 AC_MSG_ERROR([*** libwrap missing])
838 ]
839 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800840 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100841 fi
842 ]
843)
844
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100845# Check whether user wants libedit support
846LIBEDIT_MSG="no"
847AC_ARG_WITH(libedit,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100848 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100849 [ if test "x$withval" != "xno" ; then
850 AC_CHECK_LIB(edit, el_init,
851 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
852 LIBEDIT="-ledit -lcurses"
853 LIBEDIT_MSG="yes"
854 AC_SUBST(LIBEDIT)
855 ],
856 [], [-lcurses]
857 )
858 fi ]
859)
860
Darren Tuckerd9f88912005-02-20 21:01:48 +1100861AUDIT_MODULE=none
862AC_ARG_WITH(audit,
863 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)],
864 [
865 AC_MSG_CHECKING(for supported audit module)
866 case "$withval" in
867 bsm)
868 AC_MSG_RESULT(bsm)
869 AUDIT_MODULE=bsm
870 dnl Checks for headers, libs and functions
871 AC_CHECK_HEADERS(bsm/audit.h, [],
872 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)])
873 AC_CHECK_LIB(bsm, getaudit, [],
874 [AC_MSG_ERROR(BSM enabled and required library not found)])
875 AC_CHECK_FUNCS(getaudit, [],
876 [AC_MSG_ERROR(BSM enabled and required function not found)])
877 # These are optional
Darren Tucker0d096692005-03-07 17:34:45 +1100878 AC_CHECK_FUNCS(getaudit_addr)
Darren Tuckerd9f88912005-02-20 21:01:48 +1100879 AC_DEFINE(USE_BSM_AUDIT, [], [Use BSM audit module])
880 ;;
881 debug)
882 AUDIT_MODULE=debug
883 AC_MSG_RESULT(debug)
884 AC_DEFINE(SSH_AUDIT_EVENTS, [], Use audit debugging module)
885 ;;
886 *)
887 AC_MSG_ERROR([Unknown audit module $withval])
888 ;;
889 esac ]
890)
891
Damien Millerfe1f1432003-02-24 15:45:42 +1100892dnl Checks for library functions. Please keep in alphabetical order
893AC_CHECK_FUNCS(\
Darren Tucker60bd4092004-06-25 14:03:34 +1000894 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
Darren Tuckerad7646a2005-02-02 10:43:59 +1100895 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
896 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
897 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100898 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000899 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100900 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000901 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100902 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000903 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000904 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100905 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100906)
Tim Rice13aae5e2001-10-21 17:53:58 -0700907
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000908# IRIX has a const char return value for gai_strerror()
909AC_CHECK_FUNCS(gai_strerror,[
910 AC_DEFINE(HAVE_GAI_STRERROR)
911 AC_TRY_COMPILE([
912#include <sys/types.h>
913#include <sys/socket.h>
914#include <netdb.h>
915
916const char *gai_strerror(int);],[
917char *str;
918
919str = gai_strerror(0);],[
920 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
921 [Define if gai_strerror() returns const char *])])])
922
Damien Millercd6853c2003-01-28 11:33:42 +1100923AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
924
Darren Tuckerf1159b52003-07-07 19:44:01 +1000925dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000926AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000927AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000928
Darren Tuckerb2427c82003-09-10 15:22:44 +1000929dnl tcsendbreak might be a macro
930AC_CHECK_DECL(tcsendbreak,
931 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100932 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000933 [#include <termios.h>]
934)
935
Darren Tucker5bb14002004-04-23 18:53:10 +1000936AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
937
Darren Tucker2a6b0292003-12-31 14:59:17 +1100938AC_CHECK_FUNCS(setresuid, [
939 dnl Some platorms have setresuid that isn't implemented, test for this
940 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000941 AC_RUN_IFELSE(
942 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100943#include <stdlib.h>
944#include <errno.h>
945int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000946 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100947 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100948 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000949 AC_MSG_RESULT(not implemented)],
950 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100951 )
952])
Darren Tuckere937be32003-12-17 18:53:26 +1100953
Darren Tucker2a6b0292003-12-31 14:59:17 +1100954AC_CHECK_FUNCS(setresgid, [
955 dnl Some platorms have setresgid that isn't implemented, test for this
956 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000957 AC_RUN_IFELSE(
958 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100959#include <stdlib.h>
960#include <errno.h>
961int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000962 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100963 [AC_MSG_RESULT(yes)],
964 [AC_DEFINE(BROKEN_SETRESGID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000965 AC_MSG_RESULT(not implemented)],
966 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100967 )
968])
Darren Tuckere937be32003-12-17 18:53:26 +1100969
Damien Millerad833b32000-08-23 10:46:23 +1000970dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000971AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000972dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000973AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000974AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000975dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000976AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000977AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100978
Damien Millera8e06ce2003-11-21 23:48:55 +1100979AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100980 [AC_DEFINE(HAVE_DAEMON)],
981 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
982)
983
Damien Millera8e06ce2003-11-21 23:48:55 +1100984AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100985 [AC_DEFINE(HAVE_GETPAGESIZE)],
986 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
987)
988
Damien Millercb170cb2000-07-01 16:52:55 +1000989# Check for broken snprintf
990if test "x$ac_cv_func_snprintf" = "xyes" ; then
991 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000992 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000993 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +1000994#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700995int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +1000996 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100997 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000998 [
999 AC_MSG_RESULT(no)
1000 AC_DEFINE(BROKEN_SNPRINTF)
1001 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001002 ],
1003 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +10001004 )
1005fi
1006
Damien Millerb4097182004-05-23 14:09:40 +10001007# Check for missing getpeereid (or equiv) support
1008NO_PEERCHECK=""
1009if test "x$ac_cv_func_getpeereid" != "xyes" ; then
1010 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1011 AC_TRY_COMPILE(
1012 [#include <sys/types.h>
1013 #include <sys/socket.h>],
1014 [int i = SO_PEERCRED;],
1015 [AC_MSG_RESULT(yes)],
1016 [AC_MSG_RESULT(no)
1017 NO_PEERCHECK=1]
1018 )
1019fi
1020
Damien Millere8328192003-01-07 15:18:32 +11001021dnl see whether mkstemp() requires XXXXXX
1022if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1023AC_MSG_CHECKING([for (overly) strict mkstemp])
1024AC_TRY_RUN(
1025 [
1026#include <stdlib.h>
1027main() { char template[]="conftest.mkstemp-test";
1028if (mkstemp(template) == -1)
1029 exit(1);
1030unlink(template); exit(0);
1031}
1032 ],
1033 [
1034 AC_MSG_RESULT(no)
1035 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001036 [
Damien Millere8328192003-01-07 15:18:32 +11001037 AC_MSG_RESULT(yes)
1038 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1039 ],
1040 [
1041 AC_MSG_RESULT(yes)
1042 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001043 ]
Damien Millere8328192003-01-07 15:18:32 +11001044)
1045fi
1046
Darren Tucker70a3d552003-08-21 17:58:29 +10001047dnl make sure that openpty does not reacquire controlling terminal
1048if test ! -z "$check_for_openpty_ctty_bug"; then
1049 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1050 AC_TRY_RUN(
1051 [
1052#include <stdio.h>
1053#include <sys/fcntl.h>
1054#include <sys/types.h>
1055#include <sys/wait.h>
1056
1057int
1058main()
1059{
1060 pid_t pid;
1061 int fd, ptyfd, ttyfd, status;
1062
1063 pid = fork();
1064 if (pid < 0) { /* failed */
1065 exit(1);
1066 } else if (pid > 0) { /* parent */
1067 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001068 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001069 exit(WEXITSTATUS(status));
1070 else
1071 exit(2);
1072 } else { /* child */
1073 close(0); close(1); close(2);
1074 setsid();
1075 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1076 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1077 if (fd >= 0)
1078 exit(3); /* Acquired ctty: broken */
1079 else
1080 exit(0); /* Did not acquire ctty: OK */
1081 }
1082}
1083 ],
1084 [
1085 AC_MSG_RESULT(yes)
1086 ],
1087 [
1088 AC_MSG_RESULT(no)
1089 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1090 ]
1091 )
1092fi
1093
Tim Rice8bb561b2005-03-17 16:23:19 -08001094if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1095 test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
Darren Tucker4398cf52004-04-06 21:39:02 +10001096 AC_MSG_CHECKING(if getaddrinfo seems to work)
1097 AC_TRY_RUN(
1098 [
1099#include <stdio.h>
1100#include <sys/socket.h>
1101#include <netdb.h>
1102#include <errno.h>
1103#include <netinet/in.h>
1104
1105#define TEST_PORT "2222"
1106
1107int
1108main(void)
1109{
1110 int err, sock;
1111 struct addrinfo *gai_ai, *ai, hints;
1112 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1113
1114 memset(&hints, 0, sizeof(hints));
1115 hints.ai_family = PF_UNSPEC;
1116 hints.ai_socktype = SOCK_STREAM;
1117 hints.ai_flags = AI_PASSIVE;
1118
1119 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1120 if (err != 0) {
1121 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1122 exit(1);
1123 }
1124
1125 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1126 if (ai->ai_family != AF_INET6)
1127 continue;
1128
1129 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1130 sizeof(ntop), strport, sizeof(strport),
1131 NI_NUMERICHOST|NI_NUMERICSERV);
1132
1133 if (err != 0) {
1134 if (err == EAI_SYSTEM)
1135 perror("getnameinfo EAI_SYSTEM");
1136 else
1137 fprintf(stderr, "getnameinfo failed: %s\n",
1138 gai_strerror(err));
1139 exit(2);
1140 }
1141
1142 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1143 if (sock < 0)
1144 perror("socket");
1145 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1146 if (errno == EBADF)
1147 exit(3);
1148 }
1149 }
1150 exit(0);
1151}
1152 ],
1153 [
1154 AC_MSG_RESULT(yes)
1155 ],
1156 [
1157 AC_MSG_RESULT(no)
1158 AC_DEFINE(BROKEN_GETADDRINFO)
1159 ]
1160 )
1161fi
1162
Tim Rice8bb561b2005-03-17 16:23:19 -08001163if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1164 test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
Darren Tucker691d5232005-02-15 21:45:57 +11001165 AC_MSG_CHECKING(if getaddrinfo seems to work)
1166 AC_TRY_RUN(
1167 [
1168#include <stdio.h>
1169#include <sys/socket.h>
1170#include <netdb.h>
1171#include <errno.h>
1172#include <netinet/in.h>
1173
1174#define TEST_PORT "2222"
1175
1176int
1177main(void)
1178{
1179 int err, sock;
1180 struct addrinfo *gai_ai, *ai, hints;
1181 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1182
1183 memset(&hints, 0, sizeof(hints));
1184 hints.ai_family = PF_UNSPEC;
1185 hints.ai_socktype = SOCK_STREAM;
1186 hints.ai_flags = AI_PASSIVE;
1187
1188 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1189 if (err != 0) {
1190 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1191 exit(1);
1192 }
1193
1194 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1195 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1196 continue;
1197
1198 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1199 sizeof(ntop), strport, sizeof(strport),
1200 NI_NUMERICHOST|NI_NUMERICSERV);
1201
1202 if (ai->ai_family == AF_INET && err != 0) {
1203 perror("getnameinfo");
1204 exit(2);
1205 }
1206 }
1207 exit(0);
1208}
1209 ],
1210 [
1211 AC_MSG_RESULT(yes)
1212 AC_DEFINE(AIX_GETNAMEINFO_HACK, [],
1213[Define if you have a getaddrinfo that fails for the all-zeros IPv6 address])
1214 ],
1215 [
1216 AC_MSG_RESULT(no)
1217 AC_DEFINE(BROKEN_GETADDRINFO)
1218 ]
1219 )
1220fi
1221
Darren Tuckera56f1912004-11-02 20:30:54 +11001222if test "x$check_for_conflicting_getspnam" = "x1"; then
1223 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1224 AC_COMPILE_IFELSE(
1225 [
1226#include <shadow.h>
1227int main(void) {exit(0);}
1228 ],
1229 [
1230 AC_MSG_RESULT(no)
1231 ],
1232 [
1233 AC_MSG_RESULT(yes)
1234 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1235 [Conflicting defs for getspnam])
1236 ]
1237 )
1238fi
1239
Damien Miller606f8802000-09-16 15:39:56 +11001240AC_FUNC_GETPGRP
1241
Damien Millera64b57a2001-01-17 10:44:13 +11001242# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001243PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001244AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001245 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001246 [
Damien Millera64b57a2001-01-17 10:44:13 +11001247 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001248 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1249 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001250 AC_MSG_ERROR([PAM headers not found])
1251 fi
1252
1253 AC_CHECK_LIB(dl, dlopen, , )
1254 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1255 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001256 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001257
Damien Millera64b57a2001-01-17 10:44:13 +11001258 PAM_MSG="yes"
1259
1260 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001261 if test $ac_cv_lib_dl_dlopen = yes; then
1262 LIBPAM="-lpam -ldl"
1263 else
1264 LIBPAM="-lpam"
1265 fi
1266 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001267 fi
1268 ]
1269)
Damien Millera22ba012000-03-02 23:09:20 +11001270
Damien Millera64b57a2001-01-17 10:44:13 +11001271# Check for older PAM
1272if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001273 # Check PAM strerror arguments (old PAM)
1274 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1275 AC_TRY_COMPILE(
1276 [
Damien Miller81171112000-04-23 11:14:01 +10001277#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001278#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001279#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001280#elif defined (HAVE_PAM_PAM_APPL_H)
1281#include <pam/pam_appl.h>
1282#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001283 ],
1284 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001285 [AC_MSG_RESULT(no)],
1286 [
1287 AC_DEFINE(HAVE_OLD_PAM)
1288 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001289 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001290 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001291 )
Damien Millera22ba012000-03-02 23:09:20 +11001292fi
1293
Tim Riceaef73712002-05-11 13:17:42 -07001294# Search for OpenSSL
1295saved_CPPFLAGS="$CPPFLAGS"
1296saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001297AC_ARG_WITH(ssl-dir,
1298 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1299 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001300 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001301 case "$withval" in
1302 # Relative paths
1303 ./*|../*) withval="`pwd`/$withval"
1304 esac
Tim Riceaef73712002-05-11 13:17:42 -07001305 if test -d "$withval/lib"; then
1306 if test -n "${need_dash_r}"; then
1307 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1308 else
1309 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1310 fi
1311 else
1312 if test -n "${need_dash_r}"; then
1313 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1314 else
1315 LDFLAGS="-L${withval} ${LDFLAGS}"
1316 fi
1317 fi
1318 if test -d "$withval/include"; then
1319 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1320 else
1321 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1322 fi
Damien Millera22ba012000-03-02 23:09:20 +11001323 fi
1324 ]
1325)
Tim Rice3d5352e2004-02-12 09:27:21 -08001326LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001327AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001328 [
Tim Riceaef73712002-05-11 13:17:42 -07001329 dnl Check default openssl install dir
1330 if test -n "${need_dash_r}"; then
1331 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001332 else
Tim Riceaef73712002-05-11 13:17:42 -07001333 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001334 fi
Tim Riceaef73712002-05-11 13:17:42 -07001335 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1336 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1337 [
1338 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1339 ]
1340 )
1341 ]
1342)
1343
Tim Riced730b782002-08-13 18:52:10 -07001344# Determine OpenSSL header version
1345AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001346AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001347 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001348#include <stdio.h>
1349#include <string.h>
1350#include <openssl/opensslv.h>
1351#define DATA "conftest.sslincver"
1352int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001353 FILE *fd;
1354 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001355
Damien Millera8e06ce2003-11-21 23:48:55 +11001356 fd = fopen(DATA,"w");
1357 if(fd == NULL)
1358 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001359
1360 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1361 exit(1);
1362
1363 exit(0);
1364}
Darren Tucker623d92f2004-09-12 22:36:15 +10001365 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001366 [
1367 ssl_header_ver=`cat conftest.sslincver`
1368 AC_MSG_RESULT($ssl_header_ver)
1369 ],
1370 [
1371 AC_MSG_RESULT(not found)
1372 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001373 ],
1374 [
1375 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001376 ]
1377)
1378
1379# Determine OpenSSL library version
1380AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001381AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001382 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001383#include <stdio.h>
1384#include <string.h>
1385#include <openssl/opensslv.h>
1386#include <openssl/crypto.h>
1387#define DATA "conftest.ssllibver"
1388int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001389 FILE *fd;
1390 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001391
Damien Millera8e06ce2003-11-21 23:48:55 +11001392 fd = fopen(DATA,"w");
1393 if(fd == NULL)
1394 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001395
1396 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1397 exit(1);
1398
1399 exit(0);
1400}
Darren Tucker623d92f2004-09-12 22:36:15 +10001401 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001402 [
1403 ssl_library_ver=`cat conftest.ssllibver`
1404 AC_MSG_RESULT($ssl_library_ver)
1405 ],
1406 [
1407 AC_MSG_RESULT(not found)
1408 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001409 ],
1410 [
1411 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001412 ]
1413)
Damien Millera22ba012000-03-02 23:09:20 +11001414
Damien Millerec932372002-01-22 22:16:03 +11001415# Sanity check OpenSSL headers
1416AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001417AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001418 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001419#include <string.h>
1420#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001421int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001422 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001423 [
1424 AC_MSG_RESULT(yes)
1425 ],
1426 [
1427 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001428 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1429Check config.log for details.
1430Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001431 ],
1432 [
1433 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001434 ]
1435)
1436
Tim Rice3d5352e2004-02-12 09:27:21 -08001437# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1438# because the system crypt() is more featureful.
1439if test "x$check_for_libcrypt_before" = "x1"; then
1440 AC_CHECK_LIB(crypt, crypt)
1441fi
1442
Damien Millera8e06ce2003-11-21 23:48:55 +11001443# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001444# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001445if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001446 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001447fi
1448
Damien Miller6c21c512002-01-22 21:57:53 +11001449
1450### Configure cryptographic random number support
1451
1452# Check wheter OpenSSL seeds itself
1453AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001454AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001455 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001456#include <string.h>
1457#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001458int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001459 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001460 [
1461 OPENSSL_SEEDS_ITSELF=yes
1462 AC_MSG_RESULT(yes)
1463 ],
1464 [
1465 AC_MSG_RESULT(no)
1466 # Default to use of the rand helper if OpenSSL doesn't
1467 # seed itself
1468 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001469 ],
1470 [
1471 AC_MSG_WARN([cross compiling: assuming yes])
1472 # This is safe, since all recent OpenSSL versions will
1473 # complain at runtime if not seeded correctly.
1474 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001475 ]
1476)
1477
1478
1479# Do we want to force the use of the rand helper?
1480AC_ARG_WITH(rand-helper,
1481 [ --with-rand-helper Use subprocess to gather strong randomness ],
1482 [
1483 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001484 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001485 # the previous test showed it to be unseeded.
1486 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1487 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1488 OPENSSL_SEEDS_ITSELF=yes
1489 USE_RAND_HELPER=""
1490 fi
1491 else
1492 USE_RAND_HELPER=yes
1493 fi
1494 ],
1495)
1496
1497# Which randomness source do we use?
Tim Rice8bb561b2005-03-17 16:23:19 -08001498if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001499 # OpenSSL only
1500 AC_DEFINE(OPENSSL_PRNG_ONLY)
1501 RAND_MSG="OpenSSL internal ONLY"
1502 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001503elif test ! -z "$USE_RAND_HELPER" ; then
1504 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001505 RAND_MSG="ssh-rand-helper"
1506 INSTALL_SSH_RAND_HELPER="yes"
1507fi
1508AC_SUBST(INSTALL_SSH_RAND_HELPER)
1509
1510### Configuration of ssh-rand-helper
1511
1512# PRNGD TCP socket
1513AC_ARG_WITH(prngd-port,
1514 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1515 [
Damien Millere996d722002-01-23 11:20:59 +11001516 case "$withval" in
1517 no)
1518 withval=""
1519 ;;
1520 [[0-9]]*)
1521 ;;
1522 *)
1523 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1524 ;;
1525 esac
1526 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001527 PRNGD_PORT="$withval"
1528 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1529 fi
1530 ]
1531)
1532
1533# PRNGD Unix domain socket
1534AC_ARG_WITH(prngd-socket,
1535 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1536 [
Damien Millere996d722002-01-23 11:20:59 +11001537 case "$withval" in
1538 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001539 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001540 ;;
1541 no)
1542 withval=""
1543 ;;
1544 /*)
1545 ;;
1546 *)
1547 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1548 ;;
1549 esac
1550
1551 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001552 if test ! -z "$PRNGD_PORT" ; then
1553 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1554 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001555 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001556 AC_MSG_WARN(Entropy socket is not readable)
1557 fi
1558 PRNGD_SOCKET="$withval"
1559 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1560 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001561 ],
1562 [
1563 # Check for existing socket only if we don't have a random device already
1564 if test "$USE_RAND_HELPER" = yes ; then
1565 AC_MSG_CHECKING(for PRNGD/EGD socket)
1566 # Insert other locations here
1567 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1568 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1569 PRNGD_SOCKET="$sock"
1570 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1571 break;
1572 fi
1573 done
1574 if test ! -z "$PRNGD_SOCKET" ; then
1575 AC_MSG_RESULT($PRNGD_SOCKET)
1576 else
1577 AC_MSG_RESULT(not found)
1578 fi
1579 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001580 ]
1581)
1582
1583# Change default command timeout for hashing entropy source
1584entropy_timeout=200
1585AC_ARG_WITH(entropy-timeout,
1586 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1587 [
1588 if test "x$withval" != "xno" ; then
1589 entropy_timeout=$withval
1590 fi
1591 ]
1592)
Damien Miller6c21c512002-01-22 21:57:53 +11001593AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1594
Damien Millerd3f6ad22002-06-25 10:24:47 +10001595SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001596AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001597 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001598 [
1599 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001600 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001601 fi
1602 ]
1603)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001604AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1605AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001606
Tim Rice88f2ab52002-03-17 12:17:34 -08001607# We do this little dance with the search path to insure
1608# that programs that we select for use by installed programs
1609# (which may be run by the super-user) come from trusted
1610# locations before they come from the user's private area.
1611# This should help avoid accidentally configuring some
1612# random version of a program in someone's personal bin.
1613
1614OPATH=$PATH
1615PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001616test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001617test -d /sbin && PATH=$PATH:/sbin
1618test -d /usr/sbin && PATH=$PATH:/usr/sbin
1619PATH=$PATH:/etc:$OPATH
1620
Damien Millera8e06ce2003-11-21 23:48:55 +11001621# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001622OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1623OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1624OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1625OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1626OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1627OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1628OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1629OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1630OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1631OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1632OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1633OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1634OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1635OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1636OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1637OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001638# restore PATH
1639PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001640
1641# Where does ssh-rand-helper get its randomness from?
1642INSTALL_SSH_PRNG_CMDS=""
1643if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1644 if test ! -z "$PRNGD_PORT" ; then
1645 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1646 elif test ! -z "$PRNGD_SOCKET" ; then
1647 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1648 else
1649 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1650 RAND_HELPER_CMDHASH=yes
1651 INSTALL_SSH_PRNG_CMDS="yes"
1652 fi
1653fi
1654AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1655
1656
Ben Lindstromb5628642000-10-18 00:02:25 +00001657# Cheap hack to ensure NEWS-OS libraries are arranged right.
1658if test ! -z "$SONY" ; then
1659 LIBS="$LIBS -liberty";
1660fi
1661
Damien Millera22ba012000-03-02 23:09:20 +11001662# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001663AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001664AC_CHECK_SIZEOF(short int, 2)
1665AC_CHECK_SIZEOF(int, 4)
1666AC_CHECK_SIZEOF(long int, 4)
1667AC_CHECK_SIZEOF(long long int, 8)
1668
Damien Millerfa2bb692002-04-23 23:22:25 +10001669# Sanity check long long for some platforms (AIX)
1670if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1671 ac_cv_sizeof_long_long_int=0
1672fi
1673
Damien Millera22ba012000-03-02 23:09:20 +11001674# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001675AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1676 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001677 [ #include <sys/types.h> ],
1678 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001679 [ ac_cv_have_u_int="yes" ],
1680 [ ac_cv_have_u_int="no" ]
1681 )
1682])
1683if test "x$ac_cv_have_u_int" = "xyes" ; then
1684 AC_DEFINE(HAVE_U_INT)
1685 have_u_int=1
1686fi
1687
Damien Miller61e50f12000-05-08 20:49:37 +10001688AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1689 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001690 [ #include <sys/types.h> ],
1691 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001692 [ ac_cv_have_intxx_t="yes" ],
1693 [ ac_cv_have_intxx_t="no" ]
1694 )
1695])
1696if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1697 AC_DEFINE(HAVE_INTXX_T)
1698 have_intxx_t=1
1699fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001700
1701if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001702 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001703then
1704 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1705 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001706 [ #include <stdint.h> ],
1707 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001708 [
1709 AC_DEFINE(HAVE_INTXX_T)
1710 AC_MSG_RESULT(yes)
1711 ],
1712 [ AC_MSG_RESULT(no) ]
1713 )
1714fi
1715
Damien Miller578783e2000-09-23 14:12:24 +11001716AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1717 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001718 [
1719#include <sys/types.h>
1720#ifdef HAVE_STDINT_H
1721# include <stdint.h>
1722#endif
1723#include <sys/socket.h>
1724#ifdef HAVE_SYS_BITYPES_H
1725# include <sys/bitypes.h>
1726#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001727 ],
1728 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001729 [ ac_cv_have_int64_t="yes" ],
1730 [ ac_cv_have_int64_t="no" ]
1731 )
1732])
1733if test "x$ac_cv_have_int64_t" = "xyes" ; then
1734 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001735fi
1736
Damien Miller61e50f12000-05-08 20:49:37 +10001737AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1738 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001739 [ #include <sys/types.h> ],
1740 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001741 [ ac_cv_have_u_intxx_t="yes" ],
1742 [ ac_cv_have_u_intxx_t="no" ]
1743 )
1744])
1745if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1746 AC_DEFINE(HAVE_U_INTXX_T)
1747 have_u_intxx_t=1
1748fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001749
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001750if test -z "$have_u_intxx_t" ; then
1751 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1752 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001753 [ #include <sys/socket.h> ],
1754 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001755 [
1756 AC_DEFINE(HAVE_U_INTXX_T)
1757 AC_MSG_RESULT(yes)
1758 ],
1759 [ AC_MSG_RESULT(no) ]
1760 )
1761fi
1762
Damien Miller578783e2000-09-23 14:12:24 +11001763AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1764 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001765 [ #include <sys/types.h> ],
1766 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001767 [ ac_cv_have_u_int64_t="yes" ],
1768 [ ac_cv_have_u_int64_t="no" ]
1769 )
1770])
1771if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1772 AC_DEFINE(HAVE_U_INT64_T)
1773 have_u_int64_t=1
1774fi
1775
Tim Rice4cec93f2002-02-26 08:40:48 -08001776if test -z "$have_u_int64_t" ; then
1777 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1778 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001779 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001780 [ u_int64_t a; a = 1],
1781 [
1782 AC_DEFINE(HAVE_U_INT64_T)
1783 AC_MSG_RESULT(yes)
1784 ],
1785 [ AC_MSG_RESULT(no) ]
1786 )
1787fi
1788
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001789if test -z "$have_u_intxx_t" ; then
1790 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1791 AC_TRY_COMPILE(
1792 [
1793#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001794 ],
1795 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001796 [ ac_cv_have_uintxx_t="yes" ],
1797 [ ac_cv_have_uintxx_t="no" ]
1798 )
1799 ])
1800 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1801 AC_DEFINE(HAVE_UINTXX_T)
1802 fi
1803fi
1804
1805if test -z "$have_uintxx_t" ; then
1806 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1807 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001808 [ #include <stdint.h> ],
1809 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001810 [
1811 AC_DEFINE(HAVE_UINTXX_T)
1812 AC_MSG_RESULT(yes)
1813 ],
1814 [ AC_MSG_RESULT(no) ]
1815 )
1816fi
1817
Damien Milleredb82922000-06-20 13:25:52 +10001818if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001819 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001820then
1821 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1822 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001823 [
1824#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001825 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001826 [
Damien Miller70494d12000-04-03 15:57:06 +10001827 int8_t a; int16_t b; int32_t c;
1828 u_int8_t e; u_int16_t f; u_int32_t g;
1829 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001830 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001831 [
1832 AC_DEFINE(HAVE_U_INTXX_T)
1833 AC_DEFINE(HAVE_INTXX_T)
1834 AC_MSG_RESULT(yes)
1835 ],
1836 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001837 )
Damien Millerb29ea912000-01-15 14:12:03 +11001838fi
1839
Damien Miller58be7382001-09-15 21:31:54 +10001840
1841AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1842 AC_TRY_COMPILE(
1843 [
1844#include <sys/types.h>
1845 ],
1846 [ u_char foo; foo = 125; ],
1847 [ ac_cv_have_u_char="yes" ],
1848 [ ac_cv_have_u_char="no" ]
1849 )
1850])
1851if test "x$ac_cv_have_u_char" = "xyes" ; then
1852 AC_DEFINE(HAVE_U_CHAR)
1853fi
1854
Tim Rice13aae5e2001-10-21 17:53:58 -07001855TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001856
Tim Rice200a5c02002-02-26 22:12:34 -08001857AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001858
Damien Miller848b9932005-02-24 12:12:34 +11001859AC_CHECK_TYPES(in_addr_t,,,
1860[#include <sys/types.h>
1861#include <netinet/in.h>])
Darren Tuckerd9f88912005-02-20 21:01:48 +11001862
Damien Miller61e50f12000-05-08 20:49:37 +10001863AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1864 AC_TRY_COMPILE(
1865 [
1866#include <sys/types.h>
1867 ],
1868 [ size_t foo; foo = 1235; ],
1869 [ ac_cv_have_size_t="yes" ],
1870 [ ac_cv_have_size_t="no" ]
1871 )
1872])
1873if test "x$ac_cv_have_size_t" = "xyes" ; then
1874 AC_DEFINE(HAVE_SIZE_T)
1875fi
Damien Miller95058511999-12-29 10:36:45 +11001876
Damien Miller615f9392000-05-17 22:53:33 +10001877AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1878 AC_TRY_COMPILE(
1879 [
1880#include <sys/types.h>
1881 ],
1882 [ ssize_t foo; foo = 1235; ],
1883 [ ac_cv_have_ssize_t="yes" ],
1884 [ ac_cv_have_ssize_t="no" ]
1885 )
1886])
1887if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1888 AC_DEFINE(HAVE_SSIZE_T)
1889fi
1890
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001891AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1892 AC_TRY_COMPILE(
1893 [
1894#include <time.h>
1895 ],
1896 [ clock_t foo; foo = 1235; ],
1897 [ ac_cv_have_clock_t="yes" ],
1898 [ ac_cv_have_clock_t="no" ]
1899 )
1900])
1901if test "x$ac_cv_have_clock_t" = "xyes" ; then
1902 AC_DEFINE(HAVE_CLOCK_T)
1903fi
1904
Damien Millerb54b40e2000-06-23 08:23:34 +10001905AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1906 AC_TRY_COMPILE(
1907 [
1908#include <sys/types.h>
1909#include <sys/socket.h>
1910 ],
1911 [ sa_family_t foo; foo = 1235; ],
1912 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001913 [ AC_TRY_COMPILE(
1914 [
1915#include <sys/types.h>
1916#include <sys/socket.h>
1917#include <netinet/in.h>
1918 ],
1919 [ sa_family_t foo; foo = 1235; ],
1920 [ ac_cv_have_sa_family_t="yes" ],
1921
Damien Millerb54b40e2000-06-23 08:23:34 +10001922 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001923 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001924 )
1925])
1926if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1927 AC_DEFINE(HAVE_SA_FAMILY_T)
1928fi
1929
Damien Miller0f91b4e2000-06-18 15:43:25 +10001930AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1931 AC_TRY_COMPILE(
1932 [
1933#include <sys/types.h>
1934 ],
1935 [ pid_t foo; foo = 1235; ],
1936 [ ac_cv_have_pid_t="yes" ],
1937 [ ac_cv_have_pid_t="no" ]
1938 )
1939])
1940if test "x$ac_cv_have_pid_t" = "xyes" ; then
1941 AC_DEFINE(HAVE_PID_T)
1942fi
1943
1944AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1945 AC_TRY_COMPILE(
1946 [
1947#include <sys/types.h>
1948 ],
1949 [ mode_t foo; foo = 1235; ],
1950 [ ac_cv_have_mode_t="yes" ],
1951 [ ac_cv_have_mode_t="no" ]
1952 )
1953])
1954if test "x$ac_cv_have_mode_t" = "xyes" ; then
1955 AC_DEFINE(HAVE_MODE_T)
1956fi
1957
Damien Miller61e50f12000-05-08 20:49:37 +10001958
1959AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1960 AC_TRY_COMPILE(
1961 [
Damien Miller81171112000-04-23 11:14:01 +10001962#include <sys/types.h>
1963#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001964 ],
1965 [ struct sockaddr_storage s; ],
1966 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1967 [ ac_cv_have_struct_sockaddr_storage="no" ]
1968 )
1969])
1970if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1971 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1972fi
Damien Miller34132e52000-01-14 15:45:46 +11001973
Damien Miller61e50f12000-05-08 20:49:37 +10001974AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1975 AC_TRY_COMPILE(
1976 [
Damien Miller7b22d652000-06-18 14:07:04 +10001977#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001978#include <netinet/in.h>
1979 ],
1980 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1981 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1982 [ ac_cv_have_struct_sockaddr_in6="no" ]
1983 )
1984])
1985if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1986 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1987fi
Damien Miller34132e52000-01-14 15:45:46 +11001988
Damien Miller61e50f12000-05-08 20:49:37 +10001989AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1990 AC_TRY_COMPILE(
1991 [
Damien Miller7b22d652000-06-18 14:07:04 +10001992#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001993#include <netinet/in.h>
1994 ],
1995 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1996 [ ac_cv_have_struct_in6_addr="yes" ],
1997 [ ac_cv_have_struct_in6_addr="no" ]
1998 )
1999])
2000if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
2001 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
2002fi
Damien Miller34132e52000-01-14 15:45:46 +11002003
Damien Miller61e50f12000-05-08 20:49:37 +10002004AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2005 AC_TRY_COMPILE(
2006 [
Damien Miller81171112000-04-23 11:14:01 +10002007#include <sys/types.h>
2008#include <sys/socket.h>
2009#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002010 ],
2011 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
2012 [ ac_cv_have_struct_addrinfo="yes" ],
2013 [ ac_cv_have_struct_addrinfo="no" ]
2014 )
2015])
2016if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
2017 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
2018fi
2019
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002020AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2021 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002022 [ #include <sys/time.h> ],
2023 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002024 [ ac_cv_have_struct_timeval="yes" ],
2025 [ ac_cv_have_struct_timeval="no" ]
2026 )
2027])
2028if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
2029 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
2030 have_struct_timeval=1
2031fi
2032
Tim Rice4e4dc562003-03-18 10:21:40 -08002033AC_CHECK_TYPES(struct timespec)
2034
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002035# We need int64_t or else certian parts of the compile will fail.
Tim Rice8bb561b2005-03-17 16:23:19 -08002036if test "x$ac_cv_have_int64_t" = "xno" && \
2037 test "x$ac_cv_sizeof_long_int" != "x8" && \
2038 test "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002039 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2040 echo "an alternative compiler (I.E., GCC) before continuing."
2041 echo ""
2042 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08002043else
2044dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10002045 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10002046 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08002047#include <stdio.h>
2048#include <string.h>
2049#ifdef HAVE_SNPRINTF
2050main()
2051{
2052 char buf[50];
2053 char expected_out[50];
2054 int mazsize = 50 ;
2055#if (SIZEOF_LONG_INT == 8)
2056 long int num = 0x7fffffffffffffff;
2057#else
Kevin Steves6482ec82001-07-15 02:09:28 +00002058 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08002059#endif
2060 strcpy(expected_out, "9223372036854775807");
2061 snprintf(buf, mazsize, "%lld", num);
2062 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11002063 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08002064 exit(0);
2065}
2066#else
2067main() { exit(0); }
2068#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10002069 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10002070 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08002071 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002072fi
2073
Damien Miller78315eb2000-09-29 23:01:36 +11002074dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10002075OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2076OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2077OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2078OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2079OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002080OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002081OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2082OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002083OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002084OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2085OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2086OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2087OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002088OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2089OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2090OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2091OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002092
2093AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00002094
Damien Miller61e50f12000-05-08 20:49:37 +10002095AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2096 ac_cv_have_ss_family_in_struct_ss, [
2097 AC_TRY_COMPILE(
2098 [
Damien Miller81171112000-04-23 11:14:01 +10002099#include <sys/types.h>
2100#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002101 ],
2102 [ struct sockaddr_storage s; s.ss_family = 1; ],
2103 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2104 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2105 )
2106])
2107if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2108 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
2109fi
2110
Damien Miller61e50f12000-05-08 20:49:37 +10002111AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2112 ac_cv_have___ss_family_in_struct_ss, [
2113 AC_TRY_COMPILE(
2114 [
Damien Miller81171112000-04-23 11:14:01 +10002115#include <sys/types.h>
2116#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002117 ],
2118 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2119 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2120 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2121 )
2122])
2123if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2124 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
2125fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002126
Damien Millerad833b32000-08-23 10:46:23 +10002127AC_CACHE_CHECK([for pw_class field in struct passwd],
2128 ac_cv_have_pw_class_in_struct_passwd, [
2129 AC_TRY_COMPILE(
2130 [
Damien Millerad833b32000-08-23 10:46:23 +10002131#include <pwd.h>
2132 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002133 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002134 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2135 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2136 )
2137])
2138if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2139 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
2140fi
2141
Kevin Steves82456952001-06-22 21:14:18 +00002142AC_CACHE_CHECK([for pw_expire field in struct passwd],
2143 ac_cv_have_pw_expire_in_struct_passwd, [
2144 AC_TRY_COMPILE(
2145 [
2146#include <pwd.h>
2147 ],
2148 [ struct passwd p; p.pw_expire = 0; ],
2149 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2150 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2151 )
2152])
2153if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2154 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
2155fi
2156
2157AC_CACHE_CHECK([for pw_change field in struct passwd],
2158 ac_cv_have_pw_change_in_struct_passwd, [
2159 AC_TRY_COMPILE(
2160 [
2161#include <pwd.h>
2162 ],
2163 [ struct passwd p; p.pw_change = 0; ],
2164 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2165 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2166 )
2167])
2168if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2169 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
2170fi
Damien Miller61e50f12000-05-08 20:49:37 +10002171
Tim Rice28bbb0c2002-05-27 17:37:32 -07002172dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002173AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2174 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002175 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002176 [
Tim Riceae49fe62002-04-12 10:26:21 -07002177#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002178#include <sys/socket.h>
2179#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002180int main() {
2181#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002182#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002183exit(1);
2184#endif
2185struct msghdr m;
2186m.msg_accrights = 0;
2187exit(0);
2188}
Kevin Steves939c9db2002-03-22 17:23:25 +00002189 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002190 [ ac_cv_have_accrights_in_msghdr="yes" ],
2191 [ ac_cv_have_accrights_in_msghdr="no" ]
2192 )
2193])
2194if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2195 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2196fi
2197
Kevin Stevesa44e0352002-04-07 16:18:03 +00002198AC_CACHE_CHECK([for msg_control field in struct msghdr],
2199 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002200 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002201 [
Tim Riceae49fe62002-04-12 10:26:21 -07002202#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002203#include <sys/socket.h>
2204#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002205int main() {
2206#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002207#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002208exit(1);
2209#endif
2210struct msghdr m;
2211m.msg_control = 0;
2212exit(0);
2213}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002214 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002215 [ ac_cv_have_control_in_msghdr="yes" ],
2216 [ ac_cv_have_control_in_msghdr="no" ]
2217 )
2218])
2219if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2220 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2221fi
2222
Damien Miller61e50f12000-05-08 20:49:37 +10002223AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002224 AC_TRY_LINK([],
2225 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002226 [ ac_cv_libc_defines___progname="yes" ],
2227 [ ac_cv_libc_defines___progname="no" ]
2228 )
2229])
2230if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2231 AC_DEFINE(HAVE___PROGNAME)
2232fi
2233
Kevin Steves4846f4a2002-03-22 18:19:53 +00002234AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2235 AC_TRY_LINK([
2236#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002237],
2238 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002239 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2240 [ ac_cv_cc_implements___FUNCTION__="no" ]
2241 )
2242])
2243if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2244 AC_DEFINE(HAVE___FUNCTION__)
2245fi
2246
2247AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2248 AC_TRY_LINK([
2249#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002250],
2251 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002252 [ ac_cv_cc_implements___func__="yes" ],
2253 [ ac_cv_cc_implements___func__="no" ]
2254 )
2255])
2256if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2257 AC_DEFINE(HAVE___func__)
2258fi
2259
Damien Miller4f8e6692001-07-14 13:22:53 +10002260AC_CACHE_CHECK([whether getopt has optreset support],
2261 ac_cv_have_getopt_optreset, [
2262 AC_TRY_LINK(
2263 [
2264#include <getopt.h>
2265 ],
2266 [ extern int optreset; optreset = 0; ],
2267 [ ac_cv_have_getopt_optreset="yes" ],
2268 [ ac_cv_have_getopt_optreset="no" ]
2269 )
2270])
2271if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2272 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2273fi
Damien Millera22ba012000-03-02 23:09:20 +11002274
Damien Millerecbb26d2000-07-15 14:59:14 +10002275AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002276 AC_TRY_LINK([],
2277 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002278 [ ac_cv_libc_defines_sys_errlist="yes" ],
2279 [ ac_cv_libc_defines_sys_errlist="no" ]
2280 )
2281])
2282if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2283 AC_DEFINE(HAVE_SYS_ERRLIST)
2284fi
2285
2286
Damien Miller11fa2cc2000-08-16 10:35:58 +10002287AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002288 AC_TRY_LINK([],
2289 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002290 [ ac_cv_libc_defines_sys_nerr="yes" ],
2291 [ ac_cv_libc_defines_sys_nerr="no" ]
2292 )
2293])
2294if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2295 AC_DEFINE(HAVE_SYS_NERR)
2296fi
2297
Damien Millera8e06ce2003-11-21 23:48:55 +11002298SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002299# Check whether user wants sectok support
2300AC_ARG_WITH(sectok,
2301 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002302 [
2303 if test "x$withval" != "xno" ; then
2304 if test "x$withval" != "xyes" ; then
2305 CPPFLAGS="$CPPFLAGS -I${withval}"
2306 LDFLAGS="$LDFLAGS -L${withval}"
2307 if test ! -z "$need_dash_r" ; then
2308 LDFLAGS="$LDFLAGS -R${withval}"
2309 fi
2310 if test ! -z "$blibpath" ; then
2311 blibpath="$blibpath:${withval}"
2312 fi
2313 fi
2314 AC_CHECK_HEADERS(sectok.h)
2315 if test "$ac_cv_header_sectok_h" != yes; then
2316 AC_MSG_ERROR(Can't find sectok.h)
2317 fi
2318 AC_CHECK_LIB(sectok, sectok_open)
2319 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2320 AC_MSG_ERROR(Can't find libsectok)
2321 fi
2322 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002323 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002324 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002325 fi
2326 ]
2327)
2328
2329# Check whether user wants OpenSC support
Tim Rice12ee8e22005-03-17 13:37:04 -08002330OPENSC_CONFIG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002331AC_ARG_WITH(opensc,
Tim Rice12ee8e22005-03-17 13:37:04 -08002332 [--with-opensc[[=PFX]] Enable smartcard support using OpenSC (optionally in PATH)],
2333 [
2334 if test "x$withval" != "xno" ; then
2335 if test "x$withval" != "xyes" ; then
2336 OPENSC_CONFIG=$withval/bin/opensc-config
2337 else
2338 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2339 fi
2340 if test "$OPENSC_CONFIG" != "no"; then
2341 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2342 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2343 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2344 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2345 AC_DEFINE(SMARTCARD)
2346 AC_DEFINE(USE_OPENSC)
2347 SCARD_MSG="yes, using OpenSC"
2348 fi
2349 fi
2350 ]
2351)
Damien Miller85de5802001-09-18 14:01:11 +10002352
Darren Tucker5f88d342003-10-15 16:57:57 +10002353# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002354AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002355 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002356 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002357 # Needed by our getrrsetbyname()
2358 AC_SEARCH_LIBS(res_query, resolv)
2359 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002360 AC_MSG_CHECKING(if res_query will link)
2361 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2362 [AC_MSG_RESULT(no)
2363 saved_LIBS="$LIBS"
2364 LIBS="$LIBS -lresolv"
2365 AC_MSG_CHECKING(for res_query in -lresolv)
2366 AC_LINK_IFELSE([
2367#include <resolv.h>
2368int main()
2369{
2370 res_query (0, 0, 0, 0, 0);
2371 return 0;
2372}
2373 ],
2374 [LIBS="$LIBS -lresolv"
2375 AC_MSG_RESULT(yes)],
2376 [LIBS="$saved_LIBS"
2377 AC_MSG_RESULT(no)])
2378 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002379 AC_CHECK_FUNCS(_getshort _getlong)
2380 AC_CHECK_MEMBER(HEADER.ad,
2381 [AC_DEFINE(HAVE_HEADER_AD)],,
2382 [#include <arpa/nameser.h>])
2383 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002384
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002385# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002386KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002387AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002388 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002389 [ if test "x$withval" != "xno" ; then
2390 if test "x$withval" = "xyes" ; then
2391 KRB5ROOT="/usr/local"
2392 else
2393 KRB5ROOT=${withval}
2394 fi
2395
2396 AC_DEFINE(KRB5)
2397 KRB5_MSG="yes"
2398
2399 AC_MSG_CHECKING(for krb5-config)
2400 if test -x $KRB5ROOT/bin/krb5-config ; then
2401 KRB5CONF=$KRB5ROOT/bin/krb5-config
2402 AC_MSG_RESULT($KRB5CONF)
2403
2404 AC_MSG_CHECKING(for gssapi support)
2405 if $KRB5CONF | grep gssapi >/dev/null ; then
2406 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002407 AC_DEFINE(GSSAPI)
2408 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002409 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002410 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002411 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002412 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002413 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2414 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002415 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002416 AC_MSG_CHECKING(whether we are using Heimdal)
2417 AC_TRY_COMPILE([ #include <krb5.h> ],
2418 [ char *tmp = heimdal_version; ],
2419 [ AC_MSG_RESULT(yes)
2420 AC_DEFINE(HEIMDAL) ],
2421 AC_MSG_RESULT(no)
2422 )
2423 else
2424 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002425 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002426 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002427 AC_MSG_CHECKING(whether we are using Heimdal)
2428 AC_TRY_COMPILE([ #include <krb5.h> ],
2429 [ char *tmp = heimdal_version; ],
2430 [ AC_MSG_RESULT(yes)
2431 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10002432 K5LIBS="-lkrb5 -ldes"
2433 K5LIBS="$K5LIBS -lcom_err -lasn1"
2434 AC_CHECK_LIB(roken, net_write,
2435 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11002436 ],
2437 [ AC_MSG_RESULT(no)
2438 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2439 ]
2440 )
Damien Miller200d0a72003-06-30 19:21:36 +10002441 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002442
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002443 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2444 [ AC_DEFINE(GSSAPI)
2445 K5LIBS="-lgssapi $K5LIBS" ],
2446 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2447 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002448 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002449 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2450 $K5LIBS)
2451 ],
2452 $K5LIBS)
2453
2454 AC_CHECK_HEADER(gssapi.h, ,
2455 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002456 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002457 AC_CHECK_HEADERS(gssapi.h, ,
2458 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002459 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002460 ]
2461 )
2462
2463 oldCPP="$CPPFLAGS"
2464 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2465 AC_CHECK_HEADER(gssapi_krb5.h, ,
2466 [ CPPFLAGS="$oldCPP" ])
2467
Damien Millera8e06ce2003-11-21 23:48:55 +11002468 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002469 if test ! -z "$need_dash_r" ; then
2470 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2471 fi
2472 if test ! -z "$blibpath" ; then
2473 blibpath="$blibpath:${KRB5ROOT}/lib"
2474 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002475 fi
2476
2477 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2478 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2479 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2480
2481 LIBS="$LIBS $K5LIBS"
2482 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
Ben Lindstroma8104b52004-04-07 04:16:11 +00002483 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
Darren Tucker0d27ed12004-02-24 10:37:33 +11002484 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002485)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002486
Damien Millera22ba012000-03-02 23:09:20 +11002487# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002488
Damien Millerf58c6722002-05-13 13:15:42 +10002489PRIVSEP_PATH=/var/empty
2490AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002491 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002492 [
2493 if test "x$withval" != "$no" ; then
2494 PRIVSEP_PATH=$withval
2495 fi
2496 ]
2497)
2498AC_SUBST(PRIVSEP_PATH)
2499
Damien Millera22ba012000-03-02 23:09:20 +11002500AC_ARG_WITH(xauth,
2501 [ --with-xauth=PATH Specify path to xauth program ],
2502 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002503 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002504 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002505 fi
2506 ],
2507 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002508 TestPath="$PATH"
2509 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2510 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2511 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2512 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2513 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002514 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002515 xauth_path="/usr/openwin/bin/xauth"
2516 fi
2517 ]
2518)
2519
Damien Miller7d901272003-01-13 16:55:22 +11002520STRIP_OPT=-s
2521AC_ARG_ENABLE(strip,
2522 [ --disable-strip Disable calling strip(1) on install],
2523 [
2524 if test "x$enableval" = "xno" ; then
2525 STRIP_OPT=
2526 fi
2527 ]
2528)
2529AC_SUBST(STRIP_OPT)
2530
Damien Millera19cf472000-11-29 13:28:50 +11002531if test -z "$xauth_path" ; then
2532 XAUTH_PATH="undefined"
2533 AC_SUBST(XAUTH_PATH)
2534else
Damien Millera22ba012000-03-02 23:09:20 +11002535 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002536 XAUTH_PATH=$xauth_path
2537 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002538fi
Damien Millera22ba012000-03-02 23:09:20 +11002539
2540# Check for mail directory (last resort if we cannot get it from headers)
2541if test ! -z "$MAIL" ; then
2542 maildir=`dirname $MAIL`
2543 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2544fi
2545
Darren Tucker623d92f2004-09-12 22:36:15 +10002546if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002547 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2548 disable_ptmx_check=yes
2549fi
Damien Millera22ba012000-03-02 23:09:20 +11002550if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002551 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002552 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002553 [
2554 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2555 have_dev_ptmx=1
2556 ]
2557 )
2558 fi
Damien Millera22ba012000-03-02 23:09:20 +11002559fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10002560
Darren Tucker623d92f2004-09-12 22:36:15 +10002561if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002562 AC_CHECK_FILE("/dev/ptc",
2563 [
2564 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2565 have_dev_ptc=1
2566 ]
2567 )
2568else
2569 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2570fi
Damien Miller204ad072000-03-02 23:56:12 +11002571
Damien Millera22ba012000-03-02 23:09:20 +11002572# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002573AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002574 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002575 [
Damien Miller897741e2001-04-16 10:41:46 +10002576 case "$withval" in
2577 man|cat|doc)
2578 MANTYPE=$withval
2579 ;;
2580 *)
2581 AC_MSG_ERROR(invalid man type: $withval)
2582 ;;
2583 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002584 ]
2585)
Ben Lindstrombc709922001-04-18 18:04:21 +00002586if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002587 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2588 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002589 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2590 MANTYPE=doc
2591 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2592 MANTYPE=man
2593 else
2594 MANTYPE=cat
2595 fi
2596fi
Damien Miller670a4b82000-01-22 13:53:11 +11002597AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002598if test "$MANTYPE" = "doc"; then
2599 mansubdir=man;
2600else
2601 mansubdir=$MANTYPE;
2602fi
2603AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002604
Damien Millera22ba012000-03-02 23:09:20 +11002605# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002606MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002607AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002608 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002609 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002610 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002611 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002612 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002613 fi
2614 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002615)
2616
Damien Millera22ba012000-03-02 23:09:20 +11002617# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002618AC_ARG_WITH(shadow,
2619 [ --without-shadow Disable shadow password support],
2620 [
2621 if test "x$withval" = "xno" ; then
2622 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002623 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002624 fi
2625 ]
2626)
2627
Damien Miller1f335fb2000-06-26 11:31:33 +10002628if test -z "$disable_shadow" ; then
2629 AC_MSG_CHECKING([if the systems has expire shadow information])
2630 AC_TRY_COMPILE(
2631 [
2632#include <sys/types.h>
2633#include <shadow.h>
2634 struct spwd sp;
2635 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2636 [ sp_expire_available=yes ], []
2637 )
2638
2639 if test "x$sp_expire_available" = "xyes" ; then
2640 AC_MSG_RESULT(yes)
2641 AC_DEFINE(HAS_SHADOW_EXPIRE)
2642 else
2643 AC_MSG_RESULT(no)
2644 fi
2645fi
2646
Damien Millera22ba012000-03-02 23:09:20 +11002647# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002648if test ! -z "$IPADDR_IN_DISPLAY" ; then
2649 DISPLAY_HACK_MSG="yes"
2650 AC_DEFINE(IPADDR_IN_DISPLAY)
2651else
Damien Millera8e06ce2003-11-21 23:48:55 +11002652 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002653 AC_ARG_WITH(ipaddr-display,
2654 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2655 [
2656 if test "x$withval" != "xno" ; then
2657 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002658 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002659 fi
2660 ]
2661 )
2662fi
Damien Miller76112de1999-12-21 11:18:08 +11002663
Darren Tuckere1a790d2003-09-16 11:52:19 +10002664# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002665AC_ARG_ENABLE(etc-default-login,
Darren Tucker1b6f2292005-02-11 16:11:49 +11002666 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
Darren Tucker2f9573d2005-02-10 22:28:54 +11002667 [ if test "x$enableval" = "xno"; then
2668 AC_MSG_NOTICE([/etc/default/login handling disabled])
2669 etc_default_login=no
2670 else
2671 etc_default_login=yes
2672 fi ],
2673 [ etc_default_login=yes ]
2674)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002675
Darren Tucker2f9573d2005-02-10 22:28:54 +11002676if test "x$etc_default_login" != "xno"; then
2677 AC_CHECK_FILE("/etc/default/login",
2678 [ external_path_file=/etc/default/login ])
Darren Tucker623d92f2004-09-12 22:36:15 +10002679 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2680 then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002681 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2682 elif test "x$external_path_file" = "x/etc/default/login"; then
2683 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2684 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11002685fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002686
Tim Rice43a1c132002-04-17 21:19:14 -07002687dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
Tim Rice8bb561b2005-03-17 16:23:19 -08002688if test $ac_cv_func_login_getcapbool = "yes" && \
2689 test $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002690 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002691fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002692
Damien Millera22ba012000-03-02 23:09:20 +11002693# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002694SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002695AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002696 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002697 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002698 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002699 AC_MSG_WARN([
2700--with-default-path=PATH has no effect on this system.
2701Edit /etc/login.conf instead.])
2702 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002703 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002704 AC_MSG_WARN([
2705--with-default-path=PATH will only be used if PATH is not defined in
2706$external_path_file .])
2707 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002708 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002709 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002710 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002711 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002712 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2713 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002714 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002715 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002716 AC_MSG_WARN([
2717If PATH is defined in $external_path_file, ensure the path to scp is included,
2718otherwise scp will not work.])
2719 fi
2720 AC_TRY_RUN(
2721 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002722/* find out what STDPATH is */
2723#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002724#ifdef HAVE_PATHS_H
2725# include <paths.h>
2726#endif
2727#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002728# ifdef _PATH_USERPATH /* Irix */
2729# define _PATH_STDPATH _PATH_USERPATH
2730# else
2731# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2732# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002733#endif
2734#include <sys/types.h>
2735#include <sys/stat.h>
2736#include <fcntl.h>
2737#define DATA "conftest.stdpath"
2738
2739main()
2740{
2741 FILE *fd;
2742 int rc;
2743
2744 fd = fopen(DATA,"w");
2745 if(fd == NULL)
2746 exit(1);
2747
2748 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2749 exit(1);
2750
2751 exit(0);
2752}
2753 ], [ user_path=`cat conftest.stdpath` ],
2754 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2755 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2756 )
2757# make sure $bindir is in USER_PATH so scp will work
2758 t_bindir=`eval echo ${bindir}`
2759 case $t_bindir in
2760 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2761 esac
2762 case $t_bindir in
2763 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2764 esac
2765 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2766 if test $? -ne 0 ; then
2767 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2768 if test $? -ne 0 ; then
2769 user_path=$user_path:$t_bindir
2770 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2771 fi
2772 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002773 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002774)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002775if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002776 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2777 AC_SUBST(user_path)
2778fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002779
Damien Millera18bbd32002-05-13 10:48:57 +10002780# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002781AC_ARG_WITH(superuser-path,
2782 [ --with-superuser-path= Specify different path for super-user],
2783 [
2784 if test "x$withval" != "xno" ; then
2785 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2786 superuser_path=$withval
2787 fi
2788 ]
2789)
2790
2791
Damien Miller61e50f12000-05-08 20:49:37 +10002792AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002793IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002794AC_ARG_WITH(4in6,
2795 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2796 [
2797 if test "x$withval" != "xno" ; then
2798 AC_MSG_RESULT(yes)
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)
2803 fi
2804 ],[
2805 if test "x$inet6_default_4in6" = "xyes"; then
2806 AC_MSG_RESULT([yes (default)])
2807 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002808 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002809 else
2810 AC_MSG_RESULT([no (default)])
2811 fi
2812 ]
2813)
2814
Damien Miller60396b02001-02-18 17:01:00 +11002815# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002816BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002817AC_ARG_WITH(bsd-auth,
2818 [ --with-bsd-auth Enable BSD auth support],
2819 [
2820 if test "x$withval" != "xno" ; then
2821 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002822 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002823 fi
2824 ]
2825)
2826
Damien Millera22ba012000-03-02 23:09:20 +11002827# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002828piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002829# make sure the directory exists
2830if test ! -d $piddir ; then
2831 piddir=`eval echo ${sysconfdir}`
2832 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002833 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002834 esac
2835fi
2836
Tim Rice88f2ab52002-03-17 12:17:34 -08002837AC_ARG_WITH(pid-dir,
2838 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2839 [
2840 if test "x$withval" != "xno" ; then
2841 piddir=$withval
2842 if test ! -d $piddir ; then
2843 AC_MSG_WARN([** no $piddir directory on this system **])
2844 fi
2845 fi
2846 ]
2847)
2848
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002849AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002850AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002851
andre2ff7b5d2000-06-03 14:57:40 +00002852dnl allow user to disable some login recording features
2853AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002854 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002855 [
2856 if test "x$enableval" = "xno" ; then
2857 AC_DEFINE(DISABLE_LASTLOG)
2858 fi
2859 ]
andre2ff7b5d2000-06-03 14:57:40 +00002860)
2861AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002862 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002863 [
2864 if test "x$enableval" = "xno" ; then
2865 AC_DEFINE(DISABLE_UTMP)
2866 fi
2867 ]
andre2ff7b5d2000-06-03 14:57:40 +00002868)
2869AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002870 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002871 [
2872 if test "x$enableval" = "xno" ; then
2873 AC_DEFINE(DISABLE_UTMPX)
2874 fi
2875 ]
andre2ff7b5d2000-06-03 14:57:40 +00002876)
2877AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002878 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002879 [
2880 if test "x$enableval" = "xno" ; then
2881 AC_DEFINE(DISABLE_WTMP)
2882 fi
2883 ]
andre2ff7b5d2000-06-03 14:57:40 +00002884)
2885AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002886 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002887 [
2888 if test "x$enableval" = "xno" ; then
2889 AC_DEFINE(DISABLE_WTMPX)
2890 fi
2891 ]
andre2ff7b5d2000-06-03 14:57:40 +00002892)
2893AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002894 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002895 [
2896 if test "x$enableval" = "xno" ; then
2897 AC_DEFINE(DISABLE_LOGIN)
2898 fi
2899 ]
andre2ff7b5d2000-06-03 14:57:40 +00002900)
2901AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002902 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002903 [
2904 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002905 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002906 fi
2907 ]
andre2ff7b5d2000-06-03 14:57:40 +00002908)
2909AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002910 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002911 [
2912 if test "x$enableval" = "xno" ; then
2913 AC_DEFINE(DISABLE_PUTUTXLINE)
2914 fi
2915 ]
andre2ff7b5d2000-06-03 14:57:40 +00002916)
2917AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002918 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002919 [
2920 if test "x$withval" = "xno" ; then
2921 AC_DEFINE(DISABLE_LASTLOG)
2922 else
2923 conf_lastlog_location=$withval
2924 fi
2925 ]
2926)
andre2ff7b5d2000-06-03 14:57:40 +00002927
2928dnl lastlog, [uw]tmpx? detection
2929dnl NOTE: set the paths in the platform section to avoid the
2930dnl need for command-line parameters
2931dnl lastlog and [uw]tmp are subject to a file search if all else fails
2932
2933dnl lastlog detection
2934dnl NOTE: the code itself will detect if lastlog is a directory
2935AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2936AC_TRY_COMPILE([
2937#include <sys/types.h>
2938#include <utmp.h>
2939#ifdef HAVE_LASTLOG_H
2940# include <lastlog.h>
2941#endif
Damien Miller2994e082000-06-04 15:51:47 +10002942#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002943# include <paths.h>
2944#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002945#ifdef HAVE_LOGIN_H
2946# include <login.h>
2947#endif
andre2ff7b5d2000-06-03 14:57:40 +00002948 ],
2949 [ char *lastlog = LASTLOG_FILE; ],
2950 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002951 [
2952 AC_MSG_RESULT(no)
2953 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2954 AC_TRY_COMPILE([
2955#include <sys/types.h>
2956#include <utmp.h>
2957#ifdef HAVE_LASTLOG_H
2958# include <lastlog.h>
2959#endif
2960#ifdef HAVE_PATHS_H
2961# include <paths.h>
2962#endif
2963 ],
2964 [ char *lastlog = _PATH_LASTLOG; ],
2965 [ AC_MSG_RESULT(yes) ],
2966 [
andree441aa32000-06-12 22:34:38 +00002967 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002968 system_lastlog_path=no
2969 ])
2970 ]
andre2ff7b5d2000-06-03 14:57:40 +00002971)
Damien Miller2994e082000-06-04 15:51:47 +10002972
andre2ff7b5d2000-06-03 14:57:40 +00002973if test -z "$conf_lastlog_location"; then
2974 if test x"$system_lastlog_path" = x"no" ; then
2975 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002976 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002977 conf_lastlog_location=$f
2978 fi
2979 done
2980 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002981 AC_MSG_WARN([** Cannot find lastlog **])
2982 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002983 fi
2984 fi
2985fi
2986
2987if test -n "$conf_lastlog_location"; then
2988 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2989fi
2990
2991dnl utmp detection
2992AC_MSG_CHECKING([if your system defines UTMP_FILE])
2993AC_TRY_COMPILE([
2994#include <sys/types.h>
2995#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002996#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002997# include <paths.h>
2998#endif
2999 ],
3000 [ char *utmp = UTMP_FILE; ],
3001 [ AC_MSG_RESULT(yes) ],
3002 [ AC_MSG_RESULT(no)
3003 system_utmp_path=no ]
3004)
3005if test -z "$conf_utmp_location"; then
3006 if test x"$system_utmp_path" = x"no" ; then
3007 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
3008 if test -f $f ; then
3009 conf_utmp_location=$f
3010 fi
3011 done
3012 if test -z "$conf_utmp_location"; then
3013 AC_DEFINE(DISABLE_UTMP)
3014 fi
3015 fi
3016fi
3017if test -n "$conf_utmp_location"; then
3018 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
3019fi
3020
3021dnl wtmp detection
3022AC_MSG_CHECKING([if your system defines WTMP_FILE])
3023AC_TRY_COMPILE([
3024#include <sys/types.h>
3025#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003026#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003027# include <paths.h>
3028#endif
3029 ],
3030 [ char *wtmp = WTMP_FILE; ],
3031 [ AC_MSG_RESULT(yes) ],
3032 [ AC_MSG_RESULT(no)
3033 system_wtmp_path=no ]
3034)
3035if test -z "$conf_wtmp_location"; then
3036 if test x"$system_wtmp_path" = x"no" ; then
3037 for f in /usr/adm/wtmp /var/log/wtmp; do
3038 if test -f $f ; then
3039 conf_wtmp_location=$f
3040 fi
3041 done
3042 if test -z "$conf_wtmp_location"; then
3043 AC_DEFINE(DISABLE_WTMP)
3044 fi
3045 fi
3046fi
3047if test -n "$conf_wtmp_location"; then
3048 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
3049fi
3050
3051
3052dnl utmpx detection - I don't know any system so perverse as to require
3053dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3054dnl there, though.
3055AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3056AC_TRY_COMPILE([
3057#include <sys/types.h>
3058#include <utmp.h>
3059#ifdef HAVE_UTMPX_H
3060#include <utmpx.h>
3061#endif
Damien Miller2994e082000-06-04 15:51:47 +10003062#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003063# include <paths.h>
3064#endif
3065 ],
3066 [ char *utmpx = UTMPX_FILE; ],
3067 [ AC_MSG_RESULT(yes) ],
3068 [ AC_MSG_RESULT(no)
3069 system_utmpx_path=no ]
3070)
3071if test -z "$conf_utmpx_location"; then
3072 if test x"$system_utmpx_path" = x"no" ; then
3073 AC_DEFINE(DISABLE_UTMPX)
3074 fi
3075else
3076 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
3077fi
3078
3079dnl wtmpx detection
3080AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3081AC_TRY_COMPILE([
3082#include <sys/types.h>
3083#include <utmp.h>
3084#ifdef HAVE_UTMPX_H
3085#include <utmpx.h>
3086#endif
Damien Miller2994e082000-06-04 15:51:47 +10003087#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003088# include <paths.h>
3089#endif
3090 ],
3091 [ char *wtmpx = WTMPX_FILE; ],
3092 [ AC_MSG_RESULT(yes) ],
3093 [ AC_MSG_RESULT(no)
3094 system_wtmpx_path=no ]
3095)
3096if test -z "$conf_wtmpx_location"; then
3097 if test x"$system_wtmpx_path" = x"no" ; then
3098 AC_DEFINE(DISABLE_WTMPX)
3099 fi
3100else
3101 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
3102fi
3103
Damien Miller4018c192000-04-30 09:30:44 +10003104
Damien Miller29ea30d2000-03-17 10:54:15 +11003105if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003106 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3107 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003108fi
3109
Tim Rice4cec93f2002-02-26 08:40:48 -08003110dnl remove pam and dl because they are in $LIBPAM
3111if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003112 LIBS=`echo $LIBS | sed 's/-lpam //'`
3113fi
3114if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3115 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003116fi
3117
Damien Millerbac2d8a2000-09-05 16:13:06 +11003118AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003119AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3120 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003121AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003122
Damien Miller7b22d652000-06-18 14:07:04 +10003123# Print summary of options
3124
Damien Miller7b22d652000-06-18 14:07:04 +10003125# Someone please show me a better way :)
3126A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3127B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3128C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3129D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003130E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003131F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003132G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003133H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3134I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3135J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003136
3137echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003138echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003139echo " User binaries: $B"
3140echo " System binaries: $C"
3141echo " Configuration files: $D"
3142echo " Askpass program: $E"
3143echo " Manual pages: $F"
3144echo " PID file: $G"
3145echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003146if test "x$external_path_file" = "x/etc/login.conf" ; then
3147echo " At runtime, sshd will use the path defined in $external_path_file"
3148echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003149else
Damien Millerf58c6722002-05-13 13:15:42 +10003150echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003151 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003152echo " (If PATH is set in $external_path_file it will be used instead. If"
3153echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3154 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003155fi
Damien Millera18bbd32002-05-13 10:48:57 +10003156if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003157echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003158fi
Damien Millerf58c6722002-05-13 13:15:42 +10003159echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003160echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003161echo " KerberosV support: $KRB5_MSG"
3162echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003163echo " S/KEY support: $SKEY_MSG"
3164echo " TCP Wrappers support: $TCPW_MSG"
3165echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003166echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003167echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003168echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3169echo " BSD Auth support: $BSD_AUTH_MSG"
3170echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003171if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003172echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003173fi
3174
Damien Miller7b22d652000-06-18 14:07:04 +10003175echo ""
3176
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003177echo " Host: ${host}"
3178echo " Compiler: ${CC}"
3179echo " Compiler flags: ${CFLAGS}"
3180echo "Preprocessor flags: ${CPPFLAGS}"
3181echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003182echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003183
3184echo ""
3185
Tim Rice6f1f7582004-05-30 21:38:51 -07003186if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003187 echo "SVR4 style packages are supported with \"make package\""
3188 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003189fi
3190
Damien Miller82cf0ce2000-12-20 13:34:48 +11003191if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003192 echo "PAM is enabled. You may need to install a PAM control file "
3193 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003194 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003195 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003196 echo ""
3197fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003198
Damien Miller6c21c512002-01-22 21:57:53 +11003199if test ! -z "$RAND_HELPER_CMDHASH" ; then
3200 echo "WARNING: you are using the builtin random number collection "
3201 echo "service. Please read WARNING.RNG and request that your OS "
3202 echo "vendor includes kernel-based random number collection in "
3203 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003204 echo ""
3205fi
Damien Miller60396b02001-02-18 17:01:00 +11003206
Damien Millerb4097182004-05-23 14:09:40 +10003207if test ! -z "$NO_PEERCHECK" ; then
3208 echo "WARNING: the operating system that you are using does not "
3209 echo "appear to support either the getpeereid() API nor the "
3210 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3211 echo "enforce security checks to prevent unauthorised connections to "
3212 echo "ssh-agent. Their absence increases the risk that a malicious "
3213 echo "user can connect to your agent. "
3214 echo ""
3215fi
3216
Darren Tuckerd9f88912005-02-20 21:01:48 +11003217if test "$AUDIT_MODULE" = "bsm" ; then
3218 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
3219 echo "See the Solaris section in README.platform for details."
3220fi