blob: fe6b002d425488b9ef5524c83e702a38de5bd5ba [file] [log] [blame]
Darren Tucker3c774c52005-02-16 22:49:31 +11001# $Id: configure.ac,v 1.244 2005/02/16 11:49:31 dtucker Exp $
Damien Miller4fefe242004-03-11 14:20:10 +11002#
3# Copyright (c) 1999-2004 Damien Miller
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Damien Millere9cf3572001-02-09 12:55:35 +110016
Darren Tucker59f79c42004-09-30 21:17:08 +100017AC_INIT(OpenSSH, Portable)
Tim Rice13aae5e2001-10-21 17:53:58 -070018AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +100019
20AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +110021AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +110022AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +110023AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100024
Damien Millera22ba012000-03-02 23:09:20 +110025# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100026AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110027AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100028AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110029AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000030AC_PATH_PROG(AR, ar)
Tim Rice5af9db92004-06-19 19:31:06 -070031AC_PATH_PROG(CAT, cat)
32AC_PATH_PROG(KILL, kill)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070033AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080034AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110035AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100036AC_PATH_PROG(ENT, ent)
37AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110038AC_PATH_PROG(TEST_MINUS_S_SH, bash)
39AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
40AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070041AC_PATH_PROG(SH, sh)
Tim Ricef7ba8f62004-06-20 10:37:32 -070042AC_SUBST(TEST_SHELL,sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110043
Tim Rice6f1f7582004-05-30 21:38:51 -070044dnl for buildpkg.sh
45AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
46 [/usr/sbin${PATH_SEPARATOR}/etc])
47AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd,
48 [/usr/sbin${PATH_SEPARATOR}/etc])
49AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no)
50
Damien Millere8bb4502001-09-25 16:39:35 +100051# System features
52AC_SYS_LARGEFILE
53
Damien Miller3f62aba2000-11-29 11:56:35 +110054if test -z "$AR" ; then
55 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
56fi
57
Damien Millerad833b32000-08-23 10:46:23 +100058# Use LOGIN_PROGRAM from environment if possible
59if test ! -z "$LOGIN_PROGRAM" ; then
60 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
61else
62 # Search for login
63 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
64 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
65 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
66 fi
67fi
68
Darren Tucker23bc8d02004-02-06 16:24:31 +110069AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
70if test ! -z "$PATH_PASSWD_PROG" ; then
71 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
72fi
73
Damien Miller166bd442000-03-16 10:48:25 +110074if test -z "$LD" ; then
75 LD=$CC
76fi
77AC_SUBST(LD)
78
Damien Miller166bd442000-03-16 10:48:25 +110079AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110080if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100081 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110082fi
83
Tim Rice88368a32003-12-08 12:35:59 -080084AC_ARG_WITH(rpath,
85 [ --without-rpath Disable auto-added -R linker paths],
86 [
87 if test "x$withval" = "xno" ; then
88 need_dash_r=""
89 fi
90 if test "x$withval" = "xyes" ; then
91 need_dash_r=1
92 fi
93 ]
94)
95
Damien Millera22ba012000-03-02 23:09:20 +110096# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110097case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110098*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110099 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +1000100 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -0800101 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100102 fi
Damien Millereab4bae2003-04-29 23:22:40 +1000103 saved_LDFLAGS="$LDFLAGS"
104 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
105 if (test -z "$blibflags"); then
106 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
107 AC_TRY_LINK([], [], [blibflags=$tryflags])
108 fi
109 done
110 if (test -z "$blibflags"); then
111 AC_MSG_RESULT(not found)
112 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
113 else
114 AC_MSG_RESULT($blibflags)
115 fi
116 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000117 dnl Check for authenticate. Might be in libs.a on older AIXes
118 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -0700119 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000120 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -0700121 LIBS="$LIBS -ls"
122 ])
123 ])
Darren Tucker3c774c52005-02-16 22:49:31 +1100124 dnl Check for various auth function declarations in headers.
125 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, passwdexpired],,
126 [#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)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000161 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100162 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000163*-*-dgux*)
164 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100165 AC_DEFINE(SETEUID_BREAKS_SETUID)
166 AC_DEFINE(BROKEN_SETREUID)
167 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000168 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000169*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000170 AC_MSG_CHECKING(if we have working getaddrinfo)
171 AC_TRY_RUN([#include <mach-o/dyld.h>
172main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
173 exit(0);
174 else
175 exit(1);
176}], [AC_MSG_RESULT(working)],
177 [AC_MSG_RESULT(buggy)
178 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700179 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000180 AC_DEFINE(SETEUID_BREAKS_SETUID)
181 AC_DEFINE(BROKEN_SETREUID)
182 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100183 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000184 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000185*-*-hpux10.26)
186 if test -z "$GCC"; then
187 CFLAGS="$CFLAGS -Ae"
188 fi
189 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
190 IPADDR_IN_DISPLAY=yes
191 AC_DEFINE(HAVE_SECUREWARE)
192 AC_DEFINE(USE_PIPES)
193 AC_DEFINE(LOGIN_NO_ENDOPT)
194 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000195 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000196 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700197 LIBS="$LIBS -lsec -lsecpw"
198 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000199 disable_ptmx_check=yes
200 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100201*-*-hpux10*)
202 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000203 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100204 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000205 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100206 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000207 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000208 AC_DEFINE(LOGIN_NO_ENDOPT)
209 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000210 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000211 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700212 LIBS="$LIBS -lsec"
213 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100214 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000215*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000216 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100217 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100218 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100219 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000220 AC_DEFINE(LOGIN_NO_ENDOPT)
221 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100222 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000223 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000224 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tucker2fba9932005-02-02 23:30:24 +1100225 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Darren Tucker4398cf52004-04-06 21:39:02 +1000226 check_for_hpux_broken_getaddrinfo=1
Darren Tuckera56f1912004-11-02 20:30:54 +1100227 check_for_conflicting_getspnam=1
Tim Ricef028f1e2002-07-19 12:41:10 -0700228 LIBS="$LIBS -lsec"
229 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000230 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100231*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100232 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000233 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000234 AC_DEFINE(SETEUID_BREAKS_SETUID)
235 AC_DEFINE(BROKEN_SETREUID)
236 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000237 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000238 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100239 ;;
240*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100241 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000242 AC_DEFINE(WITH_IRIX_ARRAY)
243 AC_DEFINE(WITH_IRIX_PROJECT)
244 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000245 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000246 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000247 AC_DEFINE(SETEUID_BREAKS_SETUID)
248 AC_DEFINE(BROKEN_SETREUID)
249 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker8db9a0f2004-04-06 21:31:12 +1000250 AC_DEFINE(BROKEN_UPDWTMPX)
Damien Millerf1b9d112002-04-23 23:09:19 +1000251 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000252 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100253 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100254*-*-linux*)
255 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100256 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000257 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100258 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000259 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker809031f2004-03-30 14:03:45 +1000260 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!")
Damien Miller35276252003-06-03 10:14:28 +1000261 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Darren Tuckere59b5082004-06-28 16:01:19 +1000262 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM)
Darren Tucker2fba9932005-02-02 23:30:24 +1100263 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
264 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Damien Miller7bcb0892000-03-11 20:45:40 +1100265 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000266 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000267 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000268 AC_DEFINE(BROKEN_CMSG_TYPE)
269 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000270 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100271 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000272mips-sony-bsd|mips-sony-newsos4)
273 AC_DEFINE(HAVE_NEWS4)
274 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000275 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100276*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000277 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800278 if test "x$withval" != "xno" ; then
279 need_dash_r=1
280 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100281 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100282*-*-freebsd*)
283 check_for_libcrypt_later=1
284 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000285*-*-bsdi*)
286 AC_DEFINE(SETEUID_BREAKS_SETUID)
287 AC_DEFINE(BROKEN_SETREUID)
288 AC_DEFINE(BROKEN_SETREGID)
289 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000290*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000291 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100292 conf_utmp_location=/etc/utmp
293 conf_wtmp_location=/usr/adm/wtmp
294 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000295 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000296 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000297 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100298 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000299 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100300*-*-solaris*)
Tim Ricead4a1882004-02-29 15:53:37 -0800301 if test "x$withval" != "xno" ; then
302 need_dash_r=1
303 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100304 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000305 AC_DEFINE(LOGIN_NEEDS_UTMPX)
306 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000307 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker21dd0892004-08-16 23:12:05 +1000308 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID)
Darren Tuckere41bba52003-08-25 11:51:19 +1000309 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000310 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
311 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000312 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000313 # hardwire lastlog location (can't detect it on some versions)
314 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000315 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
316 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
317 if test "$sol2ver" -ge 8; then
318 AC_MSG_RESULT(yes)
319 AC_DEFINE(DISABLE_UTMP)
320 AC_DEFINE(DISABLE_WTMP)
321 else
322 AC_MSG_RESULT(no)
323 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100324 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000325*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000326 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000327 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100328 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000329 conf_utmp_location=/etc/utmp
330 conf_wtmp_location=/var/adm/wtmp
331 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000332 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000333 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000334*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700335 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000336 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000337 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000338 AC_DEFINE(SETEUID_BREAKS_SETUID)
339 AC_DEFINE(BROKEN_SETREUID)
340 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000341 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000342*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700343 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000344 AC_CHECK_LIB(dl, dlsym, ,)
Darren Tuckerca6e7a72005-02-16 16:19:17 +1100345 # -lresolv needs to be at then end of LIBS or DNS lookups break
346 AC_CHECK_LIB(res_query, resolv, [ LIBS="$LIBS -lresolv" ])
Damien Millerfd9885e2001-01-10 08:16:53 +1100347 IPADDR_IN_DISPLAY=yes
348 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000349 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000350 AC_DEFINE(SETEUID_BREAKS_SETUID)
351 AC_DEFINE(BROKEN_SETREUID)
352 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000353 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000354 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700355 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
356 # Attention: always take care to bind libsocket and libnsl before libc,
357 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000358 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800359# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
Damien Miller78315eb2000-09-29 23:01:36 +1100360*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100361 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700362 AC_DEFINE(SETEUID_BREAKS_SETUID)
363 AC_DEFINE(BROKEN_SETREUID)
364 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100365 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800366# UnixWare 7.x, OpenUNIX 8
Damien Miller78315eb2000-09-29 23:01:36 +1100367*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100368 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700369 AC_DEFINE(SETEUID_BREAKS_SETUID)
370 AC_DEFINE(BROKEN_SETREUID)
371 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100372 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100373*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100374 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800375# SCO UNIX and OEM versions of SCO UNIX
Damien Miller78315eb2000-09-29 23:01:36 +1100376*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800377 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Ricee8c898a2004-02-23 21:47:04 -0800378 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100379 RANLIB=true
380 no_dev_ptmx=1
381 AC_DEFINE(BROKEN_SYS_TERMIO_H)
382 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000383 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000384 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100385 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Ricefe6d5aa2004-04-16 20:03:07 -0700386 AC_DEFINE(SETEUID_BREAKS_SETUID)
387 AC_DEFINE(BROKEN_SETREUID)
388 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700389 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100390 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700391 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700392 do_sco3_extra_lib_check=yes
Tim Ricef7ba8f62004-06-20 10:37:32 -0700393 TEST_SHELL=ksh
Damien Miller78315eb2000-09-29 23:01:36 +1100394 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800395# SCO OpenServer 5.x
Damien Miller78315eb2000-09-29 23:01:36 +1100396*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800397 if test -z "$GCC"; then
398 CFLAGS="$CFLAGS -belf"
399 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100400 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000401 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100402 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000403 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000404 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700405 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700406 AC_DEFINE(SETEUID_BREAKS_SETUID)
407 AC_DEFINE(BROKEN_SETREUID)
408 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700409 AC_DEFINE(WITH_ABBREV_NO_TTY)
Tim Rice816bd0d2004-07-19 10:19:26 -0700410 AC_DEFINE(BROKEN_UPDWTMPX)
Darren Tucker33370e02005-02-09 22:17:28 +1100411 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
Damien Miller217f5672001-02-16 12:12:41 +1100412 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700413 MANTYPE=man
Tim Ricef7ba8f62004-06-20 10:37:32 -0700414 TEST_SHELL=ksh
Damien Millera66626b2000-06-13 18:57:53 +1000415 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000416*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100417 AC_DEFINE(NO_SSH_LASTLOG)
418 AC_DEFINE(SETEUID_BREAKS_SETUID)
419 AC_DEFINE(BROKEN_SETREUID)
420 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000421 AC_DEFINE(USE_PIPES)
422 AC_DEFINE(DISABLE_FD_PASSING)
423 LDFLAGS="$LDFLAGS"
424 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
425 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000426 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000427*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100428 AC_DEFINE(SETEUID_BREAKS_SETUID)
429 AC_DEFINE(BROKEN_SETREUID)
430 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000431 AC_DEFINE(WITH_ABBREV_NO_TTY)
432 AC_DEFINE(USE_PIPES)
433 AC_DEFINE(DISABLE_FD_PASSING)
434 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100435 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000436 MANTYPE=cat
437 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000438*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100439 AC_DEFINE(SETEUID_BREAKS_SETUID)
440 AC_DEFINE(BROKEN_SETREUID)
441 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000442 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700443 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700444 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000445 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
446 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
447 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700448 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000449*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000450 AC_MSG_CHECKING(for Digital Unix SIA)
451 no_osfsia=""
452 AC_ARG_WITH(osfsia,
453 [ --with-osfsia Enable Digital Unix SIA],
454 [
455 if test "x$withval" = "xno" ; then
456 AC_MSG_RESULT(disabled)
457 no_osfsia=1
458 fi
459 ],
460 )
461 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000462 if test -f /etc/sia/matrix.conf; then
463 AC_MSG_RESULT(yes)
464 AC_DEFINE(HAVE_OSF_SIA)
465 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000466 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000467 LIBS="$LIBS -lsecurity -ldb -lm -laud"
468 else
469 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100470 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000471 fi
472 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000473 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700474 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000475 AC_DEFINE(BROKEN_SETREUID)
476 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000477 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000478
479*-*-nto-qnx)
480 AC_DEFINE(USE_PIPES)
481 AC_DEFINE(NO_X11_UNIX_SOCKETS)
482 AC_DEFINE(MISSING_NFDBITS)
483 AC_DEFINE(MISSING_HOWMANY)
484 AC_DEFINE(MISSING_FD_MASK)
485 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100486esac
487
Damien Millere37bfc12000-06-05 09:37:43 +1000488# Allow user to specify flags
489AC_ARG_WITH(cflags,
490 [ --with-cflags Specify additional flags to pass to compiler],
491 [
492 if test "x$withval" != "xno" ; then
493 CFLAGS="$CFLAGS $withval"
494 fi
495 ]
496)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000497AC_ARG_WITH(cppflags,
498 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
499 [
500 if test "x$withval" != "xno"; then
501 CPPFLAGS="$CPPFLAGS $withval"
502 fi
503 ]
504)
Damien Millere37bfc12000-06-05 09:37:43 +1000505AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000506 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000507 [
508 if test "x$withval" != "xno" ; then
509 LDFLAGS="$LDFLAGS $withval"
510 fi
511 ]
512)
513AC_ARG_WITH(libs,
514 [ --with-libs Specify additional libraries to link with],
515 [
516 if test "x$withval" != "xno" ; then
517 LIBS="$LIBS $withval"
518 fi
519 ]
520)
521
Darren Tucker6eb93042003-06-29 21:30:41 +1000522AC_MSG_CHECKING(compiler and flags for sanity)
Darren Tucker623d92f2004-09-12 22:36:15 +1000523AC_RUN_IFELSE(
524 [AC_LANG_SOURCE([
Darren Tucker6eb93042003-06-29 21:30:41 +1000525#include <stdio.h>
526int main(){exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000527 ])],
Darren Tucker6eb93042003-06-29 21:30:41 +1000528 [ AC_MSG_RESULT(yes) ],
529 [
530 AC_MSG_RESULT(no)
531 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000532 ],
533 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
Darren Tucker6eb93042003-06-29 21:30:41 +1000534)
535
Tim Rice4cec93f2002-02-26 08:40:48 -0800536# Checks for header files.
Damien Miller36f49652004-08-15 18:40:59 +1000537AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \
538 floatingpoint.h getopt.h glob.h ia.h lastlog.h limits.h login.h \
539 login_cap.h maillock.h ndir.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100540 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000541 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Damien Miller36f49652004-08-15 18:40:59 +1000542 strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \
543 sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \
Darren Tucker48d99d32004-08-29 17:04:50 +1000544 sys/pstat.h sys/select.h sys/stat.h sys/stream.h \
Damien Miller36f49652004-08-15 18:40:59 +1000545 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \
546 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 -0800547
Darren Tucker48d99d32004-08-29 17:04:50 +1000548# sys/ptms.h requires sys/stream.h to be included first on Solaris
549AC_CHECK_HEADERS(sys/ptms.h, [], [], [
550#ifdef HAVE_SYS_STREAM_H
551# include <sys/stream.h>
552#endif
553])
554
Damien Millera22ba012000-03-02 23:09:20 +1100555# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700556AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
557AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000558
Damien Millerdf288022001-02-18 13:07:07 +1100559dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700560if test "x$with_tcp_wrappers" != "xno" ; then
561 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
562 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
563 fi
564fi
Damien Millerdf288022001-02-18 13:07:07 +1100565
Tim Rice1e1ef642003-09-11 22:19:31 -0700566dnl IRIX and Solaris 2.5.1 have dirname() in libgen
567AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
568 AC_CHECK_LIB(gen, dirname,[
569 AC_CACHE_CHECK([for broken dirname],
570 ac_cv_have_broken_dirname, [
571 save_LIBS="$LIBS"
572 LIBS="$LIBS -lgen"
573 AC_TRY_RUN(
574 [
575#include <libgen.h>
576#include <string.h>
577
578int main(int argc, char **argv) {
579 char *s, buf[32];
580
581 strncpy(buf,"/etc", 32);
582 s = dirname(buf);
583 if (!s || strncmp(s, "/", 32) != 0) {
584 exit(1);
585 } else {
586 exit(0);
587 }
588}
589 ],
590 [ ac_cv_have_broken_dirname="no" ],
591 [ ac_cv_have_broken_dirname="yes" ]
592 )
593 LIBS="$save_LIBS"
594 ])
595 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
596 LIBS="$LIBS -lgen"
597 AC_DEFINE(HAVE_DIRNAME)
598 AC_CHECK_HEADERS(libgen.h)
599 fi
600 ])
601])
602
603AC_CHECK_FUNC(getspnam, ,
604 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
605AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
606
Tim Rice13aae5e2001-10-21 17:53:58 -0700607dnl zlib is required
608AC_ARG_WITH(zlib,
609 [ --with-zlib=PATH Use zlib in PATH],
610 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000611 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100612 AC_MSG_ERROR([*** zlib is required ***])
613 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700614 if test -d "$withval/lib"; then
615 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700616 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700617 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700618 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700619 fi
620 else
621 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700622 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700623 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700624 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700625 fi
626 fi
627 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700628 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700629 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700630 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700631 fi
632 ]
633)
634
Tim Ricefcb62202004-01-23 18:35:16 -0800635AC_CHECK_LIB(z, deflate, ,
636 [
637 saved_CPPFLAGS="$CPPFLAGS"
638 saved_LDFLAGS="$LDFLAGS"
639 save_LIBS="$LIBS"
640 dnl Check default zlib install dir
641 if test -n "${need_dash_r}"; then
642 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
643 else
644 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
645 fi
646 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
647 LIBS="$LIBS -lz"
648 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
649 [
650 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
651 ]
652 )
653 ]
654)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100655AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100656
657AC_ARG_WITH(zlib-version-check,
658 [ --without-zlib-version-check Disable zlib version check],
659 [ if test "x$withval" = "xno" ; then
660 zlib_check_nonfatal=1
661 fi
662 ]
663)
664
Darren Tucker2dcd2392004-01-23 17:13:33 +1100665AC_MSG_CHECKING(for zlib 1.1.4 or greater)
Darren Tucker623d92f2004-09-12 22:36:15 +1000666AC_RUN_IFELSE([AC_LANG_SOURCE([[
Darren Tucker2dcd2392004-01-23 17:13:33 +1100667#include <zlib.h>
668int main()
669{
670 int a, b, c, v;
671 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
672 exit(1);
673 v = a*1000000 + b*1000 + c;
674 if (v >= 1001004)
675 exit(0);
676 exit(2);
677}
Darren Tucker623d92f2004-09-12 22:36:15 +1000678 ]])],
Darren Tucker2dcd2392004-01-23 17:13:33 +1100679 AC_MSG_RESULT(yes),
680 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100681 if test -z "$zlib_check_nonfatal" ; then
682 AC_MSG_ERROR([*** zlib too old - check config.log ***
683Your reported zlib version has known security problems. It's possible your
684vendor has fixed these problems without changing the version number. If you
685are sure this is the case, you can disable the check by running
686"./configure --without-zlib-version-check".
687If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
688 else
689 AC_MSG_WARN([zlib version may have security problems])
690 fi
Darren Tuckera0c2b392004-09-11 23:26:37 +1000691 ],
692 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100693)
Damien Miller6f9c3372000-10-25 10:06:04 +1100694
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000695dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100696AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000697 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
698)
Damien Millera8e06ce2003-11-21 23:48:55 +1100699AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700700 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
701 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000702)
Damien Millerab18c411999-11-11 10:40:23 +1100703
Tim Ricee589a292001-11-03 11:09:32 -0800704dnl Checks for libutil functions
705AC_CHECK_HEADERS(libutil.h)
706AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
707AC_CHECK_FUNCS(logout updwtmp logwtmp)
708
Ben Lindstrom8697e082001-02-24 21:41:10 +0000709AC_FUNC_STRFTIME
710
Damien Miller3c027682001-03-14 11:39:45 +1100711# Check for ALTDIRFUNC glob() extension
712AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
713AC_EGREP_CPP(FOUNDIT,
714 [
715 #include <glob.h>
716 #ifdef GLOB_ALTDIRFUNC
717 FOUNDIT
718 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100719 ],
Damien Miller3c027682001-03-14 11:39:45 +1100720 [
721 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
722 AC_MSG_RESULT(yes)
723 ],
724 [
725 AC_MSG_RESULT(no)
726 ]
727)
Damien Millerab18c411999-11-11 10:40:23 +1100728
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000729# Check for g.gl_matchc glob() extension
730AC_MSG_CHECKING(for gl_matchc field in glob_t)
731AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100732 [
733 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000734 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100735 ],
736 [
737 AC_DEFINE(GLOB_HAS_GL_MATCHC)
738 AC_MSG_RESULT(yes)
739 ],
740 [
741 AC_MSG_RESULT(no)
742 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000743)
744
Damien Miller18bb4732001-03-28 14:35:30 +1000745AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000746AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000747 [AC_LANG_SOURCE([[
Damien Miller18bb4732001-03-28 14:35:30 +1000748#include <sys/types.h>
749#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700750int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Darren Tucker623d92f2004-09-12 22:36:15 +1000751 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100752 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000753 [
754 AC_MSG_RESULT(no)
755 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000756 ],
757 [
758 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
759 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Damien Miller18bb4732001-03-28 14:35:30 +1000760 ]
761)
762
Damien Miller36f49652004-08-15 18:40:59 +1000763AC_MSG_CHECKING([for /proc/pid/fd directory])
764if test -d "/proc/$$/fd" ; then
765 AC_DEFINE(HAVE_PROC_PID)
766 AC_MSG_RESULT(yes)
767else
768 AC_MSG_RESULT(no)
769fi
770
Damien Millerc547bf12001-02-16 10:18:12 +1100771# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100772SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100773AC_ARG_WITH(skey,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100774 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100775 [
776 if test "x$withval" != "xno" ; then
777
778 if test "x$withval" != "xyes" ; then
779 CPPFLAGS="$CPPFLAGS -I${withval}/include"
780 LDFLAGS="$LDFLAGS -L${withval}/lib"
781 fi
782
783 AC_DEFINE(SKEY)
784 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100785 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100786
Tim Rice4cec93f2002-02-26 08:40:48 -0800787 AC_MSG_CHECKING([for s/key support])
788 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100789 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800790#include <stdio.h>
791#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700792int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800793 ],
794 [AC_MSG_RESULT(yes)],
795 [
796 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100797 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
798 ])
Darren Tucker3b908f62004-04-14 15:26:39 +1000799 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
800 AC_TRY_COMPILE(
801 [#include <stdio.h>
802 #include <skey.h>],
803 [(void)skeychallenge(NULL,"name","",0);],
804 [AC_MSG_RESULT(yes)
805 AC_DEFINE(SKEYCHALLENGE_4ARG)],
806 [AC_MSG_RESULT(no)]
807 )
Damien Millerc547bf12001-02-16 10:18:12 +1100808 fi
809 ]
810)
811
812# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700813TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100814AC_ARG_WITH(tcp-wrappers,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100815 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100816 [
817 if test "x$withval" != "xno" ; then
818 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700819 saved_LDFLAGS="$LDFLAGS"
820 saved_CPPFLAGS="$CPPFLAGS"
821 if test -n "${withval}" -a "${withval}" != "yes"; then
822 if test -d "${withval}/lib"; then
823 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700824 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700825 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700826 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700827 fi
828 else
829 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700830 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700831 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700832 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700833 fi
834 fi
835 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700836 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700837 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700838 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700839 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700840 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800841 LIBWRAP="-lwrap"
842 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100843 AC_MSG_CHECKING(for libwrap)
844 AC_TRY_LINK(
845 [
Damien Miller0ac45002004-04-14 20:14:26 +1000846#include <sys/types.h>
847#include <sys/socket.h>
848#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +1100849#include <tcpd.h>
850 int deny_severity = 0, allow_severity = 0;
851 ],
852 [hosts_access(0);],
853 [
854 AC_MSG_RESULT(yes)
855 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800856 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700857 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100858 ],
859 [
860 AC_MSG_ERROR([*** libwrap missing])
861 ]
862 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800863 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100864 fi
865 ]
866)
867
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100868# Check whether user wants libedit support
869LIBEDIT_MSG="no"
870AC_ARG_WITH(libedit,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100871 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100872 [ if test "x$withval" != "xno" ; then
873 AC_CHECK_LIB(edit, el_init,
874 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
875 LIBEDIT="-ledit -lcurses"
876 LIBEDIT_MSG="yes"
877 AC_SUBST(LIBEDIT)
878 ],
879 [], [-lcurses]
880 )
881 fi ]
882)
883
Damien Millerfe1f1432003-02-24 15:45:42 +1100884dnl Checks for library functions. Please keep in alphabetical order
885AC_CHECK_FUNCS(\
Darren Tucker60bd4092004-06-25 14:03:34 +1000886 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
Darren Tuckerad7646a2005-02-02 10:43:59 +1100887 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
888 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
889 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100890 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000891 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100892 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000893 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100894 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000895 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000896 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100897 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100898)
Tim Rice13aae5e2001-10-21 17:53:58 -0700899
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000900# IRIX has a const char return value for gai_strerror()
901AC_CHECK_FUNCS(gai_strerror,[
902 AC_DEFINE(HAVE_GAI_STRERROR)
903 AC_TRY_COMPILE([
904#include <sys/types.h>
905#include <sys/socket.h>
906#include <netdb.h>
907
908const char *gai_strerror(int);],[
909char *str;
910
911str = gai_strerror(0);],[
912 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
913 [Define if gai_strerror() returns const char *])])])
914
Damien Millercd6853c2003-01-28 11:33:42 +1100915AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
916
Darren Tuckerf1159b52003-07-07 19:44:01 +1000917dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000918AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000919AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000920
Darren Tuckerb2427c82003-09-10 15:22:44 +1000921dnl tcsendbreak might be a macro
922AC_CHECK_DECL(tcsendbreak,
923 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100924 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000925 [#include <termios.h>]
926)
927
Darren Tucker5bb14002004-04-23 18:53:10 +1000928AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
929
Darren Tucker2a6b0292003-12-31 14:59:17 +1100930AC_CHECK_FUNCS(setresuid, [
931 dnl Some platorms have setresuid that isn't implemented, test for this
932 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000933 AC_RUN_IFELSE(
934 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100935#include <stdlib.h>
936#include <errno.h>
937int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000938 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100939 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100940 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000941 AC_MSG_RESULT(not implemented)],
942 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100943 )
944])
Darren Tuckere937be32003-12-17 18:53:26 +1100945
Darren Tucker2a6b0292003-12-31 14:59:17 +1100946AC_CHECK_FUNCS(setresgid, [
947 dnl Some platorms have setresgid that isn't implemented, test for this
948 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000949 AC_RUN_IFELSE(
950 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100951#include <stdlib.h>
952#include <errno.h>
953int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000954 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100955 [AC_MSG_RESULT(yes)],
956 [AC_DEFINE(BROKEN_SETRESGID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000957 AC_MSG_RESULT(not implemented)],
958 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100959 )
960])
Darren Tuckere937be32003-12-17 18:53:26 +1100961
Damien Millerad833b32000-08-23 10:46:23 +1000962dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000963AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000964dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000965AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000966AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000967dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000968AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000969AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100970
Damien Millera8e06ce2003-11-21 23:48:55 +1100971AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100972 [AC_DEFINE(HAVE_DAEMON)],
973 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
974)
975
Damien Millera8e06ce2003-11-21 23:48:55 +1100976AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100977 [AC_DEFINE(HAVE_GETPAGESIZE)],
978 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
979)
980
Damien Millercb170cb2000-07-01 16:52:55 +1000981# Check for broken snprintf
982if test "x$ac_cv_func_snprintf" = "xyes" ; then
983 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000984 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000985 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +1000986#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700987int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +1000988 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100989 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000990 [
991 AC_MSG_RESULT(no)
992 AC_DEFINE(BROKEN_SNPRINTF)
993 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000994 ],
995 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +1000996 )
997fi
998
Damien Millerb4097182004-05-23 14:09:40 +1000999# Check for missing getpeereid (or equiv) support
1000NO_PEERCHECK=""
1001if test "x$ac_cv_func_getpeereid" != "xyes" ; then
1002 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1003 AC_TRY_COMPILE(
1004 [#include <sys/types.h>
1005 #include <sys/socket.h>],
1006 [int i = SO_PEERCRED;],
1007 [AC_MSG_RESULT(yes)],
1008 [AC_MSG_RESULT(no)
1009 NO_PEERCHECK=1]
1010 )
1011fi
1012
Damien Millere8328192003-01-07 15:18:32 +11001013dnl see whether mkstemp() requires XXXXXX
1014if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1015AC_MSG_CHECKING([for (overly) strict mkstemp])
1016AC_TRY_RUN(
1017 [
1018#include <stdlib.h>
1019main() { char template[]="conftest.mkstemp-test";
1020if (mkstemp(template) == -1)
1021 exit(1);
1022unlink(template); exit(0);
1023}
1024 ],
1025 [
1026 AC_MSG_RESULT(no)
1027 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001028 [
Damien Millere8328192003-01-07 15:18:32 +11001029 AC_MSG_RESULT(yes)
1030 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1031 ],
1032 [
1033 AC_MSG_RESULT(yes)
1034 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001035 ]
Damien Millere8328192003-01-07 15:18:32 +11001036)
1037fi
1038
Darren Tucker70a3d552003-08-21 17:58:29 +10001039dnl make sure that openpty does not reacquire controlling terminal
1040if test ! -z "$check_for_openpty_ctty_bug"; then
1041 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1042 AC_TRY_RUN(
1043 [
1044#include <stdio.h>
1045#include <sys/fcntl.h>
1046#include <sys/types.h>
1047#include <sys/wait.h>
1048
1049int
1050main()
1051{
1052 pid_t pid;
1053 int fd, ptyfd, ttyfd, status;
1054
1055 pid = fork();
1056 if (pid < 0) { /* failed */
1057 exit(1);
1058 } else if (pid > 0) { /* parent */
1059 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001060 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001061 exit(WEXITSTATUS(status));
1062 else
1063 exit(2);
1064 } else { /* child */
1065 close(0); close(1); close(2);
1066 setsid();
1067 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1068 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1069 if (fd >= 0)
1070 exit(3); /* Acquired ctty: broken */
1071 else
1072 exit(0); /* Did not acquire ctty: OK */
1073 }
1074}
1075 ],
1076 [
1077 AC_MSG_RESULT(yes)
1078 ],
1079 [
1080 AC_MSG_RESULT(no)
1081 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1082 ]
1083 )
1084fi
1085
Darren Tucker4398cf52004-04-06 21:39:02 +10001086if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1087 AC_MSG_CHECKING(if getaddrinfo seems to work)
1088 AC_TRY_RUN(
1089 [
1090#include <stdio.h>
1091#include <sys/socket.h>
1092#include <netdb.h>
1093#include <errno.h>
1094#include <netinet/in.h>
1095
1096#define TEST_PORT "2222"
1097
1098int
1099main(void)
1100{
1101 int err, sock;
1102 struct addrinfo *gai_ai, *ai, hints;
1103 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1104
1105 memset(&hints, 0, sizeof(hints));
1106 hints.ai_family = PF_UNSPEC;
1107 hints.ai_socktype = SOCK_STREAM;
1108 hints.ai_flags = AI_PASSIVE;
1109
1110 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1111 if (err != 0) {
1112 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1113 exit(1);
1114 }
1115
1116 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1117 if (ai->ai_family != AF_INET6)
1118 continue;
1119
1120 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1121 sizeof(ntop), strport, sizeof(strport),
1122 NI_NUMERICHOST|NI_NUMERICSERV);
1123
1124 if (err != 0) {
1125 if (err == EAI_SYSTEM)
1126 perror("getnameinfo EAI_SYSTEM");
1127 else
1128 fprintf(stderr, "getnameinfo failed: %s\n",
1129 gai_strerror(err));
1130 exit(2);
1131 }
1132
1133 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1134 if (sock < 0)
1135 perror("socket");
1136 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1137 if (errno == EBADF)
1138 exit(3);
1139 }
1140 }
1141 exit(0);
1142}
1143 ],
1144 [
1145 AC_MSG_RESULT(yes)
1146 ],
1147 [
1148 AC_MSG_RESULT(no)
1149 AC_DEFINE(BROKEN_GETADDRINFO)
1150 ]
1151 )
1152fi
1153
Darren Tucker691d5232005-02-15 21:45:57 +11001154if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1155 AC_MSG_CHECKING(if getaddrinfo seems to work)
1156 AC_TRY_RUN(
1157 [
1158#include <stdio.h>
1159#include <sys/socket.h>
1160#include <netdb.h>
1161#include <errno.h>
1162#include <netinet/in.h>
1163
1164#define TEST_PORT "2222"
1165
1166int
1167main(void)
1168{
1169 int err, sock;
1170 struct addrinfo *gai_ai, *ai, hints;
1171 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1172
1173 memset(&hints, 0, sizeof(hints));
1174 hints.ai_family = PF_UNSPEC;
1175 hints.ai_socktype = SOCK_STREAM;
1176 hints.ai_flags = AI_PASSIVE;
1177
1178 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1179 if (err != 0) {
1180 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1181 exit(1);
1182 }
1183
1184 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1185 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1186 continue;
1187
1188 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1189 sizeof(ntop), strport, sizeof(strport),
1190 NI_NUMERICHOST|NI_NUMERICSERV);
1191
1192 if (ai->ai_family == AF_INET && err != 0) {
1193 perror("getnameinfo");
1194 exit(2);
1195 }
1196 }
1197 exit(0);
1198}
1199 ],
1200 [
1201 AC_MSG_RESULT(yes)
1202 AC_DEFINE(AIX_GETNAMEINFO_HACK, [],
1203[Define if you have a getaddrinfo that fails for the all-zeros IPv6 address])
1204 ],
1205 [
1206 AC_MSG_RESULT(no)
1207 AC_DEFINE(BROKEN_GETADDRINFO)
1208 ]
1209 )
1210fi
1211
Darren Tuckera56f1912004-11-02 20:30:54 +11001212if test "x$check_for_conflicting_getspnam" = "x1"; then
1213 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1214 AC_COMPILE_IFELSE(
1215 [
1216#include <shadow.h>
1217int main(void) {exit(0);}
1218 ],
1219 [
1220 AC_MSG_RESULT(no)
1221 ],
1222 [
1223 AC_MSG_RESULT(yes)
1224 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1225 [Conflicting defs for getspnam])
1226 ]
1227 )
1228fi
1229
Damien Miller606f8802000-09-16 15:39:56 +11001230AC_FUNC_GETPGRP
1231
Damien Millera64b57a2001-01-17 10:44:13 +11001232# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001233PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001234AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001235 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001236 [
Damien Millera64b57a2001-01-17 10:44:13 +11001237 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001238 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1239 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001240 AC_MSG_ERROR([PAM headers not found])
1241 fi
1242
1243 AC_CHECK_LIB(dl, dlopen, , )
1244 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1245 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001246 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001247
Damien Millera64b57a2001-01-17 10:44:13 +11001248 PAM_MSG="yes"
1249
1250 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001251 if test $ac_cv_lib_dl_dlopen = yes; then
1252 LIBPAM="-lpam -ldl"
1253 else
1254 LIBPAM="-lpam"
1255 fi
1256 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001257 fi
1258 ]
1259)
Damien Millera22ba012000-03-02 23:09:20 +11001260
Damien Millera64b57a2001-01-17 10:44:13 +11001261# Check for older PAM
1262if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001263 # Check PAM strerror arguments (old PAM)
1264 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1265 AC_TRY_COMPILE(
1266 [
Damien Miller81171112000-04-23 11:14:01 +10001267#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001268#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001269#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001270#elif defined (HAVE_PAM_PAM_APPL_H)
1271#include <pam/pam_appl.h>
1272#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001273 ],
1274 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001275 [AC_MSG_RESULT(no)],
1276 [
1277 AC_DEFINE(HAVE_OLD_PAM)
1278 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001279 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001280 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001281 )
Damien Millera22ba012000-03-02 23:09:20 +11001282fi
1283
Tim Riceaef73712002-05-11 13:17:42 -07001284# Search for OpenSSL
1285saved_CPPFLAGS="$CPPFLAGS"
1286saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001287AC_ARG_WITH(ssl-dir,
1288 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1289 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001290 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001291 case "$withval" in
1292 # Relative paths
1293 ./*|../*) withval="`pwd`/$withval"
1294 esac
Tim Riceaef73712002-05-11 13:17:42 -07001295 if test -d "$withval/lib"; then
1296 if test -n "${need_dash_r}"; then
1297 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1298 else
1299 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1300 fi
1301 else
1302 if test -n "${need_dash_r}"; then
1303 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1304 else
1305 LDFLAGS="-L${withval} ${LDFLAGS}"
1306 fi
1307 fi
1308 if test -d "$withval/include"; then
1309 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1310 else
1311 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1312 fi
Damien Millera22ba012000-03-02 23:09:20 +11001313 fi
1314 ]
1315)
Tim Rice3d5352e2004-02-12 09:27:21 -08001316LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001317AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001318 [
Tim Riceaef73712002-05-11 13:17:42 -07001319 dnl Check default openssl install dir
1320 if test -n "${need_dash_r}"; then
1321 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001322 else
Tim Riceaef73712002-05-11 13:17:42 -07001323 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001324 fi
Tim Riceaef73712002-05-11 13:17:42 -07001325 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1326 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1327 [
1328 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1329 ]
1330 )
1331 ]
1332)
1333
Tim Riced730b782002-08-13 18:52:10 -07001334# Determine OpenSSL header version
1335AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001336AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001337 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001338#include <stdio.h>
1339#include <string.h>
1340#include <openssl/opensslv.h>
1341#define DATA "conftest.sslincver"
1342int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001343 FILE *fd;
1344 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001345
Damien Millera8e06ce2003-11-21 23:48:55 +11001346 fd = fopen(DATA,"w");
1347 if(fd == NULL)
1348 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001349
1350 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1351 exit(1);
1352
1353 exit(0);
1354}
Darren Tucker623d92f2004-09-12 22:36:15 +10001355 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001356 [
1357 ssl_header_ver=`cat conftest.sslincver`
1358 AC_MSG_RESULT($ssl_header_ver)
1359 ],
1360 [
1361 AC_MSG_RESULT(not found)
1362 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001363 ],
1364 [
1365 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001366 ]
1367)
1368
1369# Determine OpenSSL library version
1370AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001371AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001372 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001373#include <stdio.h>
1374#include <string.h>
1375#include <openssl/opensslv.h>
1376#include <openssl/crypto.h>
1377#define DATA "conftest.ssllibver"
1378int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001379 FILE *fd;
1380 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001381
Damien Millera8e06ce2003-11-21 23:48:55 +11001382 fd = fopen(DATA,"w");
1383 if(fd == NULL)
1384 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001385
1386 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1387 exit(1);
1388
1389 exit(0);
1390}
Darren Tucker623d92f2004-09-12 22:36:15 +10001391 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001392 [
1393 ssl_library_ver=`cat conftest.ssllibver`
1394 AC_MSG_RESULT($ssl_library_ver)
1395 ],
1396 [
1397 AC_MSG_RESULT(not found)
1398 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001399 ],
1400 [
1401 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001402 ]
1403)
Damien Millera22ba012000-03-02 23:09:20 +11001404
Damien Millerec932372002-01-22 22:16:03 +11001405# Sanity check OpenSSL headers
1406AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001407AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001408 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001409#include <string.h>
1410#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001411int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001412 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001413 [
1414 AC_MSG_RESULT(yes)
1415 ],
1416 [
1417 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001418 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1419Check config.log for details.
1420Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001421 ],
1422 [
1423 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001424 ]
1425)
1426
Tim Rice3d5352e2004-02-12 09:27:21 -08001427# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1428# because the system crypt() is more featureful.
1429if test "x$check_for_libcrypt_before" = "x1"; then
1430 AC_CHECK_LIB(crypt, crypt)
1431fi
1432
Damien Millera8e06ce2003-11-21 23:48:55 +11001433# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001434# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001435if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001436 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001437fi
1438
Damien Miller6c21c512002-01-22 21:57:53 +11001439
1440### Configure cryptographic random number support
1441
1442# Check wheter OpenSSL seeds itself
1443AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001444AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001445 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001446#include <string.h>
1447#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001448int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001449 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001450 [
1451 OPENSSL_SEEDS_ITSELF=yes
1452 AC_MSG_RESULT(yes)
1453 ],
1454 [
1455 AC_MSG_RESULT(no)
1456 # Default to use of the rand helper if OpenSSL doesn't
1457 # seed itself
1458 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001459 ],
1460 [
1461 AC_MSG_WARN([cross compiling: assuming yes])
1462 # This is safe, since all recent OpenSSL versions will
1463 # complain at runtime if not seeded correctly.
1464 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001465 ]
1466)
1467
1468
1469# Do we want to force the use of the rand helper?
1470AC_ARG_WITH(rand-helper,
1471 [ --with-rand-helper Use subprocess to gather strong randomness ],
1472 [
1473 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001474 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001475 # the previous test showed it to be unseeded.
1476 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1477 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1478 OPENSSL_SEEDS_ITSELF=yes
1479 USE_RAND_HELPER=""
1480 fi
1481 else
1482 USE_RAND_HELPER=yes
1483 fi
1484 ],
1485)
1486
1487# Which randomness source do we use?
1488if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1489 # OpenSSL only
1490 AC_DEFINE(OPENSSL_PRNG_ONLY)
1491 RAND_MSG="OpenSSL internal ONLY"
1492 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001493elif test ! -z "$USE_RAND_HELPER" ; then
1494 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001495 RAND_MSG="ssh-rand-helper"
1496 INSTALL_SSH_RAND_HELPER="yes"
1497fi
1498AC_SUBST(INSTALL_SSH_RAND_HELPER)
1499
1500### Configuration of ssh-rand-helper
1501
1502# PRNGD TCP socket
1503AC_ARG_WITH(prngd-port,
1504 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1505 [
Damien Millere996d722002-01-23 11:20:59 +11001506 case "$withval" in
1507 no)
1508 withval=""
1509 ;;
1510 [[0-9]]*)
1511 ;;
1512 *)
1513 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1514 ;;
1515 esac
1516 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001517 PRNGD_PORT="$withval"
1518 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1519 fi
1520 ]
1521)
1522
1523# PRNGD Unix domain socket
1524AC_ARG_WITH(prngd-socket,
1525 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1526 [
Damien Millere996d722002-01-23 11:20:59 +11001527 case "$withval" in
1528 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001529 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001530 ;;
1531 no)
1532 withval=""
1533 ;;
1534 /*)
1535 ;;
1536 *)
1537 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1538 ;;
1539 esac
1540
1541 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001542 if test ! -z "$PRNGD_PORT" ; then
1543 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1544 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001545 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001546 AC_MSG_WARN(Entropy socket is not readable)
1547 fi
1548 PRNGD_SOCKET="$withval"
1549 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1550 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001551 ],
1552 [
1553 # Check for existing socket only if we don't have a random device already
1554 if test "$USE_RAND_HELPER" = yes ; then
1555 AC_MSG_CHECKING(for PRNGD/EGD socket)
1556 # Insert other locations here
1557 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1558 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1559 PRNGD_SOCKET="$sock"
1560 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1561 break;
1562 fi
1563 done
1564 if test ! -z "$PRNGD_SOCKET" ; then
1565 AC_MSG_RESULT($PRNGD_SOCKET)
1566 else
1567 AC_MSG_RESULT(not found)
1568 fi
1569 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001570 ]
1571)
1572
1573# Change default command timeout for hashing entropy source
1574entropy_timeout=200
1575AC_ARG_WITH(entropy-timeout,
1576 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1577 [
1578 if test "x$withval" != "xno" ; then
1579 entropy_timeout=$withval
1580 fi
1581 ]
1582)
Damien Miller6c21c512002-01-22 21:57:53 +11001583AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1584
Damien Millerd3f6ad22002-06-25 10:24:47 +10001585SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001586AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001587 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001588 [
1589 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001590 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001591 fi
1592 ]
1593)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001594AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1595AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001596
Tim Rice88f2ab52002-03-17 12:17:34 -08001597# We do this little dance with the search path to insure
1598# that programs that we select for use by installed programs
1599# (which may be run by the super-user) come from trusted
1600# locations before they come from the user's private area.
1601# This should help avoid accidentally configuring some
1602# random version of a program in someone's personal bin.
1603
1604OPATH=$PATH
1605PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001606test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001607test -d /sbin && PATH=$PATH:/sbin
1608test -d /usr/sbin && PATH=$PATH:/usr/sbin
1609PATH=$PATH:/etc:$OPATH
1610
Damien Millera8e06ce2003-11-21 23:48:55 +11001611# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001612OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1613OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1614OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1615OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1616OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1617OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1618OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1619OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1620OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1621OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1622OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1623OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1624OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1625OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1626OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1627OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001628# restore PATH
1629PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001630
1631# Where does ssh-rand-helper get its randomness from?
1632INSTALL_SSH_PRNG_CMDS=""
1633if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1634 if test ! -z "$PRNGD_PORT" ; then
1635 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1636 elif test ! -z "$PRNGD_SOCKET" ; then
1637 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1638 else
1639 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1640 RAND_HELPER_CMDHASH=yes
1641 INSTALL_SSH_PRNG_CMDS="yes"
1642 fi
1643fi
1644AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1645
1646
Ben Lindstromb5628642000-10-18 00:02:25 +00001647# Cheap hack to ensure NEWS-OS libraries are arranged right.
1648if test ! -z "$SONY" ; then
1649 LIBS="$LIBS -liberty";
1650fi
1651
Damien Millera22ba012000-03-02 23:09:20 +11001652# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001653AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001654AC_CHECK_SIZEOF(short int, 2)
1655AC_CHECK_SIZEOF(int, 4)
1656AC_CHECK_SIZEOF(long int, 4)
1657AC_CHECK_SIZEOF(long long int, 8)
1658
Damien Millerfa2bb692002-04-23 23:22:25 +10001659# Sanity check long long for some platforms (AIX)
1660if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1661 ac_cv_sizeof_long_long_int=0
1662fi
1663
Damien Millera22ba012000-03-02 23:09:20 +11001664# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001665AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1666 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001667 [ #include <sys/types.h> ],
1668 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001669 [ ac_cv_have_u_int="yes" ],
1670 [ ac_cv_have_u_int="no" ]
1671 )
1672])
1673if test "x$ac_cv_have_u_int" = "xyes" ; then
1674 AC_DEFINE(HAVE_U_INT)
1675 have_u_int=1
1676fi
1677
Damien Miller61e50f12000-05-08 20:49:37 +10001678AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1679 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001680 [ #include <sys/types.h> ],
1681 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001682 [ ac_cv_have_intxx_t="yes" ],
1683 [ ac_cv_have_intxx_t="no" ]
1684 )
1685])
1686if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1687 AC_DEFINE(HAVE_INTXX_T)
1688 have_intxx_t=1
1689fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001690
1691if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001692 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001693then
1694 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1695 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001696 [ #include <stdint.h> ],
1697 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001698 [
1699 AC_DEFINE(HAVE_INTXX_T)
1700 AC_MSG_RESULT(yes)
1701 ],
1702 [ AC_MSG_RESULT(no) ]
1703 )
1704fi
1705
Damien Miller578783e2000-09-23 14:12:24 +11001706AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1707 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001708 [
1709#include <sys/types.h>
1710#ifdef HAVE_STDINT_H
1711# include <stdint.h>
1712#endif
1713#include <sys/socket.h>
1714#ifdef HAVE_SYS_BITYPES_H
1715# include <sys/bitypes.h>
1716#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001717 ],
1718 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001719 [ ac_cv_have_int64_t="yes" ],
1720 [ ac_cv_have_int64_t="no" ]
1721 )
1722])
1723if test "x$ac_cv_have_int64_t" = "xyes" ; then
1724 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001725fi
1726
Damien Miller61e50f12000-05-08 20:49:37 +10001727AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1728 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001729 [ #include <sys/types.h> ],
1730 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001731 [ ac_cv_have_u_intxx_t="yes" ],
1732 [ ac_cv_have_u_intxx_t="no" ]
1733 )
1734])
1735if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1736 AC_DEFINE(HAVE_U_INTXX_T)
1737 have_u_intxx_t=1
1738fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001739
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001740if test -z "$have_u_intxx_t" ; then
1741 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1742 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001743 [ #include <sys/socket.h> ],
1744 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001745 [
1746 AC_DEFINE(HAVE_U_INTXX_T)
1747 AC_MSG_RESULT(yes)
1748 ],
1749 [ AC_MSG_RESULT(no) ]
1750 )
1751fi
1752
Damien Miller578783e2000-09-23 14:12:24 +11001753AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1754 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001755 [ #include <sys/types.h> ],
1756 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001757 [ ac_cv_have_u_int64_t="yes" ],
1758 [ ac_cv_have_u_int64_t="no" ]
1759 )
1760])
1761if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1762 AC_DEFINE(HAVE_U_INT64_T)
1763 have_u_int64_t=1
1764fi
1765
Tim Rice4cec93f2002-02-26 08:40:48 -08001766if test -z "$have_u_int64_t" ; then
1767 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1768 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001769 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001770 [ u_int64_t a; a = 1],
1771 [
1772 AC_DEFINE(HAVE_U_INT64_T)
1773 AC_MSG_RESULT(yes)
1774 ],
1775 [ AC_MSG_RESULT(no) ]
1776 )
1777fi
1778
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001779if test -z "$have_u_intxx_t" ; then
1780 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1781 AC_TRY_COMPILE(
1782 [
1783#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001784 ],
1785 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001786 [ ac_cv_have_uintxx_t="yes" ],
1787 [ ac_cv_have_uintxx_t="no" ]
1788 )
1789 ])
1790 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1791 AC_DEFINE(HAVE_UINTXX_T)
1792 fi
1793fi
1794
1795if test -z "$have_uintxx_t" ; then
1796 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1797 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001798 [ #include <stdint.h> ],
1799 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001800 [
1801 AC_DEFINE(HAVE_UINTXX_T)
1802 AC_MSG_RESULT(yes)
1803 ],
1804 [ AC_MSG_RESULT(no) ]
1805 )
1806fi
1807
Damien Milleredb82922000-06-20 13:25:52 +10001808if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001809 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001810then
1811 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1812 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001813 [
1814#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001815 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001816 [
Damien Miller70494d12000-04-03 15:57:06 +10001817 int8_t a; int16_t b; int32_t c;
1818 u_int8_t e; u_int16_t f; u_int32_t g;
1819 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001820 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001821 [
1822 AC_DEFINE(HAVE_U_INTXX_T)
1823 AC_DEFINE(HAVE_INTXX_T)
1824 AC_MSG_RESULT(yes)
1825 ],
1826 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001827 )
Damien Millerb29ea912000-01-15 14:12:03 +11001828fi
1829
Damien Miller58be7382001-09-15 21:31:54 +10001830
1831AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1832 AC_TRY_COMPILE(
1833 [
1834#include <sys/types.h>
1835 ],
1836 [ u_char foo; foo = 125; ],
1837 [ ac_cv_have_u_char="yes" ],
1838 [ ac_cv_have_u_char="no" ]
1839 )
1840])
1841if test "x$ac_cv_have_u_char" = "xyes" ; then
1842 AC_DEFINE(HAVE_U_CHAR)
1843fi
1844
Tim Rice13aae5e2001-10-21 17:53:58 -07001845TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001846
Tim Rice200a5c02002-02-26 22:12:34 -08001847AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001848
Damien Miller61e50f12000-05-08 20:49:37 +10001849AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1850 AC_TRY_COMPILE(
1851 [
1852#include <sys/types.h>
1853 ],
1854 [ size_t foo; foo = 1235; ],
1855 [ ac_cv_have_size_t="yes" ],
1856 [ ac_cv_have_size_t="no" ]
1857 )
1858])
1859if test "x$ac_cv_have_size_t" = "xyes" ; then
1860 AC_DEFINE(HAVE_SIZE_T)
1861fi
Damien Miller95058511999-12-29 10:36:45 +11001862
Damien Miller615f9392000-05-17 22:53:33 +10001863AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1864 AC_TRY_COMPILE(
1865 [
1866#include <sys/types.h>
1867 ],
1868 [ ssize_t foo; foo = 1235; ],
1869 [ ac_cv_have_ssize_t="yes" ],
1870 [ ac_cv_have_ssize_t="no" ]
1871 )
1872])
1873if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1874 AC_DEFINE(HAVE_SSIZE_T)
1875fi
1876
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001877AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1878 AC_TRY_COMPILE(
1879 [
1880#include <time.h>
1881 ],
1882 [ clock_t foo; foo = 1235; ],
1883 [ ac_cv_have_clock_t="yes" ],
1884 [ ac_cv_have_clock_t="no" ]
1885 )
1886])
1887if test "x$ac_cv_have_clock_t" = "xyes" ; then
1888 AC_DEFINE(HAVE_CLOCK_T)
1889fi
1890
Damien Millerb54b40e2000-06-23 08:23:34 +10001891AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1892 AC_TRY_COMPILE(
1893 [
1894#include <sys/types.h>
1895#include <sys/socket.h>
1896 ],
1897 [ sa_family_t foo; foo = 1235; ],
1898 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001899 [ AC_TRY_COMPILE(
1900 [
1901#include <sys/types.h>
1902#include <sys/socket.h>
1903#include <netinet/in.h>
1904 ],
1905 [ sa_family_t foo; foo = 1235; ],
1906 [ ac_cv_have_sa_family_t="yes" ],
1907
Damien Millerb54b40e2000-06-23 08:23:34 +10001908 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001909 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001910 )
1911])
1912if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1913 AC_DEFINE(HAVE_SA_FAMILY_T)
1914fi
1915
Damien Miller0f91b4e2000-06-18 15:43:25 +10001916AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1917 AC_TRY_COMPILE(
1918 [
1919#include <sys/types.h>
1920 ],
1921 [ pid_t foo; foo = 1235; ],
1922 [ ac_cv_have_pid_t="yes" ],
1923 [ ac_cv_have_pid_t="no" ]
1924 )
1925])
1926if test "x$ac_cv_have_pid_t" = "xyes" ; then
1927 AC_DEFINE(HAVE_PID_T)
1928fi
1929
1930AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1931 AC_TRY_COMPILE(
1932 [
1933#include <sys/types.h>
1934 ],
1935 [ mode_t foo; foo = 1235; ],
1936 [ ac_cv_have_mode_t="yes" ],
1937 [ ac_cv_have_mode_t="no" ]
1938 )
1939])
1940if test "x$ac_cv_have_mode_t" = "xyes" ; then
1941 AC_DEFINE(HAVE_MODE_T)
1942fi
1943
Damien Miller61e50f12000-05-08 20:49:37 +10001944
1945AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1946 AC_TRY_COMPILE(
1947 [
Damien Miller81171112000-04-23 11:14:01 +10001948#include <sys/types.h>
1949#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001950 ],
1951 [ struct sockaddr_storage s; ],
1952 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1953 [ ac_cv_have_struct_sockaddr_storage="no" ]
1954 )
1955])
1956if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1957 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1958fi
Damien Miller34132e52000-01-14 15:45:46 +11001959
Damien Miller61e50f12000-05-08 20:49:37 +10001960AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1961 AC_TRY_COMPILE(
1962 [
Damien Miller7b22d652000-06-18 14:07:04 +10001963#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001964#include <netinet/in.h>
1965 ],
1966 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1967 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1968 [ ac_cv_have_struct_sockaddr_in6="no" ]
1969 )
1970])
1971if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1972 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1973fi
Damien Miller34132e52000-01-14 15:45:46 +11001974
Damien Miller61e50f12000-05-08 20:49:37 +10001975AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1976 AC_TRY_COMPILE(
1977 [
Damien Miller7b22d652000-06-18 14:07:04 +10001978#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001979#include <netinet/in.h>
1980 ],
1981 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1982 [ ac_cv_have_struct_in6_addr="yes" ],
1983 [ ac_cv_have_struct_in6_addr="no" ]
1984 )
1985])
1986if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1987 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1988fi
Damien Miller34132e52000-01-14 15:45:46 +11001989
Damien Miller61e50f12000-05-08 20:49:37 +10001990AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1991 AC_TRY_COMPILE(
1992 [
Damien Miller81171112000-04-23 11:14:01 +10001993#include <sys/types.h>
1994#include <sys/socket.h>
1995#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001996 ],
1997 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1998 [ ac_cv_have_struct_addrinfo="yes" ],
1999 [ ac_cv_have_struct_addrinfo="no" ]
2000 )
2001])
2002if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
2003 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
2004fi
2005
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002006AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2007 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002008 [ #include <sys/time.h> ],
2009 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002010 [ ac_cv_have_struct_timeval="yes" ],
2011 [ ac_cv_have_struct_timeval="no" ]
2012 )
2013])
2014if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
2015 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
2016 have_struct_timeval=1
2017fi
2018
Tim Rice4e4dc562003-03-18 10:21:40 -08002019AC_CHECK_TYPES(struct timespec)
2020
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002021# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002022if test "x$ac_cv_have_int64_t" = "xno" -a \
2023 "x$ac_cv_sizeof_long_int" != "x8" -a \
2024 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002025 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2026 echo "an alternative compiler (I.E., GCC) before continuing."
2027 echo ""
2028 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08002029else
2030dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10002031 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10002032 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08002033#include <stdio.h>
2034#include <string.h>
2035#ifdef HAVE_SNPRINTF
2036main()
2037{
2038 char buf[50];
2039 char expected_out[50];
2040 int mazsize = 50 ;
2041#if (SIZEOF_LONG_INT == 8)
2042 long int num = 0x7fffffffffffffff;
2043#else
Kevin Steves6482ec82001-07-15 02:09:28 +00002044 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08002045#endif
2046 strcpy(expected_out, "9223372036854775807");
2047 snprintf(buf, mazsize, "%lld", num);
2048 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11002049 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08002050 exit(0);
2051}
2052#else
2053main() { exit(0); }
2054#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10002055 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10002056 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08002057 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002058fi
2059
Damien Miller78315eb2000-09-29 23:01:36 +11002060dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10002061OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2062OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2063OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2064OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2065OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002066OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002067OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2068OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002069OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002070OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2071OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2072OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2073OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002074OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2075OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2076OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2077OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002078
2079AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00002080
Damien Miller61e50f12000-05-08 20:49:37 +10002081AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2082 ac_cv_have_ss_family_in_struct_ss, [
2083 AC_TRY_COMPILE(
2084 [
Damien Miller81171112000-04-23 11:14:01 +10002085#include <sys/types.h>
2086#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002087 ],
2088 [ struct sockaddr_storage s; s.ss_family = 1; ],
2089 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2090 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2091 )
2092])
2093if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2094 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
2095fi
2096
Damien Miller61e50f12000-05-08 20:49:37 +10002097AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2098 ac_cv_have___ss_family_in_struct_ss, [
2099 AC_TRY_COMPILE(
2100 [
Damien Miller81171112000-04-23 11:14:01 +10002101#include <sys/types.h>
2102#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002103 ],
2104 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2105 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2106 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2107 )
2108])
2109if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2110 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
2111fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002112
Damien Millerad833b32000-08-23 10:46:23 +10002113AC_CACHE_CHECK([for pw_class field in struct passwd],
2114 ac_cv_have_pw_class_in_struct_passwd, [
2115 AC_TRY_COMPILE(
2116 [
Damien Millerad833b32000-08-23 10:46:23 +10002117#include <pwd.h>
2118 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002119 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002120 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2121 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2122 )
2123])
2124if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2125 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
2126fi
2127
Kevin Steves82456952001-06-22 21:14:18 +00002128AC_CACHE_CHECK([for pw_expire field in struct passwd],
2129 ac_cv_have_pw_expire_in_struct_passwd, [
2130 AC_TRY_COMPILE(
2131 [
2132#include <pwd.h>
2133 ],
2134 [ struct passwd p; p.pw_expire = 0; ],
2135 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2136 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2137 )
2138])
2139if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2140 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
2141fi
2142
2143AC_CACHE_CHECK([for pw_change field in struct passwd],
2144 ac_cv_have_pw_change_in_struct_passwd, [
2145 AC_TRY_COMPILE(
2146 [
2147#include <pwd.h>
2148 ],
2149 [ struct passwd p; p.pw_change = 0; ],
2150 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2151 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2152 )
2153])
2154if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2155 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
2156fi
Damien Miller61e50f12000-05-08 20:49:37 +10002157
Tim Rice28bbb0c2002-05-27 17:37:32 -07002158dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002159AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2160 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002161 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002162 [
Tim Riceae49fe62002-04-12 10:26:21 -07002163#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002164#include <sys/socket.h>
2165#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002166int main() {
2167#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002168#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002169exit(1);
2170#endif
2171struct msghdr m;
2172m.msg_accrights = 0;
2173exit(0);
2174}
Kevin Steves939c9db2002-03-22 17:23:25 +00002175 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002176 [ ac_cv_have_accrights_in_msghdr="yes" ],
2177 [ ac_cv_have_accrights_in_msghdr="no" ]
2178 )
2179])
2180if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2181 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2182fi
2183
Kevin Stevesa44e0352002-04-07 16:18:03 +00002184AC_CACHE_CHECK([for msg_control field in struct msghdr],
2185 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002186 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002187 [
Tim Riceae49fe62002-04-12 10:26:21 -07002188#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002189#include <sys/socket.h>
2190#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002191int main() {
2192#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002193#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002194exit(1);
2195#endif
2196struct msghdr m;
2197m.msg_control = 0;
2198exit(0);
2199}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002200 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002201 [ ac_cv_have_control_in_msghdr="yes" ],
2202 [ ac_cv_have_control_in_msghdr="no" ]
2203 )
2204])
2205if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2206 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2207fi
2208
Damien Miller61e50f12000-05-08 20:49:37 +10002209AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002210 AC_TRY_LINK([],
2211 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002212 [ ac_cv_libc_defines___progname="yes" ],
2213 [ ac_cv_libc_defines___progname="no" ]
2214 )
2215])
2216if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2217 AC_DEFINE(HAVE___PROGNAME)
2218fi
2219
Kevin Steves4846f4a2002-03-22 18:19:53 +00002220AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2221 AC_TRY_LINK([
2222#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002223],
2224 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002225 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2226 [ ac_cv_cc_implements___FUNCTION__="no" ]
2227 )
2228])
2229if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2230 AC_DEFINE(HAVE___FUNCTION__)
2231fi
2232
2233AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2234 AC_TRY_LINK([
2235#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002236],
2237 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002238 [ ac_cv_cc_implements___func__="yes" ],
2239 [ ac_cv_cc_implements___func__="no" ]
2240 )
2241])
2242if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2243 AC_DEFINE(HAVE___func__)
2244fi
2245
Damien Miller4f8e6692001-07-14 13:22:53 +10002246AC_CACHE_CHECK([whether getopt has optreset support],
2247 ac_cv_have_getopt_optreset, [
2248 AC_TRY_LINK(
2249 [
2250#include <getopt.h>
2251 ],
2252 [ extern int optreset; optreset = 0; ],
2253 [ ac_cv_have_getopt_optreset="yes" ],
2254 [ ac_cv_have_getopt_optreset="no" ]
2255 )
2256])
2257if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2258 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2259fi
Damien Millera22ba012000-03-02 23:09:20 +11002260
Damien Millerecbb26d2000-07-15 14:59:14 +10002261AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002262 AC_TRY_LINK([],
2263 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002264 [ ac_cv_libc_defines_sys_errlist="yes" ],
2265 [ ac_cv_libc_defines_sys_errlist="no" ]
2266 )
2267])
2268if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2269 AC_DEFINE(HAVE_SYS_ERRLIST)
2270fi
2271
2272
Damien Miller11fa2cc2000-08-16 10:35:58 +10002273AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002274 AC_TRY_LINK([],
2275 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002276 [ ac_cv_libc_defines_sys_nerr="yes" ],
2277 [ ac_cv_libc_defines_sys_nerr="no" ]
2278 )
2279])
2280if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2281 AC_DEFINE(HAVE_SYS_NERR)
2282fi
2283
Damien Millera8e06ce2003-11-21 23:48:55 +11002284SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002285# Check whether user wants sectok support
2286AC_ARG_WITH(sectok,
2287 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002288 [
2289 if test "x$withval" != "xno" ; then
2290 if test "x$withval" != "xyes" ; then
2291 CPPFLAGS="$CPPFLAGS -I${withval}"
2292 LDFLAGS="$LDFLAGS -L${withval}"
2293 if test ! -z "$need_dash_r" ; then
2294 LDFLAGS="$LDFLAGS -R${withval}"
2295 fi
2296 if test ! -z "$blibpath" ; then
2297 blibpath="$blibpath:${withval}"
2298 fi
2299 fi
2300 AC_CHECK_HEADERS(sectok.h)
2301 if test "$ac_cv_header_sectok_h" != yes; then
2302 AC_MSG_ERROR(Can't find sectok.h)
2303 fi
2304 AC_CHECK_LIB(sectok, sectok_open)
2305 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2306 AC_MSG_ERROR(Can't find libsectok)
2307 fi
2308 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002309 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002310 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002311 fi
2312 ]
2313)
2314
2315# Check whether user wants OpenSC support
2316AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002317 AC_HELP_STRING([--with-opensc=PFX],
2318 [Enable smartcard support using OpenSC]),
2319 opensc_config_prefix="$withval", opensc_config_prefix="")
2320if test x$opensc_config_prefix != x ; then
2321 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2322 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2323 if test "$OPENSC_CONFIG" != "no"; then
2324 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2325 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2326 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2327 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2328 AC_DEFINE(SMARTCARD)
2329 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002330 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002331 fi
2332fi
Damien Miller85de5802001-09-18 14:01:11 +10002333
Darren Tucker5f88d342003-10-15 16:57:57 +10002334# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002335AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002336 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002337 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002338 # Needed by our getrrsetbyname()
2339 AC_SEARCH_LIBS(res_query, resolv)
2340 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002341 AC_MSG_CHECKING(if res_query will link)
2342 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2343 [AC_MSG_RESULT(no)
2344 saved_LIBS="$LIBS"
2345 LIBS="$LIBS -lresolv"
2346 AC_MSG_CHECKING(for res_query in -lresolv)
2347 AC_LINK_IFELSE([
2348#include <resolv.h>
2349int main()
2350{
2351 res_query (0, 0, 0, 0, 0);
2352 return 0;
2353}
2354 ],
2355 [LIBS="$LIBS -lresolv"
2356 AC_MSG_RESULT(yes)],
2357 [LIBS="$saved_LIBS"
2358 AC_MSG_RESULT(no)])
2359 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002360 AC_CHECK_FUNCS(_getshort _getlong)
2361 AC_CHECK_MEMBER(HEADER.ad,
2362 [AC_DEFINE(HAVE_HEADER_AD)],,
2363 [#include <arpa/nameser.h>])
2364 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002365
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002366# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002367KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002368AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002369 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002370 [ if test "x$withval" != "xno" ; then
2371 if test "x$withval" = "xyes" ; then
2372 KRB5ROOT="/usr/local"
2373 else
2374 KRB5ROOT=${withval}
2375 fi
2376
2377 AC_DEFINE(KRB5)
2378 KRB5_MSG="yes"
2379
2380 AC_MSG_CHECKING(for krb5-config)
2381 if test -x $KRB5ROOT/bin/krb5-config ; then
2382 KRB5CONF=$KRB5ROOT/bin/krb5-config
2383 AC_MSG_RESULT($KRB5CONF)
2384
2385 AC_MSG_CHECKING(for gssapi support)
2386 if $KRB5CONF | grep gssapi >/dev/null ; then
2387 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002388 AC_DEFINE(GSSAPI)
2389 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002390 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002391 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002392 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002393 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002394 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2395 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002396 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002397 AC_MSG_CHECKING(whether we are using Heimdal)
2398 AC_TRY_COMPILE([ #include <krb5.h> ],
2399 [ char *tmp = heimdal_version; ],
2400 [ AC_MSG_RESULT(yes)
2401 AC_DEFINE(HEIMDAL) ],
2402 AC_MSG_RESULT(no)
2403 )
2404 else
2405 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002406 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002407 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002408 AC_MSG_CHECKING(whether we are using Heimdal)
2409 AC_TRY_COMPILE([ #include <krb5.h> ],
2410 [ char *tmp = heimdal_version; ],
2411 [ AC_MSG_RESULT(yes)
2412 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10002413 K5LIBS="-lkrb5 -ldes"
2414 K5LIBS="$K5LIBS -lcom_err -lasn1"
2415 AC_CHECK_LIB(roken, net_write,
2416 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11002417 ],
2418 [ AC_MSG_RESULT(no)
2419 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2420 ]
2421 )
Damien Miller200d0a72003-06-30 19:21:36 +10002422 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002423
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002424 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2425 [ AC_DEFINE(GSSAPI)
2426 K5LIBS="-lgssapi $K5LIBS" ],
2427 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2428 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002429 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002430 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2431 $K5LIBS)
2432 ],
2433 $K5LIBS)
2434
2435 AC_CHECK_HEADER(gssapi.h, ,
2436 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002437 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002438 AC_CHECK_HEADERS(gssapi.h, ,
2439 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002440 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002441 ]
2442 )
2443
2444 oldCPP="$CPPFLAGS"
2445 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2446 AC_CHECK_HEADER(gssapi_krb5.h, ,
2447 [ CPPFLAGS="$oldCPP" ])
2448
Damien Millera8e06ce2003-11-21 23:48:55 +11002449 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002450 if test ! -z "$need_dash_r" ; then
2451 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2452 fi
2453 if test ! -z "$blibpath" ; then
2454 blibpath="$blibpath:${KRB5ROOT}/lib"
2455 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002456 fi
2457
2458 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2459 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2460 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2461
2462 LIBS="$LIBS $K5LIBS"
2463 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
Ben Lindstroma8104b52004-04-07 04:16:11 +00002464 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
Darren Tucker0d27ed12004-02-24 10:37:33 +11002465 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002466)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002467
Damien Millera22ba012000-03-02 23:09:20 +11002468# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002469
Damien Millerf58c6722002-05-13 13:15:42 +10002470PRIVSEP_PATH=/var/empty
2471AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002472 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002473 [
2474 if test "x$withval" != "$no" ; then
2475 PRIVSEP_PATH=$withval
2476 fi
2477 ]
2478)
2479AC_SUBST(PRIVSEP_PATH)
2480
Damien Millera22ba012000-03-02 23:09:20 +11002481AC_ARG_WITH(xauth,
2482 [ --with-xauth=PATH Specify path to xauth program ],
2483 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002484 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002485 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002486 fi
2487 ],
2488 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002489 TestPath="$PATH"
2490 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2491 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2492 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2493 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2494 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002495 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002496 xauth_path="/usr/openwin/bin/xauth"
2497 fi
2498 ]
2499)
2500
Damien Miller7d901272003-01-13 16:55:22 +11002501STRIP_OPT=-s
2502AC_ARG_ENABLE(strip,
2503 [ --disable-strip Disable calling strip(1) on install],
2504 [
2505 if test "x$enableval" = "xno" ; then
2506 STRIP_OPT=
2507 fi
2508 ]
2509)
2510AC_SUBST(STRIP_OPT)
2511
Damien Millera19cf472000-11-29 13:28:50 +11002512if test -z "$xauth_path" ; then
2513 XAUTH_PATH="undefined"
2514 AC_SUBST(XAUTH_PATH)
2515else
Damien Millera22ba012000-03-02 23:09:20 +11002516 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002517 XAUTH_PATH=$xauth_path
2518 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002519fi
Damien Millera22ba012000-03-02 23:09:20 +11002520
2521# Check for mail directory (last resort if we cannot get it from headers)
2522if test ! -z "$MAIL" ; then
2523 maildir=`dirname $MAIL`
2524 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2525fi
2526
Darren Tucker623d92f2004-09-12 22:36:15 +10002527if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002528 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2529 disable_ptmx_check=yes
2530fi
Damien Millera22ba012000-03-02 23:09:20 +11002531if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002532 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002533 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002534 [
2535 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2536 have_dev_ptmx=1
2537 ]
2538 )
2539 fi
Damien Millera22ba012000-03-02 23:09:20 +11002540fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10002541
Darren Tucker623d92f2004-09-12 22:36:15 +10002542if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002543 AC_CHECK_FILE("/dev/ptc",
2544 [
2545 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2546 have_dev_ptc=1
2547 ]
2548 )
2549else
2550 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2551fi
Damien Miller204ad072000-03-02 23:56:12 +11002552
Damien Millera22ba012000-03-02 23:09:20 +11002553# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002554AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002555 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002556 [
Damien Miller897741e2001-04-16 10:41:46 +10002557 case "$withval" in
2558 man|cat|doc)
2559 MANTYPE=$withval
2560 ;;
2561 *)
2562 AC_MSG_ERROR(invalid man type: $withval)
2563 ;;
2564 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002565 ]
2566)
Ben Lindstrombc709922001-04-18 18:04:21 +00002567if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002568 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2569 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002570 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2571 MANTYPE=doc
2572 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2573 MANTYPE=man
2574 else
2575 MANTYPE=cat
2576 fi
2577fi
Damien Miller670a4b82000-01-22 13:53:11 +11002578AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002579if test "$MANTYPE" = "doc"; then
2580 mansubdir=man;
2581else
2582 mansubdir=$MANTYPE;
2583fi
2584AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002585
Damien Millera22ba012000-03-02 23:09:20 +11002586# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002587MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002588AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002589 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002590 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002591 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002592 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002593 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002594 fi
2595 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002596)
2597
Damien Millera22ba012000-03-02 23:09:20 +11002598# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002599AC_ARG_WITH(shadow,
2600 [ --without-shadow Disable shadow password support],
2601 [
2602 if test "x$withval" = "xno" ; then
2603 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002604 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002605 fi
2606 ]
2607)
2608
Damien Miller1f335fb2000-06-26 11:31:33 +10002609if test -z "$disable_shadow" ; then
2610 AC_MSG_CHECKING([if the systems has expire shadow information])
2611 AC_TRY_COMPILE(
2612 [
2613#include <sys/types.h>
2614#include <shadow.h>
2615 struct spwd sp;
2616 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2617 [ sp_expire_available=yes ], []
2618 )
2619
2620 if test "x$sp_expire_available" = "xyes" ; then
2621 AC_MSG_RESULT(yes)
2622 AC_DEFINE(HAS_SHADOW_EXPIRE)
2623 else
2624 AC_MSG_RESULT(no)
2625 fi
2626fi
2627
Damien Millera22ba012000-03-02 23:09:20 +11002628# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002629if test ! -z "$IPADDR_IN_DISPLAY" ; then
2630 DISPLAY_HACK_MSG="yes"
2631 AC_DEFINE(IPADDR_IN_DISPLAY)
2632else
Damien Millera8e06ce2003-11-21 23:48:55 +11002633 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002634 AC_ARG_WITH(ipaddr-display,
2635 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2636 [
2637 if test "x$withval" != "xno" ; then
2638 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002639 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002640 fi
2641 ]
2642 )
2643fi
Damien Miller76112de1999-12-21 11:18:08 +11002644
Darren Tuckere1a790d2003-09-16 11:52:19 +10002645# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002646AC_ARG_ENABLE(etc-default-login,
Darren Tucker1b6f2292005-02-11 16:11:49 +11002647 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
Darren Tucker2f9573d2005-02-10 22:28:54 +11002648 [ if test "x$enableval" = "xno"; then
2649 AC_MSG_NOTICE([/etc/default/login handling disabled])
2650 etc_default_login=no
2651 else
2652 etc_default_login=yes
2653 fi ],
2654 [ etc_default_login=yes ]
2655)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002656
Darren Tucker2f9573d2005-02-10 22:28:54 +11002657if test "x$etc_default_login" != "xno"; then
2658 AC_CHECK_FILE("/etc/default/login",
2659 [ external_path_file=/etc/default/login ])
Darren Tucker623d92f2004-09-12 22:36:15 +10002660 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2661 then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002662 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2663 elif test "x$external_path_file" = "x/etc/default/login"; then
2664 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2665 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11002666fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002667
Tim Rice43a1c132002-04-17 21:19:14 -07002668dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2669if test $ac_cv_func_login_getcapbool = "yes" -a \
2670 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002671 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002672fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002673
Damien Millera22ba012000-03-02 23:09:20 +11002674# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002675SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002676AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002677 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002678 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002679 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002680 AC_MSG_WARN([
2681--with-default-path=PATH has no effect on this system.
2682Edit /etc/login.conf instead.])
2683 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002684 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002685 AC_MSG_WARN([
2686--with-default-path=PATH will only be used if PATH is not defined in
2687$external_path_file .])
2688 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002689 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002690 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002691 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002692 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002693 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2694 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002695 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002696 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002697 AC_MSG_WARN([
2698If PATH is defined in $external_path_file, ensure the path to scp is included,
2699otherwise scp will not work.])
2700 fi
2701 AC_TRY_RUN(
2702 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002703/* find out what STDPATH is */
2704#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002705#ifdef HAVE_PATHS_H
2706# include <paths.h>
2707#endif
2708#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002709# ifdef _PATH_USERPATH /* Irix */
2710# define _PATH_STDPATH _PATH_USERPATH
2711# else
2712# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2713# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002714#endif
2715#include <sys/types.h>
2716#include <sys/stat.h>
2717#include <fcntl.h>
2718#define DATA "conftest.stdpath"
2719
2720main()
2721{
2722 FILE *fd;
2723 int rc;
2724
2725 fd = fopen(DATA,"w");
2726 if(fd == NULL)
2727 exit(1);
2728
2729 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2730 exit(1);
2731
2732 exit(0);
2733}
2734 ], [ user_path=`cat conftest.stdpath` ],
2735 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2736 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2737 )
2738# make sure $bindir is in USER_PATH so scp will work
2739 t_bindir=`eval echo ${bindir}`
2740 case $t_bindir in
2741 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2742 esac
2743 case $t_bindir in
2744 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2745 esac
2746 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2747 if test $? -ne 0 ; then
2748 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2749 if test $? -ne 0 ; then
2750 user_path=$user_path:$t_bindir
2751 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2752 fi
2753 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002754 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002755)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002756if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002757 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2758 AC_SUBST(user_path)
2759fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002760
Damien Millera18bbd32002-05-13 10:48:57 +10002761# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002762AC_ARG_WITH(superuser-path,
2763 [ --with-superuser-path= Specify different path for super-user],
2764 [
2765 if test "x$withval" != "xno" ; then
2766 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2767 superuser_path=$withval
2768 fi
2769 ]
2770)
2771
2772
Damien Miller61e50f12000-05-08 20:49:37 +10002773AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002774IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002775AC_ARG_WITH(4in6,
2776 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2777 [
2778 if test "x$withval" != "xno" ; then
2779 AC_MSG_RESULT(yes)
2780 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002781 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002782 else
2783 AC_MSG_RESULT(no)
2784 fi
2785 ],[
2786 if test "x$inet6_default_4in6" = "xyes"; then
2787 AC_MSG_RESULT([yes (default)])
2788 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002789 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002790 else
2791 AC_MSG_RESULT([no (default)])
2792 fi
2793 ]
2794)
2795
Damien Miller60396b02001-02-18 17:01:00 +11002796# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002797BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002798AC_ARG_WITH(bsd-auth,
2799 [ --with-bsd-auth Enable BSD auth support],
2800 [
2801 if test "x$withval" != "xno" ; then
2802 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002803 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002804 fi
2805 ]
2806)
2807
Damien Millera22ba012000-03-02 23:09:20 +11002808# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002809piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002810# make sure the directory exists
2811if test ! -d $piddir ; then
2812 piddir=`eval echo ${sysconfdir}`
2813 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002814 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002815 esac
2816fi
2817
Tim Rice88f2ab52002-03-17 12:17:34 -08002818AC_ARG_WITH(pid-dir,
2819 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2820 [
2821 if test "x$withval" != "xno" ; then
2822 piddir=$withval
2823 if test ! -d $piddir ; then
2824 AC_MSG_WARN([** no $piddir directory on this system **])
2825 fi
2826 fi
2827 ]
2828)
2829
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002830AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002831AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002832
andre2ff7b5d2000-06-03 14:57:40 +00002833dnl allow user to disable some login recording features
2834AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002835 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002836 [
2837 if test "x$enableval" = "xno" ; then
2838 AC_DEFINE(DISABLE_LASTLOG)
2839 fi
2840 ]
andre2ff7b5d2000-06-03 14:57:40 +00002841)
2842AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002843 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002844 [
2845 if test "x$enableval" = "xno" ; then
2846 AC_DEFINE(DISABLE_UTMP)
2847 fi
2848 ]
andre2ff7b5d2000-06-03 14:57:40 +00002849)
2850AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002851 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002852 [
2853 if test "x$enableval" = "xno" ; then
2854 AC_DEFINE(DISABLE_UTMPX)
2855 fi
2856 ]
andre2ff7b5d2000-06-03 14:57:40 +00002857)
2858AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002859 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002860 [
2861 if test "x$enableval" = "xno" ; then
2862 AC_DEFINE(DISABLE_WTMP)
2863 fi
2864 ]
andre2ff7b5d2000-06-03 14:57:40 +00002865)
2866AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002867 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002868 [
2869 if test "x$enableval" = "xno" ; then
2870 AC_DEFINE(DISABLE_WTMPX)
2871 fi
2872 ]
andre2ff7b5d2000-06-03 14:57:40 +00002873)
2874AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002875 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002876 [
2877 if test "x$enableval" = "xno" ; then
2878 AC_DEFINE(DISABLE_LOGIN)
2879 fi
2880 ]
andre2ff7b5d2000-06-03 14:57:40 +00002881)
2882AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002883 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002884 [
2885 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002886 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002887 fi
2888 ]
andre2ff7b5d2000-06-03 14:57:40 +00002889)
2890AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002891 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002892 [
2893 if test "x$enableval" = "xno" ; then
2894 AC_DEFINE(DISABLE_PUTUTXLINE)
2895 fi
2896 ]
andre2ff7b5d2000-06-03 14:57:40 +00002897)
2898AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002899 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002900 [
2901 if test "x$withval" = "xno" ; then
2902 AC_DEFINE(DISABLE_LASTLOG)
2903 else
2904 conf_lastlog_location=$withval
2905 fi
2906 ]
2907)
andre2ff7b5d2000-06-03 14:57:40 +00002908
2909dnl lastlog, [uw]tmpx? detection
2910dnl NOTE: set the paths in the platform section to avoid the
2911dnl need for command-line parameters
2912dnl lastlog and [uw]tmp are subject to a file search if all else fails
2913
2914dnl lastlog detection
2915dnl NOTE: the code itself will detect if lastlog is a directory
2916AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2917AC_TRY_COMPILE([
2918#include <sys/types.h>
2919#include <utmp.h>
2920#ifdef HAVE_LASTLOG_H
2921# include <lastlog.h>
2922#endif
Damien Miller2994e082000-06-04 15:51:47 +10002923#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002924# include <paths.h>
2925#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002926#ifdef HAVE_LOGIN_H
2927# include <login.h>
2928#endif
andre2ff7b5d2000-06-03 14:57:40 +00002929 ],
2930 [ char *lastlog = LASTLOG_FILE; ],
2931 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002932 [
2933 AC_MSG_RESULT(no)
2934 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2935 AC_TRY_COMPILE([
2936#include <sys/types.h>
2937#include <utmp.h>
2938#ifdef HAVE_LASTLOG_H
2939# include <lastlog.h>
2940#endif
2941#ifdef HAVE_PATHS_H
2942# include <paths.h>
2943#endif
2944 ],
2945 [ char *lastlog = _PATH_LASTLOG; ],
2946 [ AC_MSG_RESULT(yes) ],
2947 [
andree441aa32000-06-12 22:34:38 +00002948 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002949 system_lastlog_path=no
2950 ])
2951 ]
andre2ff7b5d2000-06-03 14:57:40 +00002952)
Damien Miller2994e082000-06-04 15:51:47 +10002953
andre2ff7b5d2000-06-03 14:57:40 +00002954if test -z "$conf_lastlog_location"; then
2955 if test x"$system_lastlog_path" = x"no" ; then
2956 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002957 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002958 conf_lastlog_location=$f
2959 fi
2960 done
2961 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002962 AC_MSG_WARN([** Cannot find lastlog **])
2963 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002964 fi
2965 fi
2966fi
2967
2968if test -n "$conf_lastlog_location"; then
2969 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2970fi
2971
2972dnl utmp detection
2973AC_MSG_CHECKING([if your system defines UTMP_FILE])
2974AC_TRY_COMPILE([
2975#include <sys/types.h>
2976#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002977#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002978# include <paths.h>
2979#endif
2980 ],
2981 [ char *utmp = UTMP_FILE; ],
2982 [ AC_MSG_RESULT(yes) ],
2983 [ AC_MSG_RESULT(no)
2984 system_utmp_path=no ]
2985)
2986if test -z "$conf_utmp_location"; then
2987 if test x"$system_utmp_path" = x"no" ; then
2988 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2989 if test -f $f ; then
2990 conf_utmp_location=$f
2991 fi
2992 done
2993 if test -z "$conf_utmp_location"; then
2994 AC_DEFINE(DISABLE_UTMP)
2995 fi
2996 fi
2997fi
2998if test -n "$conf_utmp_location"; then
2999 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
3000fi
3001
3002dnl wtmp detection
3003AC_MSG_CHECKING([if your system defines WTMP_FILE])
3004AC_TRY_COMPILE([
3005#include <sys/types.h>
3006#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003007#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003008# include <paths.h>
3009#endif
3010 ],
3011 [ char *wtmp = WTMP_FILE; ],
3012 [ AC_MSG_RESULT(yes) ],
3013 [ AC_MSG_RESULT(no)
3014 system_wtmp_path=no ]
3015)
3016if test -z "$conf_wtmp_location"; then
3017 if test x"$system_wtmp_path" = x"no" ; then
3018 for f in /usr/adm/wtmp /var/log/wtmp; do
3019 if test -f $f ; then
3020 conf_wtmp_location=$f
3021 fi
3022 done
3023 if test -z "$conf_wtmp_location"; then
3024 AC_DEFINE(DISABLE_WTMP)
3025 fi
3026 fi
3027fi
3028if test -n "$conf_wtmp_location"; then
3029 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
3030fi
3031
3032
3033dnl utmpx detection - I don't know any system so perverse as to require
3034dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3035dnl there, though.
3036AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3037AC_TRY_COMPILE([
3038#include <sys/types.h>
3039#include <utmp.h>
3040#ifdef HAVE_UTMPX_H
3041#include <utmpx.h>
3042#endif
Damien Miller2994e082000-06-04 15:51:47 +10003043#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003044# include <paths.h>
3045#endif
3046 ],
3047 [ char *utmpx = UTMPX_FILE; ],
3048 [ AC_MSG_RESULT(yes) ],
3049 [ AC_MSG_RESULT(no)
3050 system_utmpx_path=no ]
3051)
3052if test -z "$conf_utmpx_location"; then
3053 if test x"$system_utmpx_path" = x"no" ; then
3054 AC_DEFINE(DISABLE_UTMPX)
3055 fi
3056else
3057 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
3058fi
3059
3060dnl wtmpx detection
3061AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3062AC_TRY_COMPILE([
3063#include <sys/types.h>
3064#include <utmp.h>
3065#ifdef HAVE_UTMPX_H
3066#include <utmpx.h>
3067#endif
Damien Miller2994e082000-06-04 15:51:47 +10003068#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003069# include <paths.h>
3070#endif
3071 ],
3072 [ char *wtmpx = WTMPX_FILE; ],
3073 [ AC_MSG_RESULT(yes) ],
3074 [ AC_MSG_RESULT(no)
3075 system_wtmpx_path=no ]
3076)
3077if test -z "$conf_wtmpx_location"; then
3078 if test x"$system_wtmpx_path" = x"no" ; then
3079 AC_DEFINE(DISABLE_WTMPX)
3080 fi
3081else
3082 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
3083fi
3084
Damien Miller4018c192000-04-30 09:30:44 +10003085
Damien Miller29ea30d2000-03-17 10:54:15 +11003086if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003087 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3088 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003089fi
3090
Tim Rice4cec93f2002-02-26 08:40:48 -08003091dnl remove pam and dl because they are in $LIBPAM
3092if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003093 LIBS=`echo $LIBS | sed 's/-lpam //'`
3094fi
3095if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3096 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003097fi
3098
Damien Millerbac2d8a2000-09-05 16:13:06 +11003099AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003100AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3101 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003102AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003103
Damien Miller7b22d652000-06-18 14:07:04 +10003104# Print summary of options
3105
Damien Miller7b22d652000-06-18 14:07:04 +10003106# Someone please show me a better way :)
3107A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3108B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3109C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3110D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003111E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003112F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003113G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003114H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3115I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3116J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003117
3118echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003119echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003120echo " User binaries: $B"
3121echo " System binaries: $C"
3122echo " Configuration files: $D"
3123echo " Askpass program: $E"
3124echo " Manual pages: $F"
3125echo " PID file: $G"
3126echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003127if test "x$external_path_file" = "x/etc/login.conf" ; then
3128echo " At runtime, sshd will use the path defined in $external_path_file"
3129echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003130else
Damien Millerf58c6722002-05-13 13:15:42 +10003131echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003132 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003133echo " (If PATH is set in $external_path_file it will be used instead. If"
3134echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3135 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003136fi
Damien Millera18bbd32002-05-13 10:48:57 +10003137if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003138echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003139fi
Damien Millerf58c6722002-05-13 13:15:42 +10003140echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003141echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003142echo " KerberosV support: $KRB5_MSG"
3143echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003144echo " S/KEY support: $SKEY_MSG"
3145echo " TCP Wrappers support: $TCPW_MSG"
3146echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003147echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003148echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003149echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3150echo " BSD Auth support: $BSD_AUTH_MSG"
3151echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003152if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003153echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003154fi
3155
Damien Miller7b22d652000-06-18 14:07:04 +10003156echo ""
3157
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003158echo " Host: ${host}"
3159echo " Compiler: ${CC}"
3160echo " Compiler flags: ${CFLAGS}"
3161echo "Preprocessor flags: ${CPPFLAGS}"
3162echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003163echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003164
3165echo ""
3166
Tim Rice6f1f7582004-05-30 21:38:51 -07003167if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003168 echo "SVR4 style packages are supported with \"make package\""
3169 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003170fi
3171
Damien Miller82cf0ce2000-12-20 13:34:48 +11003172if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003173 echo "PAM is enabled. You may need to install a PAM control file "
3174 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003175 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003176 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003177 echo ""
3178fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003179
Damien Miller6c21c512002-01-22 21:57:53 +11003180if test ! -z "$RAND_HELPER_CMDHASH" ; then
3181 echo "WARNING: you are using the builtin random number collection "
3182 echo "service. Please read WARNING.RNG and request that your OS "
3183 echo "vendor includes kernel-based random number collection in "
3184 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003185 echo ""
3186fi
Damien Miller60396b02001-02-18 17:01:00 +11003187
Damien Millerb4097182004-05-23 14:09:40 +10003188if test ! -z "$NO_PEERCHECK" ; then
3189 echo "WARNING: the operating system that you are using does not "
3190 echo "appear to support either the getpeereid() API nor the "
3191 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3192 echo "enforce security checks to prevent unauthorised connections to "
3193 echo "ssh-agent. Their absence increases the risk that a malicious "
3194 echo "user can connect to your agent. "
3195 echo ""
3196fi
3197