blob: aa6aed6b0fdab7789e1cfa4c2a058511d017fad4 [file] [log] [blame]
Darren Tuckerca6e7a72005-02-16 16:19:17 +11001# $Id: configure.ac,v 1.243 2005/02/16 05:19:17 dtucker Exp $
Damien Miller4fefe242004-03-11 14:20:10 +11002#
3# Copyright (c) 1999-2004 Damien Miller
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Damien Millere9cf3572001-02-09 12:55:35 +110016
Darren Tucker59f79c42004-09-30 21:17:08 +100017AC_INIT(OpenSSH, Portable)
Tim Rice13aae5e2001-10-21 17:53:58 -070018AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +100019
20AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +110021AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +110022AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +110023AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100024
Damien Millera22ba012000-03-02 23:09:20 +110025# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100026AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110027AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100028AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110029AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000030AC_PATH_PROG(AR, ar)
Tim Rice5af9db92004-06-19 19:31:06 -070031AC_PATH_PROG(CAT, cat)
32AC_PATH_PROG(KILL, kill)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070033AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080034AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110035AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100036AC_PATH_PROG(ENT, ent)
37AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110038AC_PATH_PROG(TEST_MINUS_S_SH, bash)
39AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
40AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070041AC_PATH_PROG(SH, sh)
Tim Ricef7ba8f62004-06-20 10:37:32 -070042AC_SUBST(TEST_SHELL,sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110043
Tim Rice6f1f7582004-05-30 21:38:51 -070044dnl for buildpkg.sh
45AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
46 [/usr/sbin${PATH_SEPARATOR}/etc])
47AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd,
48 [/usr/sbin${PATH_SEPARATOR}/etc])
49AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no)
50
Damien Millere8bb4502001-09-25 16:39:35 +100051# System features
52AC_SYS_LARGEFILE
53
Damien Miller3f62aba2000-11-29 11:56:35 +110054if test -z "$AR" ; then
55 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
56fi
57
Damien Millerad833b32000-08-23 10:46:23 +100058# Use LOGIN_PROGRAM from environment if possible
59if test ! -z "$LOGIN_PROGRAM" ; then
60 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
61else
62 # Search for login
63 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
64 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
65 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
66 fi
67fi
68
Darren Tucker23bc8d02004-02-06 16:24:31 +110069AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
70if test ! -z "$PATH_PASSWD_PROG" ; then
71 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
72fi
73
Damien Miller166bd442000-03-16 10:48:25 +110074if test -z "$LD" ; then
75 LD=$CC
76fi
77AC_SUBST(LD)
78
Damien Miller166bd442000-03-16 10:48:25 +110079AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110080if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100081 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110082fi
83
Tim Rice88368a32003-12-08 12:35:59 -080084AC_ARG_WITH(rpath,
85 [ --without-rpath Disable auto-added -R linker paths],
86 [
87 if test "x$withval" = "xno" ; then
88 need_dash_r=""
89 fi
90 if test "x$withval" = "xyes" ; then
91 need_dash_r=1
92 fi
93 ]
94)
95
Damien Millera22ba012000-03-02 23:09:20 +110096# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110097case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110098*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110099 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +1000100 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -0800101 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100102 fi
Damien Millereab4bae2003-04-29 23:22:40 +1000103 saved_LDFLAGS="$LDFLAGS"
104 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
105 if (test -z "$blibflags"); then
106 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
107 AC_TRY_LINK([], [], [blibflags=$tryflags])
108 fi
109 done
110 if (test -z "$blibflags"); then
111 AC_MSG_RESULT(not found)
112 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
113 else
114 AC_MSG_RESULT($blibflags)
115 fi
116 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000117 dnl Check for authenticate. Might be in libs.a on older AIXes
118 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -0700119 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000120 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -0700121 LIBS="$LIBS -ls"
122 ])
123 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000124 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
125 AC_CHECK_DECL(loginfailed,
126 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
127 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000128 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000129 [(void)loginfailed("user","host","tty",0);],
130 [AC_MSG_RESULT(yes)
131 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000132 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000133 )],
134 [],
135 [#include <usersec.h>]
136 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000137 AC_CHECK_FUNCS(setauthdb)
Darren Tucker691d5232005-02-15 21:45:57 +1100138 check_for_aix_broken_getaddrinfo=1
Damien Millerf5fea442002-04-23 22:52:45 +1000139 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000140 AC_DEFINE(SETEUID_BREAKS_SETUID)
141 AC_DEFINE(BROKEN_SETREUID)
142 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000143 dnl AIX handles lastlog as part of its login message
144 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000145 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000146 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100147 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100148*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100149 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800150 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100151 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000152 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100153 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100154 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000155 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000156 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700157 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000158 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100159 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000160*-*-dgux*)
161 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100162 AC_DEFINE(SETEUID_BREAKS_SETUID)
163 AC_DEFINE(BROKEN_SETREUID)
164 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000165 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000166*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000167 AC_MSG_CHECKING(if we have working getaddrinfo)
168 AC_TRY_RUN([#include <mach-o/dyld.h>
169main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
170 exit(0);
171 else
172 exit(1);
173}], [AC_MSG_RESULT(working)],
174 [AC_MSG_RESULT(buggy)
175 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700176 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000177 AC_DEFINE(SETEUID_BREAKS_SETUID)
178 AC_DEFINE(BROKEN_SETREUID)
179 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100180 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000181 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000182*-*-hpux10.26)
183 if test -z "$GCC"; then
184 CFLAGS="$CFLAGS -Ae"
185 fi
186 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
187 IPADDR_IN_DISPLAY=yes
188 AC_DEFINE(HAVE_SECUREWARE)
189 AC_DEFINE(USE_PIPES)
190 AC_DEFINE(LOGIN_NO_ENDOPT)
191 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000192 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000193 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700194 LIBS="$LIBS -lsec -lsecpw"
195 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000196 disable_ptmx_check=yes
197 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100198*-*-hpux10*)
199 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000200 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100201 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000202 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100203 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000204 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000205 AC_DEFINE(LOGIN_NO_ENDOPT)
206 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000207 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000208 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700209 LIBS="$LIBS -lsec"
210 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100211 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000212*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000213 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100214 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100215 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100216 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000217 AC_DEFINE(LOGIN_NO_ENDOPT)
218 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100219 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000220 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000221 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tucker2fba9932005-02-02 23:30:24 +1100222 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Darren Tucker4398cf52004-04-06 21:39:02 +1000223 check_for_hpux_broken_getaddrinfo=1
Darren Tuckera56f1912004-11-02 20:30:54 +1100224 check_for_conflicting_getspnam=1
Tim Ricef028f1e2002-07-19 12:41:10 -0700225 LIBS="$LIBS -lsec"
226 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000227 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100228*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100229 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000230 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000231 AC_DEFINE(SETEUID_BREAKS_SETUID)
232 AC_DEFINE(BROKEN_SETREUID)
233 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000234 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000235 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100236 ;;
237*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100238 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000239 AC_DEFINE(WITH_IRIX_ARRAY)
240 AC_DEFINE(WITH_IRIX_PROJECT)
241 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000242 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000243 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000244 AC_DEFINE(SETEUID_BREAKS_SETUID)
245 AC_DEFINE(BROKEN_SETREUID)
246 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker8db9a0f2004-04-06 21:31:12 +1000247 AC_DEFINE(BROKEN_UPDWTMPX)
Damien Millerf1b9d112002-04-23 23:09:19 +1000248 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000249 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100250 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100251*-*-linux*)
252 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100253 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000254 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100255 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000256 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker809031f2004-03-30 14:03:45 +1000257 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!")
Damien Miller35276252003-06-03 10:14:28 +1000258 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Darren Tuckere59b5082004-06-28 16:01:19 +1000259 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM)
Darren Tucker2fba9932005-02-02 23:30:24 +1100260 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
261 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
Damien Miller7bcb0892000-03-11 20:45:40 +1100262 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000263 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000264 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000265 AC_DEFINE(BROKEN_CMSG_TYPE)
266 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000267 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100268 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000269mips-sony-bsd|mips-sony-newsos4)
270 AC_DEFINE(HAVE_NEWS4)
271 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000272 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100273*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000274 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800275 if test "x$withval" != "xno" ; then
276 need_dash_r=1
277 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100278 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100279*-*-freebsd*)
280 check_for_libcrypt_later=1
281 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000282*-*-bsdi*)
283 AC_DEFINE(SETEUID_BREAKS_SETUID)
284 AC_DEFINE(BROKEN_SETREUID)
285 AC_DEFINE(BROKEN_SETREGID)
286 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000287*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000288 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100289 conf_utmp_location=/etc/utmp
290 conf_wtmp_location=/usr/adm/wtmp
291 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000292 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000293 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000294 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100295 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000296 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100297*-*-solaris*)
Tim Ricead4a1882004-02-29 15:53:37 -0800298 if test "x$withval" != "xno" ; then
299 need_dash_r=1
300 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100301 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000302 AC_DEFINE(LOGIN_NEEDS_UTMPX)
303 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000304 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker21dd0892004-08-16 23:12:05 +1000305 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID)
Darren Tuckere41bba52003-08-25 11:51:19 +1000306 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000307 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
308 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000309 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000310 # hardwire lastlog location (can't detect it on some versions)
311 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000312 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
313 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
314 if test "$sol2ver" -ge 8; then
315 AC_MSG_RESULT(yes)
316 AC_DEFINE(DISABLE_UTMP)
317 AC_DEFINE(DISABLE_WTMP)
318 else
319 AC_MSG_RESULT(no)
320 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100321 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000322*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000323 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000324 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100325 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000326 conf_utmp_location=/etc/utmp
327 conf_wtmp_location=/var/adm/wtmp
328 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000329 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000330 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000331*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700332 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000333 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000334 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000335 AC_DEFINE(SETEUID_BREAKS_SETUID)
336 AC_DEFINE(BROKEN_SETREUID)
337 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000338 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000339*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700340 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000341 AC_CHECK_LIB(dl, dlsym, ,)
Darren Tuckerca6e7a72005-02-16 16:19:17 +1100342 # -lresolv needs to be at then end of LIBS or DNS lookups break
343 AC_CHECK_LIB(res_query, resolv, [ LIBS="$LIBS -lresolv" ])
Damien Millerfd9885e2001-01-10 08:16:53 +1100344 IPADDR_IN_DISPLAY=yes
345 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000346 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000347 AC_DEFINE(SETEUID_BREAKS_SETUID)
348 AC_DEFINE(BROKEN_SETREUID)
349 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000350 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000351 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700352 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
353 # Attention: always take care to bind libsocket and libnsl before libc,
354 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000355 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800356# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
Damien Miller78315eb2000-09-29 23:01:36 +1100357*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100358 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700359 AC_DEFINE(SETEUID_BREAKS_SETUID)
360 AC_DEFINE(BROKEN_SETREUID)
361 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100362 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800363# UnixWare 7.x, OpenUNIX 8
Damien Miller78315eb2000-09-29 23:01:36 +1100364*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100365 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700366 AC_DEFINE(SETEUID_BREAKS_SETUID)
367 AC_DEFINE(BROKEN_SETREUID)
368 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100369 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100370*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100371 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800372# SCO UNIX and OEM versions of SCO UNIX
Damien Miller78315eb2000-09-29 23:01:36 +1100373*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800374 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Ricee8c898a2004-02-23 21:47:04 -0800375 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100376 RANLIB=true
377 no_dev_ptmx=1
378 AC_DEFINE(BROKEN_SYS_TERMIO_H)
379 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000380 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000381 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100382 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Ricefe6d5aa2004-04-16 20:03:07 -0700383 AC_DEFINE(SETEUID_BREAKS_SETUID)
384 AC_DEFINE(BROKEN_SETREUID)
385 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700386 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100387 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700388 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700389 do_sco3_extra_lib_check=yes
Tim Ricef7ba8f62004-06-20 10:37:32 -0700390 TEST_SHELL=ksh
Damien Miller78315eb2000-09-29 23:01:36 +1100391 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800392# SCO OpenServer 5.x
Damien Miller78315eb2000-09-29 23:01:36 +1100393*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800394 if test -z "$GCC"; then
395 CFLAGS="$CFLAGS -belf"
396 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100397 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000398 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100399 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000400 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000401 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700402 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700403 AC_DEFINE(SETEUID_BREAKS_SETUID)
404 AC_DEFINE(BROKEN_SETREUID)
405 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700406 AC_DEFINE(WITH_ABBREV_NO_TTY)
Tim Rice816bd0d2004-07-19 10:19:26 -0700407 AC_DEFINE(BROKEN_UPDWTMPX)
Darren Tucker33370e02005-02-09 22:17:28 +1100408 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
Damien Miller217f5672001-02-16 12:12:41 +1100409 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700410 MANTYPE=man
Tim Ricef7ba8f62004-06-20 10:37:32 -0700411 TEST_SHELL=ksh
Damien Millera66626b2000-06-13 18:57:53 +1000412 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000413*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100414 AC_DEFINE(NO_SSH_LASTLOG)
415 AC_DEFINE(SETEUID_BREAKS_SETUID)
416 AC_DEFINE(BROKEN_SETREUID)
417 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000418 AC_DEFINE(USE_PIPES)
419 AC_DEFINE(DISABLE_FD_PASSING)
420 LDFLAGS="$LDFLAGS"
421 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
422 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000423 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000424*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100425 AC_DEFINE(SETEUID_BREAKS_SETUID)
426 AC_DEFINE(BROKEN_SETREUID)
427 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000428 AC_DEFINE(WITH_ABBREV_NO_TTY)
429 AC_DEFINE(USE_PIPES)
430 AC_DEFINE(DISABLE_FD_PASSING)
431 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100432 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000433 MANTYPE=cat
434 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000435*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100436 AC_DEFINE(SETEUID_BREAKS_SETUID)
437 AC_DEFINE(BROKEN_SETREUID)
438 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000439 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700440 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700441 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000442 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
443 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
444 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700445 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000446*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000447 AC_MSG_CHECKING(for Digital Unix SIA)
448 no_osfsia=""
449 AC_ARG_WITH(osfsia,
450 [ --with-osfsia Enable Digital Unix SIA],
451 [
452 if test "x$withval" = "xno" ; then
453 AC_MSG_RESULT(disabled)
454 no_osfsia=1
455 fi
456 ],
457 )
458 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000459 if test -f /etc/sia/matrix.conf; then
460 AC_MSG_RESULT(yes)
461 AC_DEFINE(HAVE_OSF_SIA)
462 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000463 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000464 LIBS="$LIBS -lsecurity -ldb -lm -laud"
465 else
466 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100467 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000468 fi
469 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000470 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700471 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000472 AC_DEFINE(BROKEN_SETREUID)
473 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000474 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000475
476*-*-nto-qnx)
477 AC_DEFINE(USE_PIPES)
478 AC_DEFINE(NO_X11_UNIX_SOCKETS)
479 AC_DEFINE(MISSING_NFDBITS)
480 AC_DEFINE(MISSING_HOWMANY)
481 AC_DEFINE(MISSING_FD_MASK)
482 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100483esac
484
Damien Millere37bfc12000-06-05 09:37:43 +1000485# Allow user to specify flags
486AC_ARG_WITH(cflags,
487 [ --with-cflags Specify additional flags to pass to compiler],
488 [
489 if test "x$withval" != "xno" ; then
490 CFLAGS="$CFLAGS $withval"
491 fi
492 ]
493)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000494AC_ARG_WITH(cppflags,
495 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
496 [
497 if test "x$withval" != "xno"; then
498 CPPFLAGS="$CPPFLAGS $withval"
499 fi
500 ]
501)
Damien Millere37bfc12000-06-05 09:37:43 +1000502AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000503 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000504 [
505 if test "x$withval" != "xno" ; then
506 LDFLAGS="$LDFLAGS $withval"
507 fi
508 ]
509)
510AC_ARG_WITH(libs,
511 [ --with-libs Specify additional libraries to link with],
512 [
513 if test "x$withval" != "xno" ; then
514 LIBS="$LIBS $withval"
515 fi
516 ]
517)
518
Darren Tucker6eb93042003-06-29 21:30:41 +1000519AC_MSG_CHECKING(compiler and flags for sanity)
Darren Tucker623d92f2004-09-12 22:36:15 +1000520AC_RUN_IFELSE(
521 [AC_LANG_SOURCE([
Darren Tucker6eb93042003-06-29 21:30:41 +1000522#include <stdio.h>
523int main(){exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000524 ])],
Darren Tucker6eb93042003-06-29 21:30:41 +1000525 [ AC_MSG_RESULT(yes) ],
526 [
527 AC_MSG_RESULT(no)
528 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000529 ],
530 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
Darren Tucker6eb93042003-06-29 21:30:41 +1000531)
532
Tim Rice4cec93f2002-02-26 08:40:48 -0800533# Checks for header files.
Damien Miller36f49652004-08-15 18:40:59 +1000534AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \
535 floatingpoint.h getopt.h glob.h ia.h lastlog.h limits.h login.h \
536 login_cap.h maillock.h ndir.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100537 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000538 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Damien Miller36f49652004-08-15 18:40:59 +1000539 strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \
540 sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \
Darren Tucker48d99d32004-08-29 17:04:50 +1000541 sys/pstat.h sys/select.h sys/stat.h sys/stream.h \
Damien Miller36f49652004-08-15 18:40:59 +1000542 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \
543 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 -0800544
Darren Tucker48d99d32004-08-29 17:04:50 +1000545# sys/ptms.h requires sys/stream.h to be included first on Solaris
546AC_CHECK_HEADERS(sys/ptms.h, [], [], [
547#ifdef HAVE_SYS_STREAM_H
548# include <sys/stream.h>
549#endif
550])
551
Damien Millera22ba012000-03-02 23:09:20 +1100552# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700553AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
554AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000555
Damien Millerdf288022001-02-18 13:07:07 +1100556dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700557if test "x$with_tcp_wrappers" != "xno" ; then
558 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
559 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
560 fi
561fi
Damien Millerdf288022001-02-18 13:07:07 +1100562
Tim Rice1e1ef642003-09-11 22:19:31 -0700563dnl IRIX and Solaris 2.5.1 have dirname() in libgen
564AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
565 AC_CHECK_LIB(gen, dirname,[
566 AC_CACHE_CHECK([for broken dirname],
567 ac_cv_have_broken_dirname, [
568 save_LIBS="$LIBS"
569 LIBS="$LIBS -lgen"
570 AC_TRY_RUN(
571 [
572#include <libgen.h>
573#include <string.h>
574
575int main(int argc, char **argv) {
576 char *s, buf[32];
577
578 strncpy(buf,"/etc", 32);
579 s = dirname(buf);
580 if (!s || strncmp(s, "/", 32) != 0) {
581 exit(1);
582 } else {
583 exit(0);
584 }
585}
586 ],
587 [ ac_cv_have_broken_dirname="no" ],
588 [ ac_cv_have_broken_dirname="yes" ]
589 )
590 LIBS="$save_LIBS"
591 ])
592 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
593 LIBS="$LIBS -lgen"
594 AC_DEFINE(HAVE_DIRNAME)
595 AC_CHECK_HEADERS(libgen.h)
596 fi
597 ])
598])
599
600AC_CHECK_FUNC(getspnam, ,
601 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
602AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
603
Tim Rice13aae5e2001-10-21 17:53:58 -0700604dnl zlib is required
605AC_ARG_WITH(zlib,
606 [ --with-zlib=PATH Use zlib in PATH],
607 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000608 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100609 AC_MSG_ERROR([*** zlib is required ***])
610 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700611 if test -d "$withval/lib"; then
612 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700613 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700614 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700615 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700616 fi
617 else
618 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700619 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700620 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700621 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700622 fi
623 fi
624 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700625 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700626 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700627 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700628 fi
629 ]
630)
631
Tim Ricefcb62202004-01-23 18:35:16 -0800632AC_CHECK_LIB(z, deflate, ,
633 [
634 saved_CPPFLAGS="$CPPFLAGS"
635 saved_LDFLAGS="$LDFLAGS"
636 save_LIBS="$LIBS"
637 dnl Check default zlib install dir
638 if test -n "${need_dash_r}"; then
639 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
640 else
641 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
642 fi
643 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
644 LIBS="$LIBS -lz"
645 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
646 [
647 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
648 ]
649 )
650 ]
651)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100652AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100653
654AC_ARG_WITH(zlib-version-check,
655 [ --without-zlib-version-check Disable zlib version check],
656 [ if test "x$withval" = "xno" ; then
657 zlib_check_nonfatal=1
658 fi
659 ]
660)
661
Darren Tucker2dcd2392004-01-23 17:13:33 +1100662AC_MSG_CHECKING(for zlib 1.1.4 or greater)
Darren Tucker623d92f2004-09-12 22:36:15 +1000663AC_RUN_IFELSE([AC_LANG_SOURCE([[
Darren Tucker2dcd2392004-01-23 17:13:33 +1100664#include <zlib.h>
665int main()
666{
667 int a, b, c, v;
668 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
669 exit(1);
670 v = a*1000000 + b*1000 + c;
671 if (v >= 1001004)
672 exit(0);
673 exit(2);
674}
Darren Tucker623d92f2004-09-12 22:36:15 +1000675 ]])],
Darren Tucker2dcd2392004-01-23 17:13:33 +1100676 AC_MSG_RESULT(yes),
677 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100678 if test -z "$zlib_check_nonfatal" ; then
679 AC_MSG_ERROR([*** zlib too old - check config.log ***
680Your reported zlib version has known security problems. It's possible your
681vendor has fixed these problems without changing the version number. If you
682are sure this is the case, you can disable the check by running
683"./configure --without-zlib-version-check".
684If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
685 else
686 AC_MSG_WARN([zlib version may have security problems])
687 fi
Darren Tuckera0c2b392004-09-11 23:26:37 +1000688 ],
689 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100690)
Damien Miller6f9c3372000-10-25 10:06:04 +1100691
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000692dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100693AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000694 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
695)
Damien Millera8e06ce2003-11-21 23:48:55 +1100696AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700697 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
698 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000699)
Damien Millerab18c411999-11-11 10:40:23 +1100700
Tim Ricee589a292001-11-03 11:09:32 -0800701dnl Checks for libutil functions
702AC_CHECK_HEADERS(libutil.h)
703AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
704AC_CHECK_FUNCS(logout updwtmp logwtmp)
705
Ben Lindstrom8697e082001-02-24 21:41:10 +0000706AC_FUNC_STRFTIME
707
Damien Miller3c027682001-03-14 11:39:45 +1100708# Check for ALTDIRFUNC glob() extension
709AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
710AC_EGREP_CPP(FOUNDIT,
711 [
712 #include <glob.h>
713 #ifdef GLOB_ALTDIRFUNC
714 FOUNDIT
715 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100716 ],
Damien Miller3c027682001-03-14 11:39:45 +1100717 [
718 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
719 AC_MSG_RESULT(yes)
720 ],
721 [
722 AC_MSG_RESULT(no)
723 ]
724)
Damien Millerab18c411999-11-11 10:40:23 +1100725
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000726# Check for g.gl_matchc glob() extension
727AC_MSG_CHECKING(for gl_matchc field in glob_t)
728AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100729 [
730 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000731 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100732 ],
733 [
734 AC_DEFINE(GLOB_HAS_GL_MATCHC)
735 AC_MSG_RESULT(yes)
736 ],
737 [
738 AC_MSG_RESULT(no)
739 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000740)
741
Damien Miller18bb4732001-03-28 14:35:30 +1000742AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000743AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000744 [AC_LANG_SOURCE([[
Damien Miller18bb4732001-03-28 14:35:30 +1000745#include <sys/types.h>
746#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700747int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Darren Tucker623d92f2004-09-12 22:36:15 +1000748 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100749 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000750 [
751 AC_MSG_RESULT(no)
752 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000753 ],
754 [
755 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
756 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Damien Miller18bb4732001-03-28 14:35:30 +1000757 ]
758)
759
Damien Miller36f49652004-08-15 18:40:59 +1000760AC_MSG_CHECKING([for /proc/pid/fd directory])
761if test -d "/proc/$$/fd" ; then
762 AC_DEFINE(HAVE_PROC_PID)
763 AC_MSG_RESULT(yes)
764else
765 AC_MSG_RESULT(no)
766fi
767
Damien Millerc547bf12001-02-16 10:18:12 +1100768# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100769SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100770AC_ARG_WITH(skey,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100771 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100772 [
773 if test "x$withval" != "xno" ; then
774
775 if test "x$withval" != "xyes" ; then
776 CPPFLAGS="$CPPFLAGS -I${withval}/include"
777 LDFLAGS="$LDFLAGS -L${withval}/lib"
778 fi
779
780 AC_DEFINE(SKEY)
781 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100782 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100783
Tim Rice4cec93f2002-02-26 08:40:48 -0800784 AC_MSG_CHECKING([for s/key support])
785 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100786 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800787#include <stdio.h>
788#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700789int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800790 ],
791 [AC_MSG_RESULT(yes)],
792 [
793 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100794 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
795 ])
Darren Tucker3b908f62004-04-14 15:26:39 +1000796 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
797 AC_TRY_COMPILE(
798 [#include <stdio.h>
799 #include <skey.h>],
800 [(void)skeychallenge(NULL,"name","",0);],
801 [AC_MSG_RESULT(yes)
802 AC_DEFINE(SKEYCHALLENGE_4ARG)],
803 [AC_MSG_RESULT(no)]
804 )
Damien Millerc547bf12001-02-16 10:18:12 +1100805 fi
806 ]
807)
808
809# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700810TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100811AC_ARG_WITH(tcp-wrappers,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100812 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100813 [
814 if test "x$withval" != "xno" ; then
815 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700816 saved_LDFLAGS="$LDFLAGS"
817 saved_CPPFLAGS="$CPPFLAGS"
818 if test -n "${withval}" -a "${withval}" != "yes"; then
819 if test -d "${withval}/lib"; then
820 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700821 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700822 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700823 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700824 fi
825 else
826 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700827 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700828 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700829 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700830 fi
831 fi
832 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700833 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700834 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700835 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700836 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700837 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800838 LIBWRAP="-lwrap"
839 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100840 AC_MSG_CHECKING(for libwrap)
841 AC_TRY_LINK(
842 [
Damien Miller0ac45002004-04-14 20:14:26 +1000843#include <sys/types.h>
844#include <sys/socket.h>
845#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +1100846#include <tcpd.h>
847 int deny_severity = 0, allow_severity = 0;
848 ],
849 [hosts_access(0);],
850 [
851 AC_MSG_RESULT(yes)
852 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800853 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700854 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100855 ],
856 [
857 AC_MSG_ERROR([*** libwrap missing])
858 ]
859 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800860 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100861 fi
862 ]
863)
864
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100865# Check whether user wants libedit support
866LIBEDIT_MSG="no"
867AC_ARG_WITH(libedit,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100868 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100869 [ if test "x$withval" != "xno" ; then
870 AC_CHECK_LIB(edit, el_init,
871 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
872 LIBEDIT="-ledit -lcurses"
873 LIBEDIT_MSG="yes"
874 AC_SUBST(LIBEDIT)
875 ],
876 [], [-lcurses]
877 )
878 fi ]
879)
880
Damien Millerfe1f1432003-02-24 15:45:42 +1100881dnl Checks for library functions. Please keep in alphabetical order
882AC_CHECK_FUNCS(\
Darren Tucker60bd4092004-06-25 14:03:34 +1000883 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
Darren Tuckerad7646a2005-02-02 10:43:59 +1100884 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
885 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
886 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100887 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000888 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100889 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000890 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100891 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000892 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000893 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100894 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100895)
Tim Rice13aae5e2001-10-21 17:53:58 -0700896
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000897# IRIX has a const char return value for gai_strerror()
898AC_CHECK_FUNCS(gai_strerror,[
899 AC_DEFINE(HAVE_GAI_STRERROR)
900 AC_TRY_COMPILE([
901#include <sys/types.h>
902#include <sys/socket.h>
903#include <netdb.h>
904
905const char *gai_strerror(int);],[
906char *str;
907
908str = gai_strerror(0);],[
909 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
910 [Define if gai_strerror() returns const char *])])])
911
Damien Millercd6853c2003-01-28 11:33:42 +1100912AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
913
Darren Tuckerf1159b52003-07-07 19:44:01 +1000914dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000915AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000916AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000917
Darren Tuckerb2427c82003-09-10 15:22:44 +1000918dnl tcsendbreak might be a macro
919AC_CHECK_DECL(tcsendbreak,
920 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100921 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000922 [#include <termios.h>]
923)
924
Darren Tucker5bb14002004-04-23 18:53:10 +1000925AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
926
Darren Tucker2a6b0292003-12-31 14:59:17 +1100927AC_CHECK_FUNCS(setresuid, [
928 dnl Some platorms have setresuid that isn't implemented, test for this
929 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000930 AC_RUN_IFELSE(
931 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100932#include <stdlib.h>
933#include <errno.h>
934int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000935 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100936 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100937 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000938 AC_MSG_RESULT(not implemented)],
939 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100940 )
941])
Darren Tuckere937be32003-12-17 18:53:26 +1100942
Darren Tucker2a6b0292003-12-31 14:59:17 +1100943AC_CHECK_FUNCS(setresgid, [
944 dnl Some platorms have setresgid that isn't implemented, test for this
945 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000946 AC_RUN_IFELSE(
947 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100948#include <stdlib.h>
949#include <errno.h>
950int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000951 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100952 [AC_MSG_RESULT(yes)],
953 [AC_DEFINE(BROKEN_SETRESGID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000954 AC_MSG_RESULT(not implemented)],
955 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100956 )
957])
Darren Tuckere937be32003-12-17 18:53:26 +1100958
Damien Millerad833b32000-08-23 10:46:23 +1000959dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000960AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000961dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000962AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000963AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000964dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000965AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000966AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100967
Damien Millera8e06ce2003-11-21 23:48:55 +1100968AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100969 [AC_DEFINE(HAVE_DAEMON)],
970 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
971)
972
Damien Millera8e06ce2003-11-21 23:48:55 +1100973AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100974 [AC_DEFINE(HAVE_GETPAGESIZE)],
975 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
976)
977
Damien Millercb170cb2000-07-01 16:52:55 +1000978# Check for broken snprintf
979if test "x$ac_cv_func_snprintf" = "xyes" ; then
980 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000981 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000982 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +1000983#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700984int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +1000985 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100986 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000987 [
988 AC_MSG_RESULT(no)
989 AC_DEFINE(BROKEN_SNPRINTF)
990 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000991 ],
992 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +1000993 )
994fi
995
Damien Millerb4097182004-05-23 14:09:40 +1000996# Check for missing getpeereid (or equiv) support
997NO_PEERCHECK=""
998if test "x$ac_cv_func_getpeereid" != "xyes" ; then
999 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1000 AC_TRY_COMPILE(
1001 [#include <sys/types.h>
1002 #include <sys/socket.h>],
1003 [int i = SO_PEERCRED;],
1004 [AC_MSG_RESULT(yes)],
1005 [AC_MSG_RESULT(no)
1006 NO_PEERCHECK=1]
1007 )
1008fi
1009
Damien Millere8328192003-01-07 15:18:32 +11001010dnl see whether mkstemp() requires XXXXXX
1011if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1012AC_MSG_CHECKING([for (overly) strict mkstemp])
1013AC_TRY_RUN(
1014 [
1015#include <stdlib.h>
1016main() { char template[]="conftest.mkstemp-test";
1017if (mkstemp(template) == -1)
1018 exit(1);
1019unlink(template); exit(0);
1020}
1021 ],
1022 [
1023 AC_MSG_RESULT(no)
1024 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001025 [
Damien Millere8328192003-01-07 15:18:32 +11001026 AC_MSG_RESULT(yes)
1027 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1028 ],
1029 [
1030 AC_MSG_RESULT(yes)
1031 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001032 ]
Damien Millere8328192003-01-07 15:18:32 +11001033)
1034fi
1035
Darren Tucker70a3d552003-08-21 17:58:29 +10001036dnl make sure that openpty does not reacquire controlling terminal
1037if test ! -z "$check_for_openpty_ctty_bug"; then
1038 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1039 AC_TRY_RUN(
1040 [
1041#include <stdio.h>
1042#include <sys/fcntl.h>
1043#include <sys/types.h>
1044#include <sys/wait.h>
1045
1046int
1047main()
1048{
1049 pid_t pid;
1050 int fd, ptyfd, ttyfd, status;
1051
1052 pid = fork();
1053 if (pid < 0) { /* failed */
1054 exit(1);
1055 } else if (pid > 0) { /* parent */
1056 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001057 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001058 exit(WEXITSTATUS(status));
1059 else
1060 exit(2);
1061 } else { /* child */
1062 close(0); close(1); close(2);
1063 setsid();
1064 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1065 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1066 if (fd >= 0)
1067 exit(3); /* Acquired ctty: broken */
1068 else
1069 exit(0); /* Did not acquire ctty: OK */
1070 }
1071}
1072 ],
1073 [
1074 AC_MSG_RESULT(yes)
1075 ],
1076 [
1077 AC_MSG_RESULT(no)
1078 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1079 ]
1080 )
1081fi
1082
Darren Tucker4398cf52004-04-06 21:39:02 +10001083if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1084 AC_MSG_CHECKING(if getaddrinfo seems to work)
1085 AC_TRY_RUN(
1086 [
1087#include <stdio.h>
1088#include <sys/socket.h>
1089#include <netdb.h>
1090#include <errno.h>
1091#include <netinet/in.h>
1092
1093#define TEST_PORT "2222"
1094
1095int
1096main(void)
1097{
1098 int err, sock;
1099 struct addrinfo *gai_ai, *ai, hints;
1100 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1101
1102 memset(&hints, 0, sizeof(hints));
1103 hints.ai_family = PF_UNSPEC;
1104 hints.ai_socktype = SOCK_STREAM;
1105 hints.ai_flags = AI_PASSIVE;
1106
1107 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1108 if (err != 0) {
1109 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1110 exit(1);
1111 }
1112
1113 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1114 if (ai->ai_family != AF_INET6)
1115 continue;
1116
1117 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1118 sizeof(ntop), strport, sizeof(strport),
1119 NI_NUMERICHOST|NI_NUMERICSERV);
1120
1121 if (err != 0) {
1122 if (err == EAI_SYSTEM)
1123 perror("getnameinfo EAI_SYSTEM");
1124 else
1125 fprintf(stderr, "getnameinfo failed: %s\n",
1126 gai_strerror(err));
1127 exit(2);
1128 }
1129
1130 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1131 if (sock < 0)
1132 perror("socket");
1133 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1134 if (errno == EBADF)
1135 exit(3);
1136 }
1137 }
1138 exit(0);
1139}
1140 ],
1141 [
1142 AC_MSG_RESULT(yes)
1143 ],
1144 [
1145 AC_MSG_RESULT(no)
1146 AC_DEFINE(BROKEN_GETADDRINFO)
1147 ]
1148 )
1149fi
1150
Darren Tucker691d5232005-02-15 21:45:57 +11001151if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1152 AC_MSG_CHECKING(if getaddrinfo seems to work)
1153 AC_TRY_RUN(
1154 [
1155#include <stdio.h>
1156#include <sys/socket.h>
1157#include <netdb.h>
1158#include <errno.h>
1159#include <netinet/in.h>
1160
1161#define TEST_PORT "2222"
1162
1163int
1164main(void)
1165{
1166 int err, sock;
1167 struct addrinfo *gai_ai, *ai, hints;
1168 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1169
1170 memset(&hints, 0, sizeof(hints));
1171 hints.ai_family = PF_UNSPEC;
1172 hints.ai_socktype = SOCK_STREAM;
1173 hints.ai_flags = AI_PASSIVE;
1174
1175 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1176 if (err != 0) {
1177 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1178 exit(1);
1179 }
1180
1181 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1182 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1183 continue;
1184
1185 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1186 sizeof(ntop), strport, sizeof(strport),
1187 NI_NUMERICHOST|NI_NUMERICSERV);
1188
1189 if (ai->ai_family == AF_INET && err != 0) {
1190 perror("getnameinfo");
1191 exit(2);
1192 }
1193 }
1194 exit(0);
1195}
1196 ],
1197 [
1198 AC_MSG_RESULT(yes)
1199 AC_DEFINE(AIX_GETNAMEINFO_HACK, [],
1200[Define if you have a getaddrinfo that fails for the all-zeros IPv6 address])
1201 ],
1202 [
1203 AC_MSG_RESULT(no)
1204 AC_DEFINE(BROKEN_GETADDRINFO)
1205 ]
1206 )
1207fi
1208
Darren Tuckera56f1912004-11-02 20:30:54 +11001209if test "x$check_for_conflicting_getspnam" = "x1"; then
1210 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1211 AC_COMPILE_IFELSE(
1212 [
1213#include <shadow.h>
1214int main(void) {exit(0);}
1215 ],
1216 [
1217 AC_MSG_RESULT(no)
1218 ],
1219 [
1220 AC_MSG_RESULT(yes)
1221 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1222 [Conflicting defs for getspnam])
1223 ]
1224 )
1225fi
1226
Damien Miller606f8802000-09-16 15:39:56 +11001227AC_FUNC_GETPGRP
1228
Damien Millera64b57a2001-01-17 10:44:13 +11001229# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001230PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001231AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001232 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001233 [
Damien Millera64b57a2001-01-17 10:44:13 +11001234 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001235 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1236 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001237 AC_MSG_ERROR([PAM headers not found])
1238 fi
1239
1240 AC_CHECK_LIB(dl, dlopen, , )
1241 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1242 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001243 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001244
Damien Millera64b57a2001-01-17 10:44:13 +11001245 PAM_MSG="yes"
1246
1247 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001248 if test $ac_cv_lib_dl_dlopen = yes; then
1249 LIBPAM="-lpam -ldl"
1250 else
1251 LIBPAM="-lpam"
1252 fi
1253 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001254 fi
1255 ]
1256)
Damien Millera22ba012000-03-02 23:09:20 +11001257
Damien Millera64b57a2001-01-17 10:44:13 +11001258# Check for older PAM
1259if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001260 # Check PAM strerror arguments (old PAM)
1261 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1262 AC_TRY_COMPILE(
1263 [
Damien Miller81171112000-04-23 11:14:01 +10001264#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001265#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001266#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001267#elif defined (HAVE_PAM_PAM_APPL_H)
1268#include <pam/pam_appl.h>
1269#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001270 ],
1271 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001272 [AC_MSG_RESULT(no)],
1273 [
1274 AC_DEFINE(HAVE_OLD_PAM)
1275 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001276 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001277 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001278 )
Damien Millera22ba012000-03-02 23:09:20 +11001279fi
1280
Tim Riceaef73712002-05-11 13:17:42 -07001281# Search for OpenSSL
1282saved_CPPFLAGS="$CPPFLAGS"
1283saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001284AC_ARG_WITH(ssl-dir,
1285 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1286 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001287 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001288 case "$withval" in
1289 # Relative paths
1290 ./*|../*) withval="`pwd`/$withval"
1291 esac
Tim Riceaef73712002-05-11 13:17:42 -07001292 if test -d "$withval/lib"; then
1293 if test -n "${need_dash_r}"; then
1294 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1295 else
1296 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1297 fi
1298 else
1299 if test -n "${need_dash_r}"; then
1300 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1301 else
1302 LDFLAGS="-L${withval} ${LDFLAGS}"
1303 fi
1304 fi
1305 if test -d "$withval/include"; then
1306 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1307 else
1308 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1309 fi
Damien Millera22ba012000-03-02 23:09:20 +11001310 fi
1311 ]
1312)
Tim Rice3d5352e2004-02-12 09:27:21 -08001313LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001314AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001315 [
Tim Riceaef73712002-05-11 13:17:42 -07001316 dnl Check default openssl install dir
1317 if test -n "${need_dash_r}"; then
1318 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001319 else
Tim Riceaef73712002-05-11 13:17:42 -07001320 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001321 fi
Tim Riceaef73712002-05-11 13:17:42 -07001322 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1323 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1324 [
1325 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1326 ]
1327 )
1328 ]
1329)
1330
Tim Riced730b782002-08-13 18:52:10 -07001331# Determine OpenSSL header version
1332AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001333AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001334 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001335#include <stdio.h>
1336#include <string.h>
1337#include <openssl/opensslv.h>
1338#define DATA "conftest.sslincver"
1339int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001340 FILE *fd;
1341 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001342
Damien Millera8e06ce2003-11-21 23:48:55 +11001343 fd = fopen(DATA,"w");
1344 if(fd == NULL)
1345 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001346
1347 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1348 exit(1);
1349
1350 exit(0);
1351}
Darren Tucker623d92f2004-09-12 22:36:15 +10001352 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001353 [
1354 ssl_header_ver=`cat conftest.sslincver`
1355 AC_MSG_RESULT($ssl_header_ver)
1356 ],
1357 [
1358 AC_MSG_RESULT(not found)
1359 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001360 ],
1361 [
1362 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001363 ]
1364)
1365
1366# Determine OpenSSL library version
1367AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001368AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001369 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001370#include <stdio.h>
1371#include <string.h>
1372#include <openssl/opensslv.h>
1373#include <openssl/crypto.h>
1374#define DATA "conftest.ssllibver"
1375int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001376 FILE *fd;
1377 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001378
Damien Millera8e06ce2003-11-21 23:48:55 +11001379 fd = fopen(DATA,"w");
1380 if(fd == NULL)
1381 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001382
1383 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1384 exit(1);
1385
1386 exit(0);
1387}
Darren Tucker623d92f2004-09-12 22:36:15 +10001388 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001389 [
1390 ssl_library_ver=`cat conftest.ssllibver`
1391 AC_MSG_RESULT($ssl_library_ver)
1392 ],
1393 [
1394 AC_MSG_RESULT(not found)
1395 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001396 ],
1397 [
1398 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001399 ]
1400)
Damien Millera22ba012000-03-02 23:09:20 +11001401
Damien Millerec932372002-01-22 22:16:03 +11001402# Sanity check OpenSSL headers
1403AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001404AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001405 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001406#include <string.h>
1407#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001408int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001409 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001410 [
1411 AC_MSG_RESULT(yes)
1412 ],
1413 [
1414 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001415 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1416Check config.log for details.
1417Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001418 ],
1419 [
1420 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001421 ]
1422)
1423
Tim Rice3d5352e2004-02-12 09:27:21 -08001424# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1425# because the system crypt() is more featureful.
1426if test "x$check_for_libcrypt_before" = "x1"; then
1427 AC_CHECK_LIB(crypt, crypt)
1428fi
1429
Damien Millera8e06ce2003-11-21 23:48:55 +11001430# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001431# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001432if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001433 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001434fi
1435
Damien Miller6c21c512002-01-22 21:57:53 +11001436
1437### Configure cryptographic random number support
1438
1439# Check wheter OpenSSL seeds itself
1440AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001441AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001442 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001443#include <string.h>
1444#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001445int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001446 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001447 [
1448 OPENSSL_SEEDS_ITSELF=yes
1449 AC_MSG_RESULT(yes)
1450 ],
1451 [
1452 AC_MSG_RESULT(no)
1453 # Default to use of the rand helper if OpenSSL doesn't
1454 # seed itself
1455 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001456 ],
1457 [
1458 AC_MSG_WARN([cross compiling: assuming yes])
1459 # This is safe, since all recent OpenSSL versions will
1460 # complain at runtime if not seeded correctly.
1461 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001462 ]
1463)
1464
1465
1466# Do we want to force the use of the rand helper?
1467AC_ARG_WITH(rand-helper,
1468 [ --with-rand-helper Use subprocess to gather strong randomness ],
1469 [
1470 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001471 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001472 # the previous test showed it to be unseeded.
1473 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1474 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1475 OPENSSL_SEEDS_ITSELF=yes
1476 USE_RAND_HELPER=""
1477 fi
1478 else
1479 USE_RAND_HELPER=yes
1480 fi
1481 ],
1482)
1483
1484# Which randomness source do we use?
1485if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1486 # OpenSSL only
1487 AC_DEFINE(OPENSSL_PRNG_ONLY)
1488 RAND_MSG="OpenSSL internal ONLY"
1489 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001490elif test ! -z "$USE_RAND_HELPER" ; then
1491 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001492 RAND_MSG="ssh-rand-helper"
1493 INSTALL_SSH_RAND_HELPER="yes"
1494fi
1495AC_SUBST(INSTALL_SSH_RAND_HELPER)
1496
1497### Configuration of ssh-rand-helper
1498
1499# PRNGD TCP socket
1500AC_ARG_WITH(prngd-port,
1501 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1502 [
Damien Millere996d722002-01-23 11:20:59 +11001503 case "$withval" in
1504 no)
1505 withval=""
1506 ;;
1507 [[0-9]]*)
1508 ;;
1509 *)
1510 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1511 ;;
1512 esac
1513 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001514 PRNGD_PORT="$withval"
1515 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1516 fi
1517 ]
1518)
1519
1520# PRNGD Unix domain socket
1521AC_ARG_WITH(prngd-socket,
1522 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1523 [
Damien Millere996d722002-01-23 11:20:59 +11001524 case "$withval" in
1525 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001526 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001527 ;;
1528 no)
1529 withval=""
1530 ;;
1531 /*)
1532 ;;
1533 *)
1534 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1535 ;;
1536 esac
1537
1538 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001539 if test ! -z "$PRNGD_PORT" ; then
1540 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1541 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001542 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001543 AC_MSG_WARN(Entropy socket is not readable)
1544 fi
1545 PRNGD_SOCKET="$withval"
1546 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1547 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001548 ],
1549 [
1550 # Check for existing socket only if we don't have a random device already
1551 if test "$USE_RAND_HELPER" = yes ; then
1552 AC_MSG_CHECKING(for PRNGD/EGD socket)
1553 # Insert other locations here
1554 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1555 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1556 PRNGD_SOCKET="$sock"
1557 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1558 break;
1559 fi
1560 done
1561 if test ! -z "$PRNGD_SOCKET" ; then
1562 AC_MSG_RESULT($PRNGD_SOCKET)
1563 else
1564 AC_MSG_RESULT(not found)
1565 fi
1566 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001567 ]
1568)
1569
1570# Change default command timeout for hashing entropy source
1571entropy_timeout=200
1572AC_ARG_WITH(entropy-timeout,
1573 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1574 [
1575 if test "x$withval" != "xno" ; then
1576 entropy_timeout=$withval
1577 fi
1578 ]
1579)
Damien Miller6c21c512002-01-22 21:57:53 +11001580AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1581
Damien Millerd3f6ad22002-06-25 10:24:47 +10001582SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001583AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001584 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001585 [
1586 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001587 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001588 fi
1589 ]
1590)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001591AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1592AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001593
Tim Rice88f2ab52002-03-17 12:17:34 -08001594# We do this little dance with the search path to insure
1595# that programs that we select for use by installed programs
1596# (which may be run by the super-user) come from trusted
1597# locations before they come from the user's private area.
1598# This should help avoid accidentally configuring some
1599# random version of a program in someone's personal bin.
1600
1601OPATH=$PATH
1602PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001603test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001604test -d /sbin && PATH=$PATH:/sbin
1605test -d /usr/sbin && PATH=$PATH:/usr/sbin
1606PATH=$PATH:/etc:$OPATH
1607
Damien Millera8e06ce2003-11-21 23:48:55 +11001608# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001609OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1610OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1611OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1612OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1613OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1614OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1615OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1616OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1617OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1618OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1619OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1620OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1621OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1622OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1623OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1624OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001625# restore PATH
1626PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001627
1628# Where does ssh-rand-helper get its randomness from?
1629INSTALL_SSH_PRNG_CMDS=""
1630if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1631 if test ! -z "$PRNGD_PORT" ; then
1632 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1633 elif test ! -z "$PRNGD_SOCKET" ; then
1634 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1635 else
1636 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1637 RAND_HELPER_CMDHASH=yes
1638 INSTALL_SSH_PRNG_CMDS="yes"
1639 fi
1640fi
1641AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1642
1643
Ben Lindstromb5628642000-10-18 00:02:25 +00001644# Cheap hack to ensure NEWS-OS libraries are arranged right.
1645if test ! -z "$SONY" ; then
1646 LIBS="$LIBS -liberty";
1647fi
1648
Damien Millera22ba012000-03-02 23:09:20 +11001649# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001650AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001651AC_CHECK_SIZEOF(short int, 2)
1652AC_CHECK_SIZEOF(int, 4)
1653AC_CHECK_SIZEOF(long int, 4)
1654AC_CHECK_SIZEOF(long long int, 8)
1655
Damien Millerfa2bb692002-04-23 23:22:25 +10001656# Sanity check long long for some platforms (AIX)
1657if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1658 ac_cv_sizeof_long_long_int=0
1659fi
1660
Damien Millera22ba012000-03-02 23:09:20 +11001661# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001662AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1663 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001664 [ #include <sys/types.h> ],
1665 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001666 [ ac_cv_have_u_int="yes" ],
1667 [ ac_cv_have_u_int="no" ]
1668 )
1669])
1670if test "x$ac_cv_have_u_int" = "xyes" ; then
1671 AC_DEFINE(HAVE_U_INT)
1672 have_u_int=1
1673fi
1674
Damien Miller61e50f12000-05-08 20:49:37 +10001675AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1676 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001677 [ #include <sys/types.h> ],
1678 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001679 [ ac_cv_have_intxx_t="yes" ],
1680 [ ac_cv_have_intxx_t="no" ]
1681 )
1682])
1683if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1684 AC_DEFINE(HAVE_INTXX_T)
1685 have_intxx_t=1
1686fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001687
1688if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001689 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001690then
1691 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1692 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001693 [ #include <stdint.h> ],
1694 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001695 [
1696 AC_DEFINE(HAVE_INTXX_T)
1697 AC_MSG_RESULT(yes)
1698 ],
1699 [ AC_MSG_RESULT(no) ]
1700 )
1701fi
1702
Damien Miller578783e2000-09-23 14:12:24 +11001703AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1704 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001705 [
1706#include <sys/types.h>
1707#ifdef HAVE_STDINT_H
1708# include <stdint.h>
1709#endif
1710#include <sys/socket.h>
1711#ifdef HAVE_SYS_BITYPES_H
1712# include <sys/bitypes.h>
1713#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001714 ],
1715 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001716 [ ac_cv_have_int64_t="yes" ],
1717 [ ac_cv_have_int64_t="no" ]
1718 )
1719])
1720if test "x$ac_cv_have_int64_t" = "xyes" ; then
1721 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001722fi
1723
Damien Miller61e50f12000-05-08 20:49:37 +10001724AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1725 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001726 [ #include <sys/types.h> ],
1727 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001728 [ ac_cv_have_u_intxx_t="yes" ],
1729 [ ac_cv_have_u_intxx_t="no" ]
1730 )
1731])
1732if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1733 AC_DEFINE(HAVE_U_INTXX_T)
1734 have_u_intxx_t=1
1735fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001736
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001737if test -z "$have_u_intxx_t" ; then
1738 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1739 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001740 [ #include <sys/socket.h> ],
1741 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001742 [
1743 AC_DEFINE(HAVE_U_INTXX_T)
1744 AC_MSG_RESULT(yes)
1745 ],
1746 [ AC_MSG_RESULT(no) ]
1747 )
1748fi
1749
Damien Miller578783e2000-09-23 14:12:24 +11001750AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1751 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001752 [ #include <sys/types.h> ],
1753 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001754 [ ac_cv_have_u_int64_t="yes" ],
1755 [ ac_cv_have_u_int64_t="no" ]
1756 )
1757])
1758if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1759 AC_DEFINE(HAVE_U_INT64_T)
1760 have_u_int64_t=1
1761fi
1762
Tim Rice4cec93f2002-02-26 08:40:48 -08001763if test -z "$have_u_int64_t" ; then
1764 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1765 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001766 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001767 [ u_int64_t a; a = 1],
1768 [
1769 AC_DEFINE(HAVE_U_INT64_T)
1770 AC_MSG_RESULT(yes)
1771 ],
1772 [ AC_MSG_RESULT(no) ]
1773 )
1774fi
1775
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001776if test -z "$have_u_intxx_t" ; then
1777 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1778 AC_TRY_COMPILE(
1779 [
1780#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001781 ],
1782 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001783 [ ac_cv_have_uintxx_t="yes" ],
1784 [ ac_cv_have_uintxx_t="no" ]
1785 )
1786 ])
1787 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1788 AC_DEFINE(HAVE_UINTXX_T)
1789 fi
1790fi
1791
1792if test -z "$have_uintxx_t" ; then
1793 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1794 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001795 [ #include <stdint.h> ],
1796 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001797 [
1798 AC_DEFINE(HAVE_UINTXX_T)
1799 AC_MSG_RESULT(yes)
1800 ],
1801 [ AC_MSG_RESULT(no) ]
1802 )
1803fi
1804
Damien Milleredb82922000-06-20 13:25:52 +10001805if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001806 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001807then
1808 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1809 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001810 [
1811#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001812 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001813 [
Damien Miller70494d12000-04-03 15:57:06 +10001814 int8_t a; int16_t b; int32_t c;
1815 u_int8_t e; u_int16_t f; u_int32_t g;
1816 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001817 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001818 [
1819 AC_DEFINE(HAVE_U_INTXX_T)
1820 AC_DEFINE(HAVE_INTXX_T)
1821 AC_MSG_RESULT(yes)
1822 ],
1823 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001824 )
Damien Millerb29ea912000-01-15 14:12:03 +11001825fi
1826
Damien Miller58be7382001-09-15 21:31:54 +10001827
1828AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1829 AC_TRY_COMPILE(
1830 [
1831#include <sys/types.h>
1832 ],
1833 [ u_char foo; foo = 125; ],
1834 [ ac_cv_have_u_char="yes" ],
1835 [ ac_cv_have_u_char="no" ]
1836 )
1837])
1838if test "x$ac_cv_have_u_char" = "xyes" ; then
1839 AC_DEFINE(HAVE_U_CHAR)
1840fi
1841
Tim Rice13aae5e2001-10-21 17:53:58 -07001842TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001843
Tim Rice200a5c02002-02-26 22:12:34 -08001844AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001845
Damien Miller61e50f12000-05-08 20:49:37 +10001846AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1847 AC_TRY_COMPILE(
1848 [
1849#include <sys/types.h>
1850 ],
1851 [ size_t foo; foo = 1235; ],
1852 [ ac_cv_have_size_t="yes" ],
1853 [ ac_cv_have_size_t="no" ]
1854 )
1855])
1856if test "x$ac_cv_have_size_t" = "xyes" ; then
1857 AC_DEFINE(HAVE_SIZE_T)
1858fi
Damien Miller95058511999-12-29 10:36:45 +11001859
Damien Miller615f9392000-05-17 22:53:33 +10001860AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1861 AC_TRY_COMPILE(
1862 [
1863#include <sys/types.h>
1864 ],
1865 [ ssize_t foo; foo = 1235; ],
1866 [ ac_cv_have_ssize_t="yes" ],
1867 [ ac_cv_have_ssize_t="no" ]
1868 )
1869])
1870if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1871 AC_DEFINE(HAVE_SSIZE_T)
1872fi
1873
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001874AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1875 AC_TRY_COMPILE(
1876 [
1877#include <time.h>
1878 ],
1879 [ clock_t foo; foo = 1235; ],
1880 [ ac_cv_have_clock_t="yes" ],
1881 [ ac_cv_have_clock_t="no" ]
1882 )
1883])
1884if test "x$ac_cv_have_clock_t" = "xyes" ; then
1885 AC_DEFINE(HAVE_CLOCK_T)
1886fi
1887
Damien Millerb54b40e2000-06-23 08:23:34 +10001888AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1889 AC_TRY_COMPILE(
1890 [
1891#include <sys/types.h>
1892#include <sys/socket.h>
1893 ],
1894 [ sa_family_t foo; foo = 1235; ],
1895 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001896 [ AC_TRY_COMPILE(
1897 [
1898#include <sys/types.h>
1899#include <sys/socket.h>
1900#include <netinet/in.h>
1901 ],
1902 [ sa_family_t foo; foo = 1235; ],
1903 [ ac_cv_have_sa_family_t="yes" ],
1904
Damien Millerb54b40e2000-06-23 08:23:34 +10001905 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001906 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001907 )
1908])
1909if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1910 AC_DEFINE(HAVE_SA_FAMILY_T)
1911fi
1912
Damien Miller0f91b4e2000-06-18 15:43:25 +10001913AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1914 AC_TRY_COMPILE(
1915 [
1916#include <sys/types.h>
1917 ],
1918 [ pid_t foo; foo = 1235; ],
1919 [ ac_cv_have_pid_t="yes" ],
1920 [ ac_cv_have_pid_t="no" ]
1921 )
1922])
1923if test "x$ac_cv_have_pid_t" = "xyes" ; then
1924 AC_DEFINE(HAVE_PID_T)
1925fi
1926
1927AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1928 AC_TRY_COMPILE(
1929 [
1930#include <sys/types.h>
1931 ],
1932 [ mode_t foo; foo = 1235; ],
1933 [ ac_cv_have_mode_t="yes" ],
1934 [ ac_cv_have_mode_t="no" ]
1935 )
1936])
1937if test "x$ac_cv_have_mode_t" = "xyes" ; then
1938 AC_DEFINE(HAVE_MODE_T)
1939fi
1940
Damien Miller61e50f12000-05-08 20:49:37 +10001941
1942AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1943 AC_TRY_COMPILE(
1944 [
Damien Miller81171112000-04-23 11:14:01 +10001945#include <sys/types.h>
1946#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001947 ],
1948 [ struct sockaddr_storage s; ],
1949 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1950 [ ac_cv_have_struct_sockaddr_storage="no" ]
1951 )
1952])
1953if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1954 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1955fi
Damien Miller34132e52000-01-14 15:45:46 +11001956
Damien Miller61e50f12000-05-08 20:49:37 +10001957AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1958 AC_TRY_COMPILE(
1959 [
Damien Miller7b22d652000-06-18 14:07:04 +10001960#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001961#include <netinet/in.h>
1962 ],
1963 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1964 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1965 [ ac_cv_have_struct_sockaddr_in6="no" ]
1966 )
1967])
1968if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1969 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1970fi
Damien Miller34132e52000-01-14 15:45:46 +11001971
Damien Miller61e50f12000-05-08 20:49:37 +10001972AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1973 AC_TRY_COMPILE(
1974 [
Damien Miller7b22d652000-06-18 14:07:04 +10001975#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001976#include <netinet/in.h>
1977 ],
1978 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1979 [ ac_cv_have_struct_in6_addr="yes" ],
1980 [ ac_cv_have_struct_in6_addr="no" ]
1981 )
1982])
1983if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1984 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1985fi
Damien Miller34132e52000-01-14 15:45:46 +11001986
Damien Miller61e50f12000-05-08 20:49:37 +10001987AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1988 AC_TRY_COMPILE(
1989 [
Damien Miller81171112000-04-23 11:14:01 +10001990#include <sys/types.h>
1991#include <sys/socket.h>
1992#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001993 ],
1994 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1995 [ ac_cv_have_struct_addrinfo="yes" ],
1996 [ ac_cv_have_struct_addrinfo="no" ]
1997 )
1998])
1999if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
2000 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
2001fi
2002
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002003AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2004 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002005 [ #include <sys/time.h> ],
2006 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002007 [ ac_cv_have_struct_timeval="yes" ],
2008 [ ac_cv_have_struct_timeval="no" ]
2009 )
2010])
2011if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
2012 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
2013 have_struct_timeval=1
2014fi
2015
Tim Rice4e4dc562003-03-18 10:21:40 -08002016AC_CHECK_TYPES(struct timespec)
2017
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002018# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002019if test "x$ac_cv_have_int64_t" = "xno" -a \
2020 "x$ac_cv_sizeof_long_int" != "x8" -a \
2021 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002022 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2023 echo "an alternative compiler (I.E., GCC) before continuing."
2024 echo ""
2025 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08002026else
2027dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10002028 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10002029 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08002030#include <stdio.h>
2031#include <string.h>
2032#ifdef HAVE_SNPRINTF
2033main()
2034{
2035 char buf[50];
2036 char expected_out[50];
2037 int mazsize = 50 ;
2038#if (SIZEOF_LONG_INT == 8)
2039 long int num = 0x7fffffffffffffff;
2040#else
Kevin Steves6482ec82001-07-15 02:09:28 +00002041 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08002042#endif
2043 strcpy(expected_out, "9223372036854775807");
2044 snprintf(buf, mazsize, "%lld", num);
2045 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11002046 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08002047 exit(0);
2048}
2049#else
2050main() { exit(0); }
2051#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10002052 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10002053 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08002054 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002055fi
2056
Damien Miller78315eb2000-09-29 23:01:36 +11002057dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10002058OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2059OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2060OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2061OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2062OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002063OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002064OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2065OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002066OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002067OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2068OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2069OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2070OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002071OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2072OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2073OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2074OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002075
2076AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00002077
Damien Miller61e50f12000-05-08 20:49:37 +10002078AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2079 ac_cv_have_ss_family_in_struct_ss, [
2080 AC_TRY_COMPILE(
2081 [
Damien Miller81171112000-04-23 11:14:01 +10002082#include <sys/types.h>
2083#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002084 ],
2085 [ struct sockaddr_storage s; s.ss_family = 1; ],
2086 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2087 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2088 )
2089])
2090if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2091 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
2092fi
2093
Damien Miller61e50f12000-05-08 20:49:37 +10002094AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2095 ac_cv_have___ss_family_in_struct_ss, [
2096 AC_TRY_COMPILE(
2097 [
Damien Miller81171112000-04-23 11:14:01 +10002098#include <sys/types.h>
2099#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002100 ],
2101 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2102 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2103 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2104 )
2105])
2106if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2107 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
2108fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002109
Damien Millerad833b32000-08-23 10:46:23 +10002110AC_CACHE_CHECK([for pw_class field in struct passwd],
2111 ac_cv_have_pw_class_in_struct_passwd, [
2112 AC_TRY_COMPILE(
2113 [
Damien Millerad833b32000-08-23 10:46:23 +10002114#include <pwd.h>
2115 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002116 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002117 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2118 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2119 )
2120])
2121if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2122 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
2123fi
2124
Kevin Steves82456952001-06-22 21:14:18 +00002125AC_CACHE_CHECK([for pw_expire field in struct passwd],
2126 ac_cv_have_pw_expire_in_struct_passwd, [
2127 AC_TRY_COMPILE(
2128 [
2129#include <pwd.h>
2130 ],
2131 [ struct passwd p; p.pw_expire = 0; ],
2132 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2133 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2134 )
2135])
2136if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2137 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
2138fi
2139
2140AC_CACHE_CHECK([for pw_change field in struct passwd],
2141 ac_cv_have_pw_change_in_struct_passwd, [
2142 AC_TRY_COMPILE(
2143 [
2144#include <pwd.h>
2145 ],
2146 [ struct passwd p; p.pw_change = 0; ],
2147 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2148 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2149 )
2150])
2151if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2152 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
2153fi
Damien Miller61e50f12000-05-08 20:49:37 +10002154
Tim Rice28bbb0c2002-05-27 17:37:32 -07002155dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002156AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2157 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002158 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002159 [
Tim Riceae49fe62002-04-12 10:26:21 -07002160#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002161#include <sys/socket.h>
2162#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002163int main() {
2164#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002165#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002166exit(1);
2167#endif
2168struct msghdr m;
2169m.msg_accrights = 0;
2170exit(0);
2171}
Kevin Steves939c9db2002-03-22 17:23:25 +00002172 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002173 [ ac_cv_have_accrights_in_msghdr="yes" ],
2174 [ ac_cv_have_accrights_in_msghdr="no" ]
2175 )
2176])
2177if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2178 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2179fi
2180
Kevin Stevesa44e0352002-04-07 16:18:03 +00002181AC_CACHE_CHECK([for msg_control field in struct msghdr],
2182 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002183 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002184 [
Tim Riceae49fe62002-04-12 10:26:21 -07002185#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002186#include <sys/socket.h>
2187#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002188int main() {
2189#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002190#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002191exit(1);
2192#endif
2193struct msghdr m;
2194m.msg_control = 0;
2195exit(0);
2196}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002197 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002198 [ ac_cv_have_control_in_msghdr="yes" ],
2199 [ ac_cv_have_control_in_msghdr="no" ]
2200 )
2201])
2202if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2203 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2204fi
2205
Damien Miller61e50f12000-05-08 20:49:37 +10002206AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002207 AC_TRY_LINK([],
2208 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002209 [ ac_cv_libc_defines___progname="yes" ],
2210 [ ac_cv_libc_defines___progname="no" ]
2211 )
2212])
2213if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2214 AC_DEFINE(HAVE___PROGNAME)
2215fi
2216
Kevin Steves4846f4a2002-03-22 18:19:53 +00002217AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2218 AC_TRY_LINK([
2219#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002220],
2221 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002222 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2223 [ ac_cv_cc_implements___FUNCTION__="no" ]
2224 )
2225])
2226if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2227 AC_DEFINE(HAVE___FUNCTION__)
2228fi
2229
2230AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2231 AC_TRY_LINK([
2232#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002233],
2234 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002235 [ ac_cv_cc_implements___func__="yes" ],
2236 [ ac_cv_cc_implements___func__="no" ]
2237 )
2238])
2239if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2240 AC_DEFINE(HAVE___func__)
2241fi
2242
Damien Miller4f8e6692001-07-14 13:22:53 +10002243AC_CACHE_CHECK([whether getopt has optreset support],
2244 ac_cv_have_getopt_optreset, [
2245 AC_TRY_LINK(
2246 [
2247#include <getopt.h>
2248 ],
2249 [ extern int optreset; optreset = 0; ],
2250 [ ac_cv_have_getopt_optreset="yes" ],
2251 [ ac_cv_have_getopt_optreset="no" ]
2252 )
2253])
2254if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2255 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2256fi
Damien Millera22ba012000-03-02 23:09:20 +11002257
Damien Millerecbb26d2000-07-15 14:59:14 +10002258AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002259 AC_TRY_LINK([],
2260 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002261 [ ac_cv_libc_defines_sys_errlist="yes" ],
2262 [ ac_cv_libc_defines_sys_errlist="no" ]
2263 )
2264])
2265if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2266 AC_DEFINE(HAVE_SYS_ERRLIST)
2267fi
2268
2269
Damien Miller11fa2cc2000-08-16 10:35:58 +10002270AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002271 AC_TRY_LINK([],
2272 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002273 [ ac_cv_libc_defines_sys_nerr="yes" ],
2274 [ ac_cv_libc_defines_sys_nerr="no" ]
2275 )
2276])
2277if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2278 AC_DEFINE(HAVE_SYS_NERR)
2279fi
2280
Damien Millera8e06ce2003-11-21 23:48:55 +11002281SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002282# Check whether user wants sectok support
2283AC_ARG_WITH(sectok,
2284 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002285 [
2286 if test "x$withval" != "xno" ; then
2287 if test "x$withval" != "xyes" ; then
2288 CPPFLAGS="$CPPFLAGS -I${withval}"
2289 LDFLAGS="$LDFLAGS -L${withval}"
2290 if test ! -z "$need_dash_r" ; then
2291 LDFLAGS="$LDFLAGS -R${withval}"
2292 fi
2293 if test ! -z "$blibpath" ; then
2294 blibpath="$blibpath:${withval}"
2295 fi
2296 fi
2297 AC_CHECK_HEADERS(sectok.h)
2298 if test "$ac_cv_header_sectok_h" != yes; then
2299 AC_MSG_ERROR(Can't find sectok.h)
2300 fi
2301 AC_CHECK_LIB(sectok, sectok_open)
2302 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2303 AC_MSG_ERROR(Can't find libsectok)
2304 fi
2305 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002306 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002307 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002308 fi
2309 ]
2310)
2311
2312# Check whether user wants OpenSC support
2313AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002314 AC_HELP_STRING([--with-opensc=PFX],
2315 [Enable smartcard support using OpenSC]),
2316 opensc_config_prefix="$withval", opensc_config_prefix="")
2317if test x$opensc_config_prefix != x ; then
2318 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2319 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2320 if test "$OPENSC_CONFIG" != "no"; then
2321 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2322 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2323 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2324 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2325 AC_DEFINE(SMARTCARD)
2326 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002327 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002328 fi
2329fi
Damien Miller85de5802001-09-18 14:01:11 +10002330
Darren Tucker5f88d342003-10-15 16:57:57 +10002331# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002332AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002333 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002334 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002335 # Needed by our getrrsetbyname()
2336 AC_SEARCH_LIBS(res_query, resolv)
2337 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002338 AC_MSG_CHECKING(if res_query will link)
2339 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2340 [AC_MSG_RESULT(no)
2341 saved_LIBS="$LIBS"
2342 LIBS="$LIBS -lresolv"
2343 AC_MSG_CHECKING(for res_query in -lresolv)
2344 AC_LINK_IFELSE([
2345#include <resolv.h>
2346int main()
2347{
2348 res_query (0, 0, 0, 0, 0);
2349 return 0;
2350}
2351 ],
2352 [LIBS="$LIBS -lresolv"
2353 AC_MSG_RESULT(yes)],
2354 [LIBS="$saved_LIBS"
2355 AC_MSG_RESULT(no)])
2356 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002357 AC_CHECK_FUNCS(_getshort _getlong)
2358 AC_CHECK_MEMBER(HEADER.ad,
2359 [AC_DEFINE(HAVE_HEADER_AD)],,
2360 [#include <arpa/nameser.h>])
2361 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002362
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002363# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002364KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002365AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002366 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002367 [ if test "x$withval" != "xno" ; then
2368 if test "x$withval" = "xyes" ; then
2369 KRB5ROOT="/usr/local"
2370 else
2371 KRB5ROOT=${withval}
2372 fi
2373
2374 AC_DEFINE(KRB5)
2375 KRB5_MSG="yes"
2376
2377 AC_MSG_CHECKING(for krb5-config)
2378 if test -x $KRB5ROOT/bin/krb5-config ; then
2379 KRB5CONF=$KRB5ROOT/bin/krb5-config
2380 AC_MSG_RESULT($KRB5CONF)
2381
2382 AC_MSG_CHECKING(for gssapi support)
2383 if $KRB5CONF | grep gssapi >/dev/null ; then
2384 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002385 AC_DEFINE(GSSAPI)
2386 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002387 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002388 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002389 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002390 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002391 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2392 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002393 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002394 AC_MSG_CHECKING(whether we are using Heimdal)
2395 AC_TRY_COMPILE([ #include <krb5.h> ],
2396 [ char *tmp = heimdal_version; ],
2397 [ AC_MSG_RESULT(yes)
2398 AC_DEFINE(HEIMDAL) ],
2399 AC_MSG_RESULT(no)
2400 )
2401 else
2402 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002403 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002404 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002405 AC_MSG_CHECKING(whether we are using Heimdal)
2406 AC_TRY_COMPILE([ #include <krb5.h> ],
2407 [ char *tmp = heimdal_version; ],
2408 [ AC_MSG_RESULT(yes)
2409 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10002410 K5LIBS="-lkrb5 -ldes"
2411 K5LIBS="$K5LIBS -lcom_err -lasn1"
2412 AC_CHECK_LIB(roken, net_write,
2413 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11002414 ],
2415 [ AC_MSG_RESULT(no)
2416 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2417 ]
2418 )
Damien Miller200d0a72003-06-30 19:21:36 +10002419 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002420
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002421 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2422 [ AC_DEFINE(GSSAPI)
2423 K5LIBS="-lgssapi $K5LIBS" ],
2424 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2425 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002426 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002427 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2428 $K5LIBS)
2429 ],
2430 $K5LIBS)
2431
2432 AC_CHECK_HEADER(gssapi.h, ,
2433 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002434 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002435 AC_CHECK_HEADERS(gssapi.h, ,
2436 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002437 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002438 ]
2439 )
2440
2441 oldCPP="$CPPFLAGS"
2442 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2443 AC_CHECK_HEADER(gssapi_krb5.h, ,
2444 [ CPPFLAGS="$oldCPP" ])
2445
Damien Millera8e06ce2003-11-21 23:48:55 +11002446 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002447 if test ! -z "$need_dash_r" ; then
2448 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2449 fi
2450 if test ! -z "$blibpath" ; then
2451 blibpath="$blibpath:${KRB5ROOT}/lib"
2452 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002453 fi
2454
2455 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2456 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2457 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2458
2459 LIBS="$LIBS $K5LIBS"
2460 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
Ben Lindstroma8104b52004-04-07 04:16:11 +00002461 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
Darren Tucker0d27ed12004-02-24 10:37:33 +11002462 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002463)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002464
Damien Millera22ba012000-03-02 23:09:20 +11002465# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002466
Damien Millerf58c6722002-05-13 13:15:42 +10002467PRIVSEP_PATH=/var/empty
2468AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002469 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002470 [
2471 if test "x$withval" != "$no" ; then
2472 PRIVSEP_PATH=$withval
2473 fi
2474 ]
2475)
2476AC_SUBST(PRIVSEP_PATH)
2477
Damien Millera22ba012000-03-02 23:09:20 +11002478AC_ARG_WITH(xauth,
2479 [ --with-xauth=PATH Specify path to xauth program ],
2480 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002481 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002482 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002483 fi
2484 ],
2485 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002486 TestPath="$PATH"
2487 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2488 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2489 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2490 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2491 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002492 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002493 xauth_path="/usr/openwin/bin/xauth"
2494 fi
2495 ]
2496)
2497
Damien Miller7d901272003-01-13 16:55:22 +11002498STRIP_OPT=-s
2499AC_ARG_ENABLE(strip,
2500 [ --disable-strip Disable calling strip(1) on install],
2501 [
2502 if test "x$enableval" = "xno" ; then
2503 STRIP_OPT=
2504 fi
2505 ]
2506)
2507AC_SUBST(STRIP_OPT)
2508
Damien Millera19cf472000-11-29 13:28:50 +11002509if test -z "$xauth_path" ; then
2510 XAUTH_PATH="undefined"
2511 AC_SUBST(XAUTH_PATH)
2512else
Damien Millera22ba012000-03-02 23:09:20 +11002513 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002514 XAUTH_PATH=$xauth_path
2515 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002516fi
Damien Millera22ba012000-03-02 23:09:20 +11002517
2518# Check for mail directory (last resort if we cannot get it from headers)
2519if test ! -z "$MAIL" ; then
2520 maildir=`dirname $MAIL`
2521 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2522fi
2523
Darren Tucker623d92f2004-09-12 22:36:15 +10002524if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002525 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2526 disable_ptmx_check=yes
2527fi
Damien Millera22ba012000-03-02 23:09:20 +11002528if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002529 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002530 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002531 [
2532 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2533 have_dev_ptmx=1
2534 ]
2535 )
2536 fi
Damien Millera22ba012000-03-02 23:09:20 +11002537fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10002538
Darren Tucker623d92f2004-09-12 22:36:15 +10002539if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002540 AC_CHECK_FILE("/dev/ptc",
2541 [
2542 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2543 have_dev_ptc=1
2544 ]
2545 )
2546else
2547 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2548fi
Damien Miller204ad072000-03-02 23:56:12 +11002549
Damien Millera22ba012000-03-02 23:09:20 +11002550# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002551AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002552 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002553 [
Damien Miller897741e2001-04-16 10:41:46 +10002554 case "$withval" in
2555 man|cat|doc)
2556 MANTYPE=$withval
2557 ;;
2558 *)
2559 AC_MSG_ERROR(invalid man type: $withval)
2560 ;;
2561 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002562 ]
2563)
Ben Lindstrombc709922001-04-18 18:04:21 +00002564if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002565 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2566 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002567 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2568 MANTYPE=doc
2569 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2570 MANTYPE=man
2571 else
2572 MANTYPE=cat
2573 fi
2574fi
Damien Miller670a4b82000-01-22 13:53:11 +11002575AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002576if test "$MANTYPE" = "doc"; then
2577 mansubdir=man;
2578else
2579 mansubdir=$MANTYPE;
2580fi
2581AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002582
Damien Millera22ba012000-03-02 23:09:20 +11002583# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002584MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002585AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002586 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002587 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002588 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002589 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002590 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002591 fi
2592 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002593)
2594
Damien Millera22ba012000-03-02 23:09:20 +11002595# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002596AC_ARG_WITH(shadow,
2597 [ --without-shadow Disable shadow password support],
2598 [
2599 if test "x$withval" = "xno" ; then
2600 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002601 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002602 fi
2603 ]
2604)
2605
Damien Miller1f335fb2000-06-26 11:31:33 +10002606if test -z "$disable_shadow" ; then
2607 AC_MSG_CHECKING([if the systems has expire shadow information])
2608 AC_TRY_COMPILE(
2609 [
2610#include <sys/types.h>
2611#include <shadow.h>
2612 struct spwd sp;
2613 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2614 [ sp_expire_available=yes ], []
2615 )
2616
2617 if test "x$sp_expire_available" = "xyes" ; then
2618 AC_MSG_RESULT(yes)
2619 AC_DEFINE(HAS_SHADOW_EXPIRE)
2620 else
2621 AC_MSG_RESULT(no)
2622 fi
2623fi
2624
Damien Millera22ba012000-03-02 23:09:20 +11002625# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002626if test ! -z "$IPADDR_IN_DISPLAY" ; then
2627 DISPLAY_HACK_MSG="yes"
2628 AC_DEFINE(IPADDR_IN_DISPLAY)
2629else
Damien Millera8e06ce2003-11-21 23:48:55 +11002630 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002631 AC_ARG_WITH(ipaddr-display,
2632 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2633 [
2634 if test "x$withval" != "xno" ; then
2635 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002636 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002637 fi
2638 ]
2639 )
2640fi
Damien Miller76112de1999-12-21 11:18:08 +11002641
Darren Tuckere1a790d2003-09-16 11:52:19 +10002642# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002643AC_ARG_ENABLE(etc-default-login,
Darren Tucker1b6f2292005-02-11 16:11:49 +11002644 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
Darren Tucker2f9573d2005-02-10 22:28:54 +11002645 [ if test "x$enableval" = "xno"; then
2646 AC_MSG_NOTICE([/etc/default/login handling disabled])
2647 etc_default_login=no
2648 else
2649 etc_default_login=yes
2650 fi ],
2651 [ etc_default_login=yes ]
2652)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002653
Darren Tucker2f9573d2005-02-10 22:28:54 +11002654if test "x$etc_default_login" != "xno"; then
2655 AC_CHECK_FILE("/etc/default/login",
2656 [ external_path_file=/etc/default/login ])
Darren Tucker623d92f2004-09-12 22:36:15 +10002657 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2658 then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002659 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2660 elif test "x$external_path_file" = "x/etc/default/login"; then
2661 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2662 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11002663fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002664
Tim Rice43a1c132002-04-17 21:19:14 -07002665dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2666if test $ac_cv_func_login_getcapbool = "yes" -a \
2667 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002668 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002669fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002670
Damien Millera22ba012000-03-02 23:09:20 +11002671# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002672SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002673AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002674 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002675 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002676 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002677 AC_MSG_WARN([
2678--with-default-path=PATH has no effect on this system.
2679Edit /etc/login.conf instead.])
2680 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002681 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002682 AC_MSG_WARN([
2683--with-default-path=PATH will only be used if PATH is not defined in
2684$external_path_file .])
2685 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002686 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002687 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002688 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002689 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002690 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2691 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002692 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002693 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002694 AC_MSG_WARN([
2695If PATH is defined in $external_path_file, ensure the path to scp is included,
2696otherwise scp will not work.])
2697 fi
2698 AC_TRY_RUN(
2699 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002700/* find out what STDPATH is */
2701#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002702#ifdef HAVE_PATHS_H
2703# include <paths.h>
2704#endif
2705#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002706# ifdef _PATH_USERPATH /* Irix */
2707# define _PATH_STDPATH _PATH_USERPATH
2708# else
2709# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2710# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002711#endif
2712#include <sys/types.h>
2713#include <sys/stat.h>
2714#include <fcntl.h>
2715#define DATA "conftest.stdpath"
2716
2717main()
2718{
2719 FILE *fd;
2720 int rc;
2721
2722 fd = fopen(DATA,"w");
2723 if(fd == NULL)
2724 exit(1);
2725
2726 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2727 exit(1);
2728
2729 exit(0);
2730}
2731 ], [ user_path=`cat conftest.stdpath` ],
2732 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2733 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2734 )
2735# make sure $bindir is in USER_PATH so scp will work
2736 t_bindir=`eval echo ${bindir}`
2737 case $t_bindir in
2738 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2739 esac
2740 case $t_bindir in
2741 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2742 esac
2743 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2744 if test $? -ne 0 ; then
2745 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2746 if test $? -ne 0 ; then
2747 user_path=$user_path:$t_bindir
2748 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2749 fi
2750 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002751 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002752)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002753if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002754 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2755 AC_SUBST(user_path)
2756fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002757
Damien Millera18bbd32002-05-13 10:48:57 +10002758# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002759AC_ARG_WITH(superuser-path,
2760 [ --with-superuser-path= Specify different path for super-user],
2761 [
2762 if test "x$withval" != "xno" ; then
2763 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2764 superuser_path=$withval
2765 fi
2766 ]
2767)
2768
2769
Damien Miller61e50f12000-05-08 20:49:37 +10002770AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002771IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002772AC_ARG_WITH(4in6,
2773 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2774 [
2775 if test "x$withval" != "xno" ; then
2776 AC_MSG_RESULT(yes)
2777 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002778 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002779 else
2780 AC_MSG_RESULT(no)
2781 fi
2782 ],[
2783 if test "x$inet6_default_4in6" = "xyes"; then
2784 AC_MSG_RESULT([yes (default)])
2785 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002786 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002787 else
2788 AC_MSG_RESULT([no (default)])
2789 fi
2790 ]
2791)
2792
Damien Miller60396b02001-02-18 17:01:00 +11002793# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002794BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002795AC_ARG_WITH(bsd-auth,
2796 [ --with-bsd-auth Enable BSD auth support],
2797 [
2798 if test "x$withval" != "xno" ; then
2799 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002800 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002801 fi
2802 ]
2803)
2804
Damien Millera22ba012000-03-02 23:09:20 +11002805# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002806piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002807# make sure the directory exists
2808if test ! -d $piddir ; then
2809 piddir=`eval echo ${sysconfdir}`
2810 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002811 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002812 esac
2813fi
2814
Tim Rice88f2ab52002-03-17 12:17:34 -08002815AC_ARG_WITH(pid-dir,
2816 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2817 [
2818 if test "x$withval" != "xno" ; then
2819 piddir=$withval
2820 if test ! -d $piddir ; then
2821 AC_MSG_WARN([** no $piddir directory on this system **])
2822 fi
2823 fi
2824 ]
2825)
2826
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002827AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002828AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002829
andre2ff7b5d2000-06-03 14:57:40 +00002830dnl allow user to disable some login recording features
2831AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002832 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002833 [
2834 if test "x$enableval" = "xno" ; then
2835 AC_DEFINE(DISABLE_LASTLOG)
2836 fi
2837 ]
andre2ff7b5d2000-06-03 14:57:40 +00002838)
2839AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002840 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002841 [
2842 if test "x$enableval" = "xno" ; then
2843 AC_DEFINE(DISABLE_UTMP)
2844 fi
2845 ]
andre2ff7b5d2000-06-03 14:57:40 +00002846)
2847AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002848 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002849 [
2850 if test "x$enableval" = "xno" ; then
2851 AC_DEFINE(DISABLE_UTMPX)
2852 fi
2853 ]
andre2ff7b5d2000-06-03 14:57:40 +00002854)
2855AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002856 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002857 [
2858 if test "x$enableval" = "xno" ; then
2859 AC_DEFINE(DISABLE_WTMP)
2860 fi
2861 ]
andre2ff7b5d2000-06-03 14:57:40 +00002862)
2863AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002864 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002865 [
2866 if test "x$enableval" = "xno" ; then
2867 AC_DEFINE(DISABLE_WTMPX)
2868 fi
2869 ]
andre2ff7b5d2000-06-03 14:57:40 +00002870)
2871AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002872 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002873 [
2874 if test "x$enableval" = "xno" ; then
2875 AC_DEFINE(DISABLE_LOGIN)
2876 fi
2877 ]
andre2ff7b5d2000-06-03 14:57:40 +00002878)
2879AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002880 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002881 [
2882 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002883 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002884 fi
2885 ]
andre2ff7b5d2000-06-03 14:57:40 +00002886)
2887AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002888 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002889 [
2890 if test "x$enableval" = "xno" ; then
2891 AC_DEFINE(DISABLE_PUTUTXLINE)
2892 fi
2893 ]
andre2ff7b5d2000-06-03 14:57:40 +00002894)
2895AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002896 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002897 [
2898 if test "x$withval" = "xno" ; then
2899 AC_DEFINE(DISABLE_LASTLOG)
2900 else
2901 conf_lastlog_location=$withval
2902 fi
2903 ]
2904)
andre2ff7b5d2000-06-03 14:57:40 +00002905
2906dnl lastlog, [uw]tmpx? detection
2907dnl NOTE: set the paths in the platform section to avoid the
2908dnl need for command-line parameters
2909dnl lastlog and [uw]tmp are subject to a file search if all else fails
2910
2911dnl lastlog detection
2912dnl NOTE: the code itself will detect if lastlog is a directory
2913AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2914AC_TRY_COMPILE([
2915#include <sys/types.h>
2916#include <utmp.h>
2917#ifdef HAVE_LASTLOG_H
2918# include <lastlog.h>
2919#endif
Damien Miller2994e082000-06-04 15:51:47 +10002920#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002921# include <paths.h>
2922#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002923#ifdef HAVE_LOGIN_H
2924# include <login.h>
2925#endif
andre2ff7b5d2000-06-03 14:57:40 +00002926 ],
2927 [ char *lastlog = LASTLOG_FILE; ],
2928 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002929 [
2930 AC_MSG_RESULT(no)
2931 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2932 AC_TRY_COMPILE([
2933#include <sys/types.h>
2934#include <utmp.h>
2935#ifdef HAVE_LASTLOG_H
2936# include <lastlog.h>
2937#endif
2938#ifdef HAVE_PATHS_H
2939# include <paths.h>
2940#endif
2941 ],
2942 [ char *lastlog = _PATH_LASTLOG; ],
2943 [ AC_MSG_RESULT(yes) ],
2944 [
andree441aa32000-06-12 22:34:38 +00002945 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002946 system_lastlog_path=no
2947 ])
2948 ]
andre2ff7b5d2000-06-03 14:57:40 +00002949)
Damien Miller2994e082000-06-04 15:51:47 +10002950
andre2ff7b5d2000-06-03 14:57:40 +00002951if test -z "$conf_lastlog_location"; then
2952 if test x"$system_lastlog_path" = x"no" ; then
2953 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002954 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002955 conf_lastlog_location=$f
2956 fi
2957 done
2958 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002959 AC_MSG_WARN([** Cannot find lastlog **])
2960 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002961 fi
2962 fi
2963fi
2964
2965if test -n "$conf_lastlog_location"; then
2966 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2967fi
2968
2969dnl utmp detection
2970AC_MSG_CHECKING([if your system defines UTMP_FILE])
2971AC_TRY_COMPILE([
2972#include <sys/types.h>
2973#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002974#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002975# include <paths.h>
2976#endif
2977 ],
2978 [ char *utmp = UTMP_FILE; ],
2979 [ AC_MSG_RESULT(yes) ],
2980 [ AC_MSG_RESULT(no)
2981 system_utmp_path=no ]
2982)
2983if test -z "$conf_utmp_location"; then
2984 if test x"$system_utmp_path" = x"no" ; then
2985 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2986 if test -f $f ; then
2987 conf_utmp_location=$f
2988 fi
2989 done
2990 if test -z "$conf_utmp_location"; then
2991 AC_DEFINE(DISABLE_UTMP)
2992 fi
2993 fi
2994fi
2995if test -n "$conf_utmp_location"; then
2996 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2997fi
2998
2999dnl wtmp detection
3000AC_MSG_CHECKING([if your system defines WTMP_FILE])
3001AC_TRY_COMPILE([
3002#include <sys/types.h>
3003#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003004#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003005# include <paths.h>
3006#endif
3007 ],
3008 [ char *wtmp = WTMP_FILE; ],
3009 [ AC_MSG_RESULT(yes) ],
3010 [ AC_MSG_RESULT(no)
3011 system_wtmp_path=no ]
3012)
3013if test -z "$conf_wtmp_location"; then
3014 if test x"$system_wtmp_path" = x"no" ; then
3015 for f in /usr/adm/wtmp /var/log/wtmp; do
3016 if test -f $f ; then
3017 conf_wtmp_location=$f
3018 fi
3019 done
3020 if test -z "$conf_wtmp_location"; then
3021 AC_DEFINE(DISABLE_WTMP)
3022 fi
3023 fi
3024fi
3025if test -n "$conf_wtmp_location"; then
3026 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
3027fi
3028
3029
3030dnl utmpx detection - I don't know any system so perverse as to require
3031dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3032dnl there, though.
3033AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3034AC_TRY_COMPILE([
3035#include <sys/types.h>
3036#include <utmp.h>
3037#ifdef HAVE_UTMPX_H
3038#include <utmpx.h>
3039#endif
Damien Miller2994e082000-06-04 15:51:47 +10003040#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003041# include <paths.h>
3042#endif
3043 ],
3044 [ char *utmpx = UTMPX_FILE; ],
3045 [ AC_MSG_RESULT(yes) ],
3046 [ AC_MSG_RESULT(no)
3047 system_utmpx_path=no ]
3048)
3049if test -z "$conf_utmpx_location"; then
3050 if test x"$system_utmpx_path" = x"no" ; then
3051 AC_DEFINE(DISABLE_UTMPX)
3052 fi
3053else
3054 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
3055fi
3056
3057dnl wtmpx detection
3058AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3059AC_TRY_COMPILE([
3060#include <sys/types.h>
3061#include <utmp.h>
3062#ifdef HAVE_UTMPX_H
3063#include <utmpx.h>
3064#endif
Damien Miller2994e082000-06-04 15:51:47 +10003065#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003066# include <paths.h>
3067#endif
3068 ],
3069 [ char *wtmpx = WTMPX_FILE; ],
3070 [ AC_MSG_RESULT(yes) ],
3071 [ AC_MSG_RESULT(no)
3072 system_wtmpx_path=no ]
3073)
3074if test -z "$conf_wtmpx_location"; then
3075 if test x"$system_wtmpx_path" = x"no" ; then
3076 AC_DEFINE(DISABLE_WTMPX)
3077 fi
3078else
3079 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
3080fi
3081
Damien Miller4018c192000-04-30 09:30:44 +10003082
Damien Miller29ea30d2000-03-17 10:54:15 +11003083if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003084 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3085 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003086fi
3087
Tim Rice4cec93f2002-02-26 08:40:48 -08003088dnl remove pam and dl because they are in $LIBPAM
3089if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003090 LIBS=`echo $LIBS | sed 's/-lpam //'`
3091fi
3092if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3093 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003094fi
3095
Damien Millerbac2d8a2000-09-05 16:13:06 +11003096AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003097AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3098 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003099AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003100
Damien Miller7b22d652000-06-18 14:07:04 +10003101# Print summary of options
3102
Damien Miller7b22d652000-06-18 14:07:04 +10003103# Someone please show me a better way :)
3104A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3105B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3106C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3107D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003108E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003109F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003110G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003111H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3112I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3113J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003114
3115echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003116echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003117echo " User binaries: $B"
3118echo " System binaries: $C"
3119echo " Configuration files: $D"
3120echo " Askpass program: $E"
3121echo " Manual pages: $F"
3122echo " PID file: $G"
3123echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003124if test "x$external_path_file" = "x/etc/login.conf" ; then
3125echo " At runtime, sshd will use the path defined in $external_path_file"
3126echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003127else
Damien Millerf58c6722002-05-13 13:15:42 +10003128echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003129 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003130echo " (If PATH is set in $external_path_file it will be used instead. If"
3131echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3132 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003133fi
Damien Millera18bbd32002-05-13 10:48:57 +10003134if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003135echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003136fi
Damien Millerf58c6722002-05-13 13:15:42 +10003137echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003138echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003139echo " KerberosV support: $KRB5_MSG"
3140echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003141echo " S/KEY support: $SKEY_MSG"
3142echo " TCP Wrappers support: $TCPW_MSG"
3143echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003144echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003145echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003146echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3147echo " BSD Auth support: $BSD_AUTH_MSG"
3148echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003149if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003150echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003151fi
3152
Damien Miller7b22d652000-06-18 14:07:04 +10003153echo ""
3154
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003155echo " Host: ${host}"
3156echo " Compiler: ${CC}"
3157echo " Compiler flags: ${CFLAGS}"
3158echo "Preprocessor flags: ${CPPFLAGS}"
3159echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003160echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003161
3162echo ""
3163
Tim Rice6f1f7582004-05-30 21:38:51 -07003164if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003165 echo "SVR4 style packages are supported with \"make package\""
3166 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003167fi
3168
Damien Miller82cf0ce2000-12-20 13:34:48 +11003169if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003170 echo "PAM is enabled. You may need to install a PAM control file "
3171 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003172 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003173 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003174 echo ""
3175fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003176
Damien Miller6c21c512002-01-22 21:57:53 +11003177if test ! -z "$RAND_HELPER_CMDHASH" ; then
3178 echo "WARNING: you are using the builtin random number collection "
3179 echo "service. Please read WARNING.RNG and request that your OS "
3180 echo "vendor includes kernel-based random number collection in "
3181 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003182 echo ""
3183fi
Damien Miller60396b02001-02-18 17:01:00 +11003184
Damien Millerb4097182004-05-23 14:09:40 +10003185if test ! -z "$NO_PEERCHECK" ; then
3186 echo "WARNING: the operating system that you are using does not "
3187 echo "appear to support either the getpeereid() API nor the "
3188 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3189 echo "enforce security checks to prevent unauthorised connections to "
3190 echo "ssh-agent. Their absence increases the risk that a malicious "
3191 echo "user can connect to your agent. "
3192 echo ""
3193fi
3194