blob: b27f0cf707fa7295d8ce2dbd36ea25142670e300 [file] [log] [blame]
Darren Tucker691d5232005-02-15 21:45:57 +11001# $Id: configure.ac,v 1.242 2005/02/15 10:45:57 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, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100342 IPADDR_IN_DISPLAY=yes
343 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000344 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000345 AC_DEFINE(SETEUID_BREAKS_SETUID)
346 AC_DEFINE(BROKEN_SETREUID)
347 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000348 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000349 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700350 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
351 # Attention: always take care to bind libsocket and libnsl before libc,
352 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000353 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800354# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
Damien Miller78315eb2000-09-29 23:01:36 +1100355*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100356 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700357 AC_DEFINE(SETEUID_BREAKS_SETUID)
358 AC_DEFINE(BROKEN_SETREUID)
359 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100360 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800361# UnixWare 7.x, OpenUNIX 8
Damien Miller78315eb2000-09-29 23:01:36 +1100362*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100363 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700364 AC_DEFINE(SETEUID_BREAKS_SETUID)
365 AC_DEFINE(BROKEN_SETREUID)
366 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100367 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100368*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100369 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800370# SCO UNIX and OEM versions of SCO UNIX
Damien Miller78315eb2000-09-29 23:01:36 +1100371*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800372 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Ricee8c898a2004-02-23 21:47:04 -0800373 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100374 RANLIB=true
375 no_dev_ptmx=1
376 AC_DEFINE(BROKEN_SYS_TERMIO_H)
377 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000378 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000379 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100380 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Ricefe6d5aa2004-04-16 20:03:07 -0700381 AC_DEFINE(SETEUID_BREAKS_SETUID)
382 AC_DEFINE(BROKEN_SETREUID)
383 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700384 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100385 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700386 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700387 do_sco3_extra_lib_check=yes
Tim Ricef7ba8f62004-06-20 10:37:32 -0700388 TEST_SHELL=ksh
Damien Miller78315eb2000-09-29 23:01:36 +1100389 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800390# SCO OpenServer 5.x
Damien Miller78315eb2000-09-29 23:01:36 +1100391*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800392 if test -z "$GCC"; then
393 CFLAGS="$CFLAGS -belf"
394 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100395 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000396 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100397 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000398 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000399 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700400 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700401 AC_DEFINE(SETEUID_BREAKS_SETUID)
402 AC_DEFINE(BROKEN_SETREUID)
403 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700404 AC_DEFINE(WITH_ABBREV_NO_TTY)
Tim Rice816bd0d2004-07-19 10:19:26 -0700405 AC_DEFINE(BROKEN_UPDWTMPX)
Darren Tucker33370e02005-02-09 22:17:28 +1100406 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
Damien Miller217f5672001-02-16 12:12:41 +1100407 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700408 MANTYPE=man
Tim Ricef7ba8f62004-06-20 10:37:32 -0700409 TEST_SHELL=ksh
Damien Millera66626b2000-06-13 18:57:53 +1000410 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000411*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100412 AC_DEFINE(NO_SSH_LASTLOG)
413 AC_DEFINE(SETEUID_BREAKS_SETUID)
414 AC_DEFINE(BROKEN_SETREUID)
415 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000416 AC_DEFINE(USE_PIPES)
417 AC_DEFINE(DISABLE_FD_PASSING)
418 LDFLAGS="$LDFLAGS"
419 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
420 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000421 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000422*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100423 AC_DEFINE(SETEUID_BREAKS_SETUID)
424 AC_DEFINE(BROKEN_SETREUID)
425 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000426 AC_DEFINE(WITH_ABBREV_NO_TTY)
427 AC_DEFINE(USE_PIPES)
428 AC_DEFINE(DISABLE_FD_PASSING)
429 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100430 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000431 MANTYPE=cat
432 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000433*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100434 AC_DEFINE(SETEUID_BREAKS_SETUID)
435 AC_DEFINE(BROKEN_SETREUID)
436 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000437 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700438 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700439 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000440 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
441 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
442 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700443 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000444*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000445 AC_MSG_CHECKING(for Digital Unix SIA)
446 no_osfsia=""
447 AC_ARG_WITH(osfsia,
448 [ --with-osfsia Enable Digital Unix SIA],
449 [
450 if test "x$withval" = "xno" ; then
451 AC_MSG_RESULT(disabled)
452 no_osfsia=1
453 fi
454 ],
455 )
456 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000457 if test -f /etc/sia/matrix.conf; then
458 AC_MSG_RESULT(yes)
459 AC_DEFINE(HAVE_OSF_SIA)
460 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000461 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000462 LIBS="$LIBS -lsecurity -ldb -lm -laud"
463 else
464 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100465 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000466 fi
467 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000468 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700469 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000470 AC_DEFINE(BROKEN_SETREUID)
471 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000472 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000473
474*-*-nto-qnx)
475 AC_DEFINE(USE_PIPES)
476 AC_DEFINE(NO_X11_UNIX_SOCKETS)
477 AC_DEFINE(MISSING_NFDBITS)
478 AC_DEFINE(MISSING_HOWMANY)
479 AC_DEFINE(MISSING_FD_MASK)
480 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100481esac
482
Damien Millere37bfc12000-06-05 09:37:43 +1000483# Allow user to specify flags
484AC_ARG_WITH(cflags,
485 [ --with-cflags Specify additional flags to pass to compiler],
486 [
487 if test "x$withval" != "xno" ; then
488 CFLAGS="$CFLAGS $withval"
489 fi
490 ]
491)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000492AC_ARG_WITH(cppflags,
493 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
494 [
495 if test "x$withval" != "xno"; then
496 CPPFLAGS="$CPPFLAGS $withval"
497 fi
498 ]
499)
Damien Millere37bfc12000-06-05 09:37:43 +1000500AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000501 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000502 [
503 if test "x$withval" != "xno" ; then
504 LDFLAGS="$LDFLAGS $withval"
505 fi
506 ]
507)
508AC_ARG_WITH(libs,
509 [ --with-libs Specify additional libraries to link with],
510 [
511 if test "x$withval" != "xno" ; then
512 LIBS="$LIBS $withval"
513 fi
514 ]
515)
516
Darren Tucker6eb93042003-06-29 21:30:41 +1000517AC_MSG_CHECKING(compiler and flags for sanity)
Darren Tucker623d92f2004-09-12 22:36:15 +1000518AC_RUN_IFELSE(
519 [AC_LANG_SOURCE([
Darren Tucker6eb93042003-06-29 21:30:41 +1000520#include <stdio.h>
521int main(){exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000522 ])],
Darren Tucker6eb93042003-06-29 21:30:41 +1000523 [ AC_MSG_RESULT(yes) ],
524 [
525 AC_MSG_RESULT(no)
526 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000527 ],
528 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
Darren Tucker6eb93042003-06-29 21:30:41 +1000529)
530
Tim Rice4cec93f2002-02-26 08:40:48 -0800531# Checks for header files.
Damien Miller36f49652004-08-15 18:40:59 +1000532AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \
533 floatingpoint.h getopt.h glob.h ia.h lastlog.h limits.h login.h \
534 login_cap.h maillock.h ndir.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100535 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000536 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Damien Miller36f49652004-08-15 18:40:59 +1000537 strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \
538 sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \
Darren Tucker48d99d32004-08-29 17:04:50 +1000539 sys/pstat.h sys/select.h sys/stat.h sys/stream.h \
Damien Miller36f49652004-08-15 18:40:59 +1000540 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \
541 time.h tmpdir.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800542
Darren Tucker48d99d32004-08-29 17:04:50 +1000543# sys/ptms.h requires sys/stream.h to be included first on Solaris
544AC_CHECK_HEADERS(sys/ptms.h, [], [], [
545#ifdef HAVE_SYS_STREAM_H
546# include <sys/stream.h>
547#endif
548])
549
Damien Millera22ba012000-03-02 23:09:20 +1100550# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700551AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
552AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000553
Damien Millerdf288022001-02-18 13:07:07 +1100554dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700555if test "x$with_tcp_wrappers" != "xno" ; then
556 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
557 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
558 fi
559fi
Damien Millerdf288022001-02-18 13:07:07 +1100560
Tim Rice1e1ef642003-09-11 22:19:31 -0700561dnl IRIX and Solaris 2.5.1 have dirname() in libgen
562AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
563 AC_CHECK_LIB(gen, dirname,[
564 AC_CACHE_CHECK([for broken dirname],
565 ac_cv_have_broken_dirname, [
566 save_LIBS="$LIBS"
567 LIBS="$LIBS -lgen"
568 AC_TRY_RUN(
569 [
570#include <libgen.h>
571#include <string.h>
572
573int main(int argc, char **argv) {
574 char *s, buf[32];
575
576 strncpy(buf,"/etc", 32);
577 s = dirname(buf);
578 if (!s || strncmp(s, "/", 32) != 0) {
579 exit(1);
580 } else {
581 exit(0);
582 }
583}
584 ],
585 [ ac_cv_have_broken_dirname="no" ],
586 [ ac_cv_have_broken_dirname="yes" ]
587 )
588 LIBS="$save_LIBS"
589 ])
590 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
591 LIBS="$LIBS -lgen"
592 AC_DEFINE(HAVE_DIRNAME)
593 AC_CHECK_HEADERS(libgen.h)
594 fi
595 ])
596])
597
598AC_CHECK_FUNC(getspnam, ,
599 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
600AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
601
Tim Rice13aae5e2001-10-21 17:53:58 -0700602dnl zlib is required
603AC_ARG_WITH(zlib,
604 [ --with-zlib=PATH Use zlib in PATH],
605 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000606 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100607 AC_MSG_ERROR([*** zlib is required ***])
608 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700609 if test -d "$withval/lib"; then
610 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700611 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700612 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700613 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700614 fi
615 else
616 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700617 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700618 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700619 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700620 fi
621 fi
622 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700623 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700624 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700625 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700626 fi
627 ]
628)
629
Tim Ricefcb62202004-01-23 18:35:16 -0800630AC_CHECK_LIB(z, deflate, ,
631 [
632 saved_CPPFLAGS="$CPPFLAGS"
633 saved_LDFLAGS="$LDFLAGS"
634 save_LIBS="$LIBS"
635 dnl Check default zlib install dir
636 if test -n "${need_dash_r}"; then
637 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
638 else
639 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
640 fi
641 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
642 LIBS="$LIBS -lz"
643 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
644 [
645 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
646 ]
647 )
648 ]
649)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100650AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100651
652AC_ARG_WITH(zlib-version-check,
653 [ --without-zlib-version-check Disable zlib version check],
654 [ if test "x$withval" = "xno" ; then
655 zlib_check_nonfatal=1
656 fi
657 ]
658)
659
Darren Tucker2dcd2392004-01-23 17:13:33 +1100660AC_MSG_CHECKING(for zlib 1.1.4 or greater)
Darren Tucker623d92f2004-09-12 22:36:15 +1000661AC_RUN_IFELSE([AC_LANG_SOURCE([[
Darren Tucker2dcd2392004-01-23 17:13:33 +1100662#include <zlib.h>
663int main()
664{
665 int a, b, c, v;
666 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
667 exit(1);
668 v = a*1000000 + b*1000 + c;
669 if (v >= 1001004)
670 exit(0);
671 exit(2);
672}
Darren Tucker623d92f2004-09-12 22:36:15 +1000673 ]])],
Darren Tucker2dcd2392004-01-23 17:13:33 +1100674 AC_MSG_RESULT(yes),
675 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100676 if test -z "$zlib_check_nonfatal" ; then
677 AC_MSG_ERROR([*** zlib too old - check config.log ***
678Your reported zlib version has known security problems. It's possible your
679vendor has fixed these problems without changing the version number. If you
680are sure this is the case, you can disable the check by running
681"./configure --without-zlib-version-check".
682If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
683 else
684 AC_MSG_WARN([zlib version may have security problems])
685 fi
Darren Tuckera0c2b392004-09-11 23:26:37 +1000686 ],
687 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100688)
Damien Miller6f9c3372000-10-25 10:06:04 +1100689
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000690dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100691AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000692 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
693)
Damien Millera8e06ce2003-11-21 23:48:55 +1100694AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700695 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
696 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000697)
Damien Millerab18c411999-11-11 10:40:23 +1100698
Tim Ricee589a292001-11-03 11:09:32 -0800699dnl Checks for libutil functions
700AC_CHECK_HEADERS(libutil.h)
701AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
702AC_CHECK_FUNCS(logout updwtmp logwtmp)
703
Ben Lindstrom8697e082001-02-24 21:41:10 +0000704AC_FUNC_STRFTIME
705
Damien Miller3c027682001-03-14 11:39:45 +1100706# Check for ALTDIRFUNC glob() extension
707AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
708AC_EGREP_CPP(FOUNDIT,
709 [
710 #include <glob.h>
711 #ifdef GLOB_ALTDIRFUNC
712 FOUNDIT
713 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100714 ],
Damien Miller3c027682001-03-14 11:39:45 +1100715 [
716 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
717 AC_MSG_RESULT(yes)
718 ],
719 [
720 AC_MSG_RESULT(no)
721 ]
722)
Damien Millerab18c411999-11-11 10:40:23 +1100723
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000724# Check for g.gl_matchc glob() extension
725AC_MSG_CHECKING(for gl_matchc field in glob_t)
726AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100727 [
728 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000729 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100730 ],
731 [
732 AC_DEFINE(GLOB_HAS_GL_MATCHC)
733 AC_MSG_RESULT(yes)
734 ],
735 [
736 AC_MSG_RESULT(no)
737 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000738)
739
Damien Miller18bb4732001-03-28 14:35:30 +1000740AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000741AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000742 [AC_LANG_SOURCE([[
Damien Miller18bb4732001-03-28 14:35:30 +1000743#include <sys/types.h>
744#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700745int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Darren Tucker623d92f2004-09-12 22:36:15 +1000746 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100747 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000748 [
749 AC_MSG_RESULT(no)
750 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000751 ],
752 [
753 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
754 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Damien Miller18bb4732001-03-28 14:35:30 +1000755 ]
756)
757
Damien Miller36f49652004-08-15 18:40:59 +1000758AC_MSG_CHECKING([for /proc/pid/fd directory])
759if test -d "/proc/$$/fd" ; then
760 AC_DEFINE(HAVE_PROC_PID)
761 AC_MSG_RESULT(yes)
762else
763 AC_MSG_RESULT(no)
764fi
765
Damien Millerc547bf12001-02-16 10:18:12 +1100766# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100767SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100768AC_ARG_WITH(skey,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100769 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100770 [
771 if test "x$withval" != "xno" ; then
772
773 if test "x$withval" != "xyes" ; then
774 CPPFLAGS="$CPPFLAGS -I${withval}/include"
775 LDFLAGS="$LDFLAGS -L${withval}/lib"
776 fi
777
778 AC_DEFINE(SKEY)
779 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100780 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100781
Tim Rice4cec93f2002-02-26 08:40:48 -0800782 AC_MSG_CHECKING([for s/key support])
783 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100784 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800785#include <stdio.h>
786#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700787int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800788 ],
789 [AC_MSG_RESULT(yes)],
790 [
791 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100792 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
793 ])
Darren Tucker3b908f62004-04-14 15:26:39 +1000794 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
795 AC_TRY_COMPILE(
796 [#include <stdio.h>
797 #include <skey.h>],
798 [(void)skeychallenge(NULL,"name","",0);],
799 [AC_MSG_RESULT(yes)
800 AC_DEFINE(SKEYCHALLENGE_4ARG)],
801 [AC_MSG_RESULT(no)]
802 )
Damien Millerc547bf12001-02-16 10:18:12 +1100803 fi
804 ]
805)
806
807# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700808TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100809AC_ARG_WITH(tcp-wrappers,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100810 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100811 [
812 if test "x$withval" != "xno" ; then
813 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700814 saved_LDFLAGS="$LDFLAGS"
815 saved_CPPFLAGS="$CPPFLAGS"
816 if test -n "${withval}" -a "${withval}" != "yes"; then
817 if test -d "${withval}/lib"; then
818 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700819 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700820 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700821 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700822 fi
823 else
824 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700825 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700826 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700827 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700828 fi
829 fi
830 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700831 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700832 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700833 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700834 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700835 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800836 LIBWRAP="-lwrap"
837 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100838 AC_MSG_CHECKING(for libwrap)
839 AC_TRY_LINK(
840 [
Damien Miller0ac45002004-04-14 20:14:26 +1000841#include <sys/types.h>
842#include <sys/socket.h>
843#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +1100844#include <tcpd.h>
845 int deny_severity = 0, allow_severity = 0;
846 ],
847 [hosts_access(0);],
848 [
849 AC_MSG_RESULT(yes)
850 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800851 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700852 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100853 ],
854 [
855 AC_MSG_ERROR([*** libwrap missing])
856 ]
857 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800858 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100859 fi
860 ]
861)
862
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100863# Check whether user wants libedit support
864LIBEDIT_MSG="no"
865AC_ARG_WITH(libedit,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100866 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
Darren Tucker16bcc1c2004-11-07 20:14:34 +1100867 [ if test "x$withval" != "xno" ; then
868 AC_CHECK_LIB(edit, el_init,
869 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
870 LIBEDIT="-ledit -lcurses"
871 LIBEDIT_MSG="yes"
872 AC_SUBST(LIBEDIT)
873 ],
874 [], [-lcurses]
875 )
876 fi ]
877)
878
Damien Millerfe1f1432003-02-24 15:45:42 +1100879dnl Checks for library functions. Please keep in alphabetical order
880AC_CHECK_FUNCS(\
Darren Tucker60bd4092004-06-25 14:03:34 +1000881 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
Darren Tuckerad7646a2005-02-02 10:43:59 +1100882 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
883 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
884 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100885 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000886 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100887 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000888 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100889 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000890 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000891 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100892 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100893)
Tim Rice13aae5e2001-10-21 17:53:58 -0700894
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000895# IRIX has a const char return value for gai_strerror()
896AC_CHECK_FUNCS(gai_strerror,[
897 AC_DEFINE(HAVE_GAI_STRERROR)
898 AC_TRY_COMPILE([
899#include <sys/types.h>
900#include <sys/socket.h>
901#include <netdb.h>
902
903const char *gai_strerror(int);],[
904char *str;
905
906str = gai_strerror(0);],[
907 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
908 [Define if gai_strerror() returns const char *])])])
909
Damien Millercd6853c2003-01-28 11:33:42 +1100910AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
911
Darren Tuckerf1159b52003-07-07 19:44:01 +1000912dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000913AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000914AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000915
Darren Tuckerb2427c82003-09-10 15:22:44 +1000916dnl tcsendbreak might be a macro
917AC_CHECK_DECL(tcsendbreak,
918 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100919 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000920 [#include <termios.h>]
921)
922
Darren Tucker5bb14002004-04-23 18:53:10 +1000923AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
924
Darren Tucker2a6b0292003-12-31 14:59:17 +1100925AC_CHECK_FUNCS(setresuid, [
926 dnl Some platorms have setresuid that isn't implemented, test for this
927 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000928 AC_RUN_IFELSE(
929 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100930#include <stdlib.h>
931#include <errno.h>
932int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000933 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100934 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100935 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000936 AC_MSG_RESULT(not implemented)],
937 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100938 )
939])
Darren Tuckere937be32003-12-17 18:53:26 +1100940
Darren Tucker2a6b0292003-12-31 14:59:17 +1100941AC_CHECK_FUNCS(setresgid, [
942 dnl Some platorms have setresgid that isn't implemented, test for this
943 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +1000944 AC_RUN_IFELSE(
945 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +1100946#include <stdlib.h>
947#include <errno.h>
948int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000949 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +1100950 [AC_MSG_RESULT(yes)],
951 [AC_DEFINE(BROKEN_SETRESGID)
Darren Tuckera0c2b392004-09-11 23:26:37 +1000952 AC_MSG_RESULT(not implemented)],
953 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +1100954 )
955])
Darren Tuckere937be32003-12-17 18:53:26 +1100956
Damien Millerad833b32000-08-23 10:46:23 +1000957dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000958AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000959dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000960AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000961AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000962dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000963AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000964AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100965
Damien Millera8e06ce2003-11-21 23:48:55 +1100966AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100967 [AC_DEFINE(HAVE_DAEMON)],
968 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
969)
970
Damien Millera8e06ce2003-11-21 23:48:55 +1100971AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100972 [AC_DEFINE(HAVE_GETPAGESIZE)],
973 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
974)
975
Damien Millercb170cb2000-07-01 16:52:55 +1000976# Check for broken snprintf
977if test "x$ac_cv_func_snprintf" = "xyes" ; then
978 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000979 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000980 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +1000981#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700982int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +1000983 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100984 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000985 [
986 AC_MSG_RESULT(no)
987 AC_DEFINE(BROKEN_SNPRINTF)
988 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000989 ],
990 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +1000991 )
992fi
993
Damien Millerb4097182004-05-23 14:09:40 +1000994# Check for missing getpeereid (or equiv) support
995NO_PEERCHECK=""
996if test "x$ac_cv_func_getpeereid" != "xyes" ; then
997 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
998 AC_TRY_COMPILE(
999 [#include <sys/types.h>
1000 #include <sys/socket.h>],
1001 [int i = SO_PEERCRED;],
1002 [AC_MSG_RESULT(yes)],
1003 [AC_MSG_RESULT(no)
1004 NO_PEERCHECK=1]
1005 )
1006fi
1007
Damien Millere8328192003-01-07 15:18:32 +11001008dnl see whether mkstemp() requires XXXXXX
1009if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1010AC_MSG_CHECKING([for (overly) strict mkstemp])
1011AC_TRY_RUN(
1012 [
1013#include <stdlib.h>
1014main() { char template[]="conftest.mkstemp-test";
1015if (mkstemp(template) == -1)
1016 exit(1);
1017unlink(template); exit(0);
1018}
1019 ],
1020 [
1021 AC_MSG_RESULT(no)
1022 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001023 [
Damien Millere8328192003-01-07 15:18:32 +11001024 AC_MSG_RESULT(yes)
1025 AC_DEFINE(HAVE_STRICT_MKSTEMP)
1026 ],
1027 [
1028 AC_MSG_RESULT(yes)
1029 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001030 ]
Damien Millere8328192003-01-07 15:18:32 +11001031)
1032fi
1033
Darren Tucker70a3d552003-08-21 17:58:29 +10001034dnl make sure that openpty does not reacquire controlling terminal
1035if test ! -z "$check_for_openpty_ctty_bug"; then
1036 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
1037 AC_TRY_RUN(
1038 [
1039#include <stdio.h>
1040#include <sys/fcntl.h>
1041#include <sys/types.h>
1042#include <sys/wait.h>
1043
1044int
1045main()
1046{
1047 pid_t pid;
1048 int fd, ptyfd, ttyfd, status;
1049
1050 pid = fork();
1051 if (pid < 0) { /* failed */
1052 exit(1);
1053 } else if (pid > 0) { /* parent */
1054 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001055 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001056 exit(WEXITSTATUS(status));
1057 else
1058 exit(2);
1059 } else { /* child */
1060 close(0); close(1); close(2);
1061 setsid();
1062 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1063 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1064 if (fd >= 0)
1065 exit(3); /* Acquired ctty: broken */
1066 else
1067 exit(0); /* Did not acquire ctty: OK */
1068 }
1069}
1070 ],
1071 [
1072 AC_MSG_RESULT(yes)
1073 ],
1074 [
1075 AC_MSG_RESULT(no)
1076 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1077 ]
1078 )
1079fi
1080
Darren Tucker4398cf52004-04-06 21:39:02 +10001081if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1082 AC_MSG_CHECKING(if getaddrinfo seems to work)
1083 AC_TRY_RUN(
1084 [
1085#include <stdio.h>
1086#include <sys/socket.h>
1087#include <netdb.h>
1088#include <errno.h>
1089#include <netinet/in.h>
1090
1091#define TEST_PORT "2222"
1092
1093int
1094main(void)
1095{
1096 int err, sock;
1097 struct addrinfo *gai_ai, *ai, hints;
1098 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1099
1100 memset(&hints, 0, sizeof(hints));
1101 hints.ai_family = PF_UNSPEC;
1102 hints.ai_socktype = SOCK_STREAM;
1103 hints.ai_flags = AI_PASSIVE;
1104
1105 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1106 if (err != 0) {
1107 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1108 exit(1);
1109 }
1110
1111 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1112 if (ai->ai_family != AF_INET6)
1113 continue;
1114
1115 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1116 sizeof(ntop), strport, sizeof(strport),
1117 NI_NUMERICHOST|NI_NUMERICSERV);
1118
1119 if (err != 0) {
1120 if (err == EAI_SYSTEM)
1121 perror("getnameinfo EAI_SYSTEM");
1122 else
1123 fprintf(stderr, "getnameinfo failed: %s\n",
1124 gai_strerror(err));
1125 exit(2);
1126 }
1127
1128 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1129 if (sock < 0)
1130 perror("socket");
1131 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1132 if (errno == EBADF)
1133 exit(3);
1134 }
1135 }
1136 exit(0);
1137}
1138 ],
1139 [
1140 AC_MSG_RESULT(yes)
1141 ],
1142 [
1143 AC_MSG_RESULT(no)
1144 AC_DEFINE(BROKEN_GETADDRINFO)
1145 ]
1146 )
1147fi
1148
Darren Tucker691d5232005-02-15 21:45:57 +11001149if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1150 AC_MSG_CHECKING(if getaddrinfo seems to work)
1151 AC_TRY_RUN(
1152 [
1153#include <stdio.h>
1154#include <sys/socket.h>
1155#include <netdb.h>
1156#include <errno.h>
1157#include <netinet/in.h>
1158
1159#define TEST_PORT "2222"
1160
1161int
1162main(void)
1163{
1164 int err, sock;
1165 struct addrinfo *gai_ai, *ai, hints;
1166 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1167
1168 memset(&hints, 0, sizeof(hints));
1169 hints.ai_family = PF_UNSPEC;
1170 hints.ai_socktype = SOCK_STREAM;
1171 hints.ai_flags = AI_PASSIVE;
1172
1173 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1174 if (err != 0) {
1175 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1176 exit(1);
1177 }
1178
1179 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1180 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1181 continue;
1182
1183 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1184 sizeof(ntop), strport, sizeof(strport),
1185 NI_NUMERICHOST|NI_NUMERICSERV);
1186
1187 if (ai->ai_family == AF_INET && err != 0) {
1188 perror("getnameinfo");
1189 exit(2);
1190 }
1191 }
1192 exit(0);
1193}
1194 ],
1195 [
1196 AC_MSG_RESULT(yes)
1197 AC_DEFINE(AIX_GETNAMEINFO_HACK, [],
1198[Define if you have a getaddrinfo that fails for the all-zeros IPv6 address])
1199 ],
1200 [
1201 AC_MSG_RESULT(no)
1202 AC_DEFINE(BROKEN_GETADDRINFO)
1203 ]
1204 )
1205fi
1206
Darren Tuckera56f1912004-11-02 20:30:54 +11001207if test "x$check_for_conflicting_getspnam" = "x1"; then
1208 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1209 AC_COMPILE_IFELSE(
1210 [
1211#include <shadow.h>
1212int main(void) {exit(0);}
1213 ],
1214 [
1215 AC_MSG_RESULT(no)
1216 ],
1217 [
1218 AC_MSG_RESULT(yes)
1219 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1220 [Conflicting defs for getspnam])
1221 ]
1222 )
1223fi
1224
Damien Miller606f8802000-09-16 15:39:56 +11001225AC_FUNC_GETPGRP
1226
Damien Millera64b57a2001-01-17 10:44:13 +11001227# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001228PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001229AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001230 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001231 [
Damien Millera64b57a2001-01-17 10:44:13 +11001232 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001233 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1234 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001235 AC_MSG_ERROR([PAM headers not found])
1236 fi
1237
1238 AC_CHECK_LIB(dl, dlopen, , )
1239 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1240 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001241 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001242
Damien Millera64b57a2001-01-17 10:44:13 +11001243 PAM_MSG="yes"
1244
1245 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001246 if test $ac_cv_lib_dl_dlopen = yes; then
1247 LIBPAM="-lpam -ldl"
1248 else
1249 LIBPAM="-lpam"
1250 fi
1251 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001252 fi
1253 ]
1254)
Damien Millera22ba012000-03-02 23:09:20 +11001255
Damien Millera64b57a2001-01-17 10:44:13 +11001256# Check for older PAM
1257if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001258 # Check PAM strerror arguments (old PAM)
1259 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1260 AC_TRY_COMPILE(
1261 [
Damien Miller81171112000-04-23 11:14:01 +10001262#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001263#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001264#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001265#elif defined (HAVE_PAM_PAM_APPL_H)
1266#include <pam/pam_appl.h>
1267#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001268 ],
1269 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001270 [AC_MSG_RESULT(no)],
1271 [
1272 AC_DEFINE(HAVE_OLD_PAM)
1273 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001274 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001275 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001276 )
Damien Millera22ba012000-03-02 23:09:20 +11001277fi
1278
Tim Riceaef73712002-05-11 13:17:42 -07001279# Search for OpenSSL
1280saved_CPPFLAGS="$CPPFLAGS"
1281saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001282AC_ARG_WITH(ssl-dir,
1283 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1284 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001285 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001286 case "$withval" in
1287 # Relative paths
1288 ./*|../*) withval="`pwd`/$withval"
1289 esac
Tim Riceaef73712002-05-11 13:17:42 -07001290 if test -d "$withval/lib"; then
1291 if test -n "${need_dash_r}"; then
1292 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1293 else
1294 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1295 fi
1296 else
1297 if test -n "${need_dash_r}"; then
1298 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1299 else
1300 LDFLAGS="-L${withval} ${LDFLAGS}"
1301 fi
1302 fi
1303 if test -d "$withval/include"; then
1304 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1305 else
1306 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1307 fi
Damien Millera22ba012000-03-02 23:09:20 +11001308 fi
1309 ]
1310)
Tim Rice3d5352e2004-02-12 09:27:21 -08001311LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001312AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001313 [
Tim Riceaef73712002-05-11 13:17:42 -07001314 dnl Check default openssl install dir
1315 if test -n "${need_dash_r}"; then
1316 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001317 else
Tim Riceaef73712002-05-11 13:17:42 -07001318 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001319 fi
Tim Riceaef73712002-05-11 13:17:42 -07001320 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1321 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1322 [
1323 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1324 ]
1325 )
1326 ]
1327)
1328
Tim Riced730b782002-08-13 18:52:10 -07001329# Determine OpenSSL header version
1330AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001331AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001332 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001333#include <stdio.h>
1334#include <string.h>
1335#include <openssl/opensslv.h>
1336#define DATA "conftest.sslincver"
1337int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001338 FILE *fd;
1339 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001340
Damien Millera8e06ce2003-11-21 23:48:55 +11001341 fd = fopen(DATA,"w");
1342 if(fd == NULL)
1343 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001344
1345 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1346 exit(1);
1347
1348 exit(0);
1349}
Darren Tucker623d92f2004-09-12 22:36:15 +10001350 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001351 [
1352 ssl_header_ver=`cat conftest.sslincver`
1353 AC_MSG_RESULT($ssl_header_ver)
1354 ],
1355 [
1356 AC_MSG_RESULT(not found)
1357 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001358 ],
1359 [
1360 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001361 ]
1362)
1363
1364# Determine OpenSSL library version
1365AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001366AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001367 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001368#include <stdio.h>
1369#include <string.h>
1370#include <openssl/opensslv.h>
1371#include <openssl/crypto.h>
1372#define DATA "conftest.ssllibver"
1373int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001374 FILE *fd;
1375 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001376
Damien Millera8e06ce2003-11-21 23:48:55 +11001377 fd = fopen(DATA,"w");
1378 if(fd == NULL)
1379 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001380
1381 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1382 exit(1);
1383
1384 exit(0);
1385}
Darren Tucker623d92f2004-09-12 22:36:15 +10001386 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001387 [
1388 ssl_library_ver=`cat conftest.ssllibver`
1389 AC_MSG_RESULT($ssl_library_ver)
1390 ],
1391 [
1392 AC_MSG_RESULT(not found)
1393 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001394 ],
1395 [
1396 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001397 ]
1398)
Damien Millera22ba012000-03-02 23:09:20 +11001399
Damien Millerec932372002-01-22 22:16:03 +11001400# Sanity check OpenSSL headers
1401AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001402AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001403 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001404#include <string.h>
1405#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001406int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001407 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001408 [
1409 AC_MSG_RESULT(yes)
1410 ],
1411 [
1412 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001413 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1414Check config.log for details.
1415Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001416 ],
1417 [
1418 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001419 ]
1420)
1421
Tim Rice3d5352e2004-02-12 09:27:21 -08001422# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1423# because the system crypt() is more featureful.
1424if test "x$check_for_libcrypt_before" = "x1"; then
1425 AC_CHECK_LIB(crypt, crypt)
1426fi
1427
Damien Millera8e06ce2003-11-21 23:48:55 +11001428# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001429# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001430if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001431 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001432fi
1433
Damien Miller6c21c512002-01-22 21:57:53 +11001434
1435### Configure cryptographic random number support
1436
1437# Check wheter OpenSSL seeds itself
1438AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001439AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001440 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001441#include <string.h>
1442#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001443int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001444 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001445 [
1446 OPENSSL_SEEDS_ITSELF=yes
1447 AC_MSG_RESULT(yes)
1448 ],
1449 [
1450 AC_MSG_RESULT(no)
1451 # Default to use of the rand helper if OpenSSL doesn't
1452 # seed itself
1453 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001454 ],
1455 [
1456 AC_MSG_WARN([cross compiling: assuming yes])
1457 # This is safe, since all recent OpenSSL versions will
1458 # complain at runtime if not seeded correctly.
1459 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001460 ]
1461)
1462
1463
1464# Do we want to force the use of the rand helper?
1465AC_ARG_WITH(rand-helper,
1466 [ --with-rand-helper Use subprocess to gather strong randomness ],
1467 [
1468 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001469 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001470 # the previous test showed it to be unseeded.
1471 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1472 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1473 OPENSSL_SEEDS_ITSELF=yes
1474 USE_RAND_HELPER=""
1475 fi
1476 else
1477 USE_RAND_HELPER=yes
1478 fi
1479 ],
1480)
1481
1482# Which randomness source do we use?
1483if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1484 # OpenSSL only
1485 AC_DEFINE(OPENSSL_PRNG_ONLY)
1486 RAND_MSG="OpenSSL internal ONLY"
1487 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001488elif test ! -z "$USE_RAND_HELPER" ; then
1489 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001490 RAND_MSG="ssh-rand-helper"
1491 INSTALL_SSH_RAND_HELPER="yes"
1492fi
1493AC_SUBST(INSTALL_SSH_RAND_HELPER)
1494
1495### Configuration of ssh-rand-helper
1496
1497# PRNGD TCP socket
1498AC_ARG_WITH(prngd-port,
1499 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1500 [
Damien Millere996d722002-01-23 11:20:59 +11001501 case "$withval" in
1502 no)
1503 withval=""
1504 ;;
1505 [[0-9]]*)
1506 ;;
1507 *)
1508 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1509 ;;
1510 esac
1511 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001512 PRNGD_PORT="$withval"
1513 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1514 fi
1515 ]
1516)
1517
1518# PRNGD Unix domain socket
1519AC_ARG_WITH(prngd-socket,
1520 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1521 [
Damien Millere996d722002-01-23 11:20:59 +11001522 case "$withval" in
1523 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001524 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001525 ;;
1526 no)
1527 withval=""
1528 ;;
1529 /*)
1530 ;;
1531 *)
1532 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1533 ;;
1534 esac
1535
1536 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001537 if test ! -z "$PRNGD_PORT" ; then
1538 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1539 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001540 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001541 AC_MSG_WARN(Entropy socket is not readable)
1542 fi
1543 PRNGD_SOCKET="$withval"
1544 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1545 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001546 ],
1547 [
1548 # Check for existing socket only if we don't have a random device already
1549 if test "$USE_RAND_HELPER" = yes ; then
1550 AC_MSG_CHECKING(for PRNGD/EGD socket)
1551 # Insert other locations here
1552 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1553 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1554 PRNGD_SOCKET="$sock"
1555 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1556 break;
1557 fi
1558 done
1559 if test ! -z "$PRNGD_SOCKET" ; then
1560 AC_MSG_RESULT($PRNGD_SOCKET)
1561 else
1562 AC_MSG_RESULT(not found)
1563 fi
1564 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001565 ]
1566)
1567
1568# Change default command timeout for hashing entropy source
1569entropy_timeout=200
1570AC_ARG_WITH(entropy-timeout,
1571 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1572 [
1573 if test "x$withval" != "xno" ; then
1574 entropy_timeout=$withval
1575 fi
1576 ]
1577)
Damien Miller6c21c512002-01-22 21:57:53 +11001578AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1579
Damien Millerd3f6ad22002-06-25 10:24:47 +10001580SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001581AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001582 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001583 [
1584 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001585 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001586 fi
1587 ]
1588)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001589AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1590AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001591
Tim Rice88f2ab52002-03-17 12:17:34 -08001592# We do this little dance with the search path to insure
1593# that programs that we select for use by installed programs
1594# (which may be run by the super-user) come from trusted
1595# locations before they come from the user's private area.
1596# This should help avoid accidentally configuring some
1597# random version of a program in someone's personal bin.
1598
1599OPATH=$PATH
1600PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001601test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001602test -d /sbin && PATH=$PATH:/sbin
1603test -d /usr/sbin && PATH=$PATH:/usr/sbin
1604PATH=$PATH:/etc:$OPATH
1605
Damien Millera8e06ce2003-11-21 23:48:55 +11001606# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001607OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1608OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1609OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1610OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1611OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1612OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1613OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1614OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1615OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1616OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1617OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1618OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1619OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1620OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1621OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1622OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001623# restore PATH
1624PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001625
1626# Where does ssh-rand-helper get its randomness from?
1627INSTALL_SSH_PRNG_CMDS=""
1628if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1629 if test ! -z "$PRNGD_PORT" ; then
1630 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1631 elif test ! -z "$PRNGD_SOCKET" ; then
1632 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1633 else
1634 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1635 RAND_HELPER_CMDHASH=yes
1636 INSTALL_SSH_PRNG_CMDS="yes"
1637 fi
1638fi
1639AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1640
1641
Ben Lindstromb5628642000-10-18 00:02:25 +00001642# Cheap hack to ensure NEWS-OS libraries are arranged right.
1643if test ! -z "$SONY" ; then
1644 LIBS="$LIBS -liberty";
1645fi
1646
Damien Millera22ba012000-03-02 23:09:20 +11001647# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001648AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001649AC_CHECK_SIZEOF(short int, 2)
1650AC_CHECK_SIZEOF(int, 4)
1651AC_CHECK_SIZEOF(long int, 4)
1652AC_CHECK_SIZEOF(long long int, 8)
1653
Damien Millerfa2bb692002-04-23 23:22:25 +10001654# Sanity check long long for some platforms (AIX)
1655if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1656 ac_cv_sizeof_long_long_int=0
1657fi
1658
Damien Millera22ba012000-03-02 23:09:20 +11001659# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001660AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1661 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001662 [ #include <sys/types.h> ],
1663 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001664 [ ac_cv_have_u_int="yes" ],
1665 [ ac_cv_have_u_int="no" ]
1666 )
1667])
1668if test "x$ac_cv_have_u_int" = "xyes" ; then
1669 AC_DEFINE(HAVE_U_INT)
1670 have_u_int=1
1671fi
1672
Damien Miller61e50f12000-05-08 20:49:37 +10001673AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1674 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001675 [ #include <sys/types.h> ],
1676 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001677 [ ac_cv_have_intxx_t="yes" ],
1678 [ ac_cv_have_intxx_t="no" ]
1679 )
1680])
1681if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1682 AC_DEFINE(HAVE_INTXX_T)
1683 have_intxx_t=1
1684fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001685
1686if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001687 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001688then
1689 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1690 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001691 [ #include <stdint.h> ],
1692 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001693 [
1694 AC_DEFINE(HAVE_INTXX_T)
1695 AC_MSG_RESULT(yes)
1696 ],
1697 [ AC_MSG_RESULT(no) ]
1698 )
1699fi
1700
Damien Miller578783e2000-09-23 14:12:24 +11001701AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1702 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001703 [
1704#include <sys/types.h>
1705#ifdef HAVE_STDINT_H
1706# include <stdint.h>
1707#endif
1708#include <sys/socket.h>
1709#ifdef HAVE_SYS_BITYPES_H
1710# include <sys/bitypes.h>
1711#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001712 ],
1713 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001714 [ ac_cv_have_int64_t="yes" ],
1715 [ ac_cv_have_int64_t="no" ]
1716 )
1717])
1718if test "x$ac_cv_have_int64_t" = "xyes" ; then
1719 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001720fi
1721
Damien Miller61e50f12000-05-08 20:49:37 +10001722AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1723 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001724 [ #include <sys/types.h> ],
1725 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001726 [ ac_cv_have_u_intxx_t="yes" ],
1727 [ ac_cv_have_u_intxx_t="no" ]
1728 )
1729])
1730if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1731 AC_DEFINE(HAVE_U_INTXX_T)
1732 have_u_intxx_t=1
1733fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001734
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001735if test -z "$have_u_intxx_t" ; then
1736 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1737 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001738 [ #include <sys/socket.h> ],
1739 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001740 [
1741 AC_DEFINE(HAVE_U_INTXX_T)
1742 AC_MSG_RESULT(yes)
1743 ],
1744 [ AC_MSG_RESULT(no) ]
1745 )
1746fi
1747
Damien Miller578783e2000-09-23 14:12:24 +11001748AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1749 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001750 [ #include <sys/types.h> ],
1751 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001752 [ ac_cv_have_u_int64_t="yes" ],
1753 [ ac_cv_have_u_int64_t="no" ]
1754 )
1755])
1756if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1757 AC_DEFINE(HAVE_U_INT64_T)
1758 have_u_int64_t=1
1759fi
1760
Tim Rice4cec93f2002-02-26 08:40:48 -08001761if test -z "$have_u_int64_t" ; then
1762 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1763 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001764 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001765 [ u_int64_t a; a = 1],
1766 [
1767 AC_DEFINE(HAVE_U_INT64_T)
1768 AC_MSG_RESULT(yes)
1769 ],
1770 [ AC_MSG_RESULT(no) ]
1771 )
1772fi
1773
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001774if test -z "$have_u_intxx_t" ; then
1775 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1776 AC_TRY_COMPILE(
1777 [
1778#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001779 ],
1780 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001781 [ ac_cv_have_uintxx_t="yes" ],
1782 [ ac_cv_have_uintxx_t="no" ]
1783 )
1784 ])
1785 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1786 AC_DEFINE(HAVE_UINTXX_T)
1787 fi
1788fi
1789
1790if test -z "$have_uintxx_t" ; then
1791 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1792 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001793 [ #include <stdint.h> ],
1794 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001795 [
1796 AC_DEFINE(HAVE_UINTXX_T)
1797 AC_MSG_RESULT(yes)
1798 ],
1799 [ AC_MSG_RESULT(no) ]
1800 )
1801fi
1802
Damien Milleredb82922000-06-20 13:25:52 +10001803if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001804 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001805then
1806 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1807 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001808 [
1809#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001810 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001811 [
Damien Miller70494d12000-04-03 15:57:06 +10001812 int8_t a; int16_t b; int32_t c;
1813 u_int8_t e; u_int16_t f; u_int32_t g;
1814 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001815 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001816 [
1817 AC_DEFINE(HAVE_U_INTXX_T)
1818 AC_DEFINE(HAVE_INTXX_T)
1819 AC_MSG_RESULT(yes)
1820 ],
1821 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001822 )
Damien Millerb29ea912000-01-15 14:12:03 +11001823fi
1824
Damien Miller58be7382001-09-15 21:31:54 +10001825
1826AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1827 AC_TRY_COMPILE(
1828 [
1829#include <sys/types.h>
1830 ],
1831 [ u_char foo; foo = 125; ],
1832 [ ac_cv_have_u_char="yes" ],
1833 [ ac_cv_have_u_char="no" ]
1834 )
1835])
1836if test "x$ac_cv_have_u_char" = "xyes" ; then
1837 AC_DEFINE(HAVE_U_CHAR)
1838fi
1839
Tim Rice13aae5e2001-10-21 17:53:58 -07001840TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001841
Tim Rice200a5c02002-02-26 22:12:34 -08001842AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001843
Damien Miller61e50f12000-05-08 20:49:37 +10001844AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1845 AC_TRY_COMPILE(
1846 [
1847#include <sys/types.h>
1848 ],
1849 [ size_t foo; foo = 1235; ],
1850 [ ac_cv_have_size_t="yes" ],
1851 [ ac_cv_have_size_t="no" ]
1852 )
1853])
1854if test "x$ac_cv_have_size_t" = "xyes" ; then
1855 AC_DEFINE(HAVE_SIZE_T)
1856fi
Damien Miller95058511999-12-29 10:36:45 +11001857
Damien Miller615f9392000-05-17 22:53:33 +10001858AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1859 AC_TRY_COMPILE(
1860 [
1861#include <sys/types.h>
1862 ],
1863 [ ssize_t foo; foo = 1235; ],
1864 [ ac_cv_have_ssize_t="yes" ],
1865 [ ac_cv_have_ssize_t="no" ]
1866 )
1867])
1868if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1869 AC_DEFINE(HAVE_SSIZE_T)
1870fi
1871
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001872AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1873 AC_TRY_COMPILE(
1874 [
1875#include <time.h>
1876 ],
1877 [ clock_t foo; foo = 1235; ],
1878 [ ac_cv_have_clock_t="yes" ],
1879 [ ac_cv_have_clock_t="no" ]
1880 )
1881])
1882if test "x$ac_cv_have_clock_t" = "xyes" ; then
1883 AC_DEFINE(HAVE_CLOCK_T)
1884fi
1885
Damien Millerb54b40e2000-06-23 08:23:34 +10001886AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1887 AC_TRY_COMPILE(
1888 [
1889#include <sys/types.h>
1890#include <sys/socket.h>
1891 ],
1892 [ sa_family_t foo; foo = 1235; ],
1893 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001894 [ AC_TRY_COMPILE(
1895 [
1896#include <sys/types.h>
1897#include <sys/socket.h>
1898#include <netinet/in.h>
1899 ],
1900 [ sa_family_t foo; foo = 1235; ],
1901 [ ac_cv_have_sa_family_t="yes" ],
1902
Damien Millerb54b40e2000-06-23 08:23:34 +10001903 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001904 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001905 )
1906])
1907if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1908 AC_DEFINE(HAVE_SA_FAMILY_T)
1909fi
1910
Damien Miller0f91b4e2000-06-18 15:43:25 +10001911AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1912 AC_TRY_COMPILE(
1913 [
1914#include <sys/types.h>
1915 ],
1916 [ pid_t foo; foo = 1235; ],
1917 [ ac_cv_have_pid_t="yes" ],
1918 [ ac_cv_have_pid_t="no" ]
1919 )
1920])
1921if test "x$ac_cv_have_pid_t" = "xyes" ; then
1922 AC_DEFINE(HAVE_PID_T)
1923fi
1924
1925AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1926 AC_TRY_COMPILE(
1927 [
1928#include <sys/types.h>
1929 ],
1930 [ mode_t foo; foo = 1235; ],
1931 [ ac_cv_have_mode_t="yes" ],
1932 [ ac_cv_have_mode_t="no" ]
1933 )
1934])
1935if test "x$ac_cv_have_mode_t" = "xyes" ; then
1936 AC_DEFINE(HAVE_MODE_T)
1937fi
1938
Damien Miller61e50f12000-05-08 20:49:37 +10001939
1940AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1941 AC_TRY_COMPILE(
1942 [
Damien Miller81171112000-04-23 11:14:01 +10001943#include <sys/types.h>
1944#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001945 ],
1946 [ struct sockaddr_storage s; ],
1947 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1948 [ ac_cv_have_struct_sockaddr_storage="no" ]
1949 )
1950])
1951if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1952 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1953fi
Damien Miller34132e52000-01-14 15:45:46 +11001954
Damien Miller61e50f12000-05-08 20:49:37 +10001955AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1956 AC_TRY_COMPILE(
1957 [
Damien Miller7b22d652000-06-18 14:07:04 +10001958#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001959#include <netinet/in.h>
1960 ],
1961 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1962 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1963 [ ac_cv_have_struct_sockaddr_in6="no" ]
1964 )
1965])
1966if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1967 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1968fi
Damien Miller34132e52000-01-14 15:45:46 +11001969
Damien Miller61e50f12000-05-08 20:49:37 +10001970AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1971 AC_TRY_COMPILE(
1972 [
Damien Miller7b22d652000-06-18 14:07:04 +10001973#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001974#include <netinet/in.h>
1975 ],
1976 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1977 [ ac_cv_have_struct_in6_addr="yes" ],
1978 [ ac_cv_have_struct_in6_addr="no" ]
1979 )
1980])
1981if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1982 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1983fi
Damien Miller34132e52000-01-14 15:45:46 +11001984
Damien Miller61e50f12000-05-08 20:49:37 +10001985AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1986 AC_TRY_COMPILE(
1987 [
Damien Miller81171112000-04-23 11:14:01 +10001988#include <sys/types.h>
1989#include <sys/socket.h>
1990#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001991 ],
1992 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1993 [ ac_cv_have_struct_addrinfo="yes" ],
1994 [ ac_cv_have_struct_addrinfo="no" ]
1995 )
1996])
1997if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1998 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1999fi
2000
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002001AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2002 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002003 [ #include <sys/time.h> ],
2004 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002005 [ ac_cv_have_struct_timeval="yes" ],
2006 [ ac_cv_have_struct_timeval="no" ]
2007 )
2008])
2009if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
2010 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
2011 have_struct_timeval=1
2012fi
2013
Tim Rice4e4dc562003-03-18 10:21:40 -08002014AC_CHECK_TYPES(struct timespec)
2015
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002016# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002017if test "x$ac_cv_have_int64_t" = "xno" -a \
2018 "x$ac_cv_sizeof_long_int" != "x8" -a \
2019 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002020 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2021 echo "an alternative compiler (I.E., GCC) before continuing."
2022 echo ""
2023 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08002024else
2025dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10002026 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10002027 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08002028#include <stdio.h>
2029#include <string.h>
2030#ifdef HAVE_SNPRINTF
2031main()
2032{
2033 char buf[50];
2034 char expected_out[50];
2035 int mazsize = 50 ;
2036#if (SIZEOF_LONG_INT == 8)
2037 long int num = 0x7fffffffffffffff;
2038#else
Kevin Steves6482ec82001-07-15 02:09:28 +00002039 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08002040#endif
2041 strcpy(expected_out, "9223372036854775807");
2042 snprintf(buf, mazsize, "%lld", num);
2043 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11002044 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08002045 exit(0);
2046}
2047#else
2048main() { exit(0); }
2049#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10002050 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10002051 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08002052 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002053fi
2054
Damien Miller78315eb2000-09-29 23:01:36 +11002055dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10002056OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2057OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2058OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2059OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2060OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002061OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002062OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2063OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002064OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002065OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2066OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2067OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2068OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002069OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2070OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2071OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2072OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002073
2074AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00002075
Damien Miller61e50f12000-05-08 20:49:37 +10002076AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2077 ac_cv_have_ss_family_in_struct_ss, [
2078 AC_TRY_COMPILE(
2079 [
Damien Miller81171112000-04-23 11:14:01 +10002080#include <sys/types.h>
2081#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002082 ],
2083 [ struct sockaddr_storage s; s.ss_family = 1; ],
2084 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2085 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2086 )
2087])
2088if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
2089 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
2090fi
2091
Damien Miller61e50f12000-05-08 20:49:37 +10002092AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2093 ac_cv_have___ss_family_in_struct_ss, [
2094 AC_TRY_COMPILE(
2095 [
Damien Miller81171112000-04-23 11:14:01 +10002096#include <sys/types.h>
2097#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002098 ],
2099 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2100 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2101 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2102 )
2103])
2104if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
2105 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
2106fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002107
Damien Millerad833b32000-08-23 10:46:23 +10002108AC_CACHE_CHECK([for pw_class field in struct passwd],
2109 ac_cv_have_pw_class_in_struct_passwd, [
2110 AC_TRY_COMPILE(
2111 [
Damien Millerad833b32000-08-23 10:46:23 +10002112#include <pwd.h>
2113 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002114 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002115 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2116 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2117 )
2118])
2119if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
2120 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
2121fi
2122
Kevin Steves82456952001-06-22 21:14:18 +00002123AC_CACHE_CHECK([for pw_expire field in struct passwd],
2124 ac_cv_have_pw_expire_in_struct_passwd, [
2125 AC_TRY_COMPILE(
2126 [
2127#include <pwd.h>
2128 ],
2129 [ struct passwd p; p.pw_expire = 0; ],
2130 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2131 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2132 )
2133])
2134if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
2135 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
2136fi
2137
2138AC_CACHE_CHECK([for pw_change field in struct passwd],
2139 ac_cv_have_pw_change_in_struct_passwd, [
2140 AC_TRY_COMPILE(
2141 [
2142#include <pwd.h>
2143 ],
2144 [ struct passwd p; p.pw_change = 0; ],
2145 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2146 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2147 )
2148])
2149if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
2150 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
2151fi
Damien Miller61e50f12000-05-08 20:49:37 +10002152
Tim Rice28bbb0c2002-05-27 17:37:32 -07002153dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002154AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2155 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002156 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002157 [
Tim Riceae49fe62002-04-12 10:26:21 -07002158#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002159#include <sys/socket.h>
2160#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002161int main() {
2162#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002163#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002164exit(1);
2165#endif
2166struct msghdr m;
2167m.msg_accrights = 0;
2168exit(0);
2169}
Kevin Steves939c9db2002-03-22 17:23:25 +00002170 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002171 [ ac_cv_have_accrights_in_msghdr="yes" ],
2172 [ ac_cv_have_accrights_in_msghdr="no" ]
2173 )
2174])
2175if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2176 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2177fi
2178
Kevin Stevesa44e0352002-04-07 16:18:03 +00002179AC_CACHE_CHECK([for msg_control field in struct msghdr],
2180 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002181 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002182 [
Tim Riceae49fe62002-04-12 10:26:21 -07002183#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002184#include <sys/socket.h>
2185#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002186int main() {
2187#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002188#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002189exit(1);
2190#endif
2191struct msghdr m;
2192m.msg_control = 0;
2193exit(0);
2194}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002195 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002196 [ ac_cv_have_control_in_msghdr="yes" ],
2197 [ ac_cv_have_control_in_msghdr="no" ]
2198 )
2199])
2200if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2201 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2202fi
2203
Damien Miller61e50f12000-05-08 20:49:37 +10002204AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002205 AC_TRY_LINK([],
2206 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002207 [ ac_cv_libc_defines___progname="yes" ],
2208 [ ac_cv_libc_defines___progname="no" ]
2209 )
2210])
2211if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2212 AC_DEFINE(HAVE___PROGNAME)
2213fi
2214
Kevin Steves4846f4a2002-03-22 18:19:53 +00002215AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2216 AC_TRY_LINK([
2217#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002218],
2219 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002220 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2221 [ ac_cv_cc_implements___FUNCTION__="no" ]
2222 )
2223])
2224if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2225 AC_DEFINE(HAVE___FUNCTION__)
2226fi
2227
2228AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2229 AC_TRY_LINK([
2230#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002231],
2232 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002233 [ ac_cv_cc_implements___func__="yes" ],
2234 [ ac_cv_cc_implements___func__="no" ]
2235 )
2236])
2237if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2238 AC_DEFINE(HAVE___func__)
2239fi
2240
Damien Miller4f8e6692001-07-14 13:22:53 +10002241AC_CACHE_CHECK([whether getopt has optreset support],
2242 ac_cv_have_getopt_optreset, [
2243 AC_TRY_LINK(
2244 [
2245#include <getopt.h>
2246 ],
2247 [ extern int optreset; optreset = 0; ],
2248 [ ac_cv_have_getopt_optreset="yes" ],
2249 [ ac_cv_have_getopt_optreset="no" ]
2250 )
2251])
2252if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2253 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2254fi
Damien Millera22ba012000-03-02 23:09:20 +11002255
Damien Millerecbb26d2000-07-15 14:59:14 +10002256AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002257 AC_TRY_LINK([],
2258 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002259 [ ac_cv_libc_defines_sys_errlist="yes" ],
2260 [ ac_cv_libc_defines_sys_errlist="no" ]
2261 )
2262])
2263if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2264 AC_DEFINE(HAVE_SYS_ERRLIST)
2265fi
2266
2267
Damien Miller11fa2cc2000-08-16 10:35:58 +10002268AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002269 AC_TRY_LINK([],
2270 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002271 [ ac_cv_libc_defines_sys_nerr="yes" ],
2272 [ ac_cv_libc_defines_sys_nerr="no" ]
2273 )
2274])
2275if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2276 AC_DEFINE(HAVE_SYS_NERR)
2277fi
2278
Damien Millera8e06ce2003-11-21 23:48:55 +11002279SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002280# Check whether user wants sectok support
2281AC_ARG_WITH(sectok,
2282 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002283 [
2284 if test "x$withval" != "xno" ; then
2285 if test "x$withval" != "xyes" ; then
2286 CPPFLAGS="$CPPFLAGS -I${withval}"
2287 LDFLAGS="$LDFLAGS -L${withval}"
2288 if test ! -z "$need_dash_r" ; then
2289 LDFLAGS="$LDFLAGS -R${withval}"
2290 fi
2291 if test ! -z "$blibpath" ; then
2292 blibpath="$blibpath:${withval}"
2293 fi
2294 fi
2295 AC_CHECK_HEADERS(sectok.h)
2296 if test "$ac_cv_header_sectok_h" != yes; then
2297 AC_MSG_ERROR(Can't find sectok.h)
2298 fi
2299 AC_CHECK_LIB(sectok, sectok_open)
2300 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2301 AC_MSG_ERROR(Can't find libsectok)
2302 fi
2303 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002304 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002305 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002306 fi
2307 ]
2308)
2309
2310# Check whether user wants OpenSC support
2311AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002312 AC_HELP_STRING([--with-opensc=PFX],
2313 [Enable smartcard support using OpenSC]),
2314 opensc_config_prefix="$withval", opensc_config_prefix="")
2315if test x$opensc_config_prefix != x ; then
2316 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2317 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2318 if test "$OPENSC_CONFIG" != "no"; then
2319 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2320 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2321 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2322 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2323 AC_DEFINE(SMARTCARD)
2324 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002325 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002326 fi
2327fi
Damien Miller85de5802001-09-18 14:01:11 +10002328
Darren Tucker5f88d342003-10-15 16:57:57 +10002329# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002330AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002331 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002332 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002333 # Needed by our getrrsetbyname()
2334 AC_SEARCH_LIBS(res_query, resolv)
2335 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002336 AC_MSG_CHECKING(if res_query will link)
2337 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2338 [AC_MSG_RESULT(no)
2339 saved_LIBS="$LIBS"
2340 LIBS="$LIBS -lresolv"
2341 AC_MSG_CHECKING(for res_query in -lresolv)
2342 AC_LINK_IFELSE([
2343#include <resolv.h>
2344int main()
2345{
2346 res_query (0, 0, 0, 0, 0);
2347 return 0;
2348}
2349 ],
2350 [LIBS="$LIBS -lresolv"
2351 AC_MSG_RESULT(yes)],
2352 [LIBS="$saved_LIBS"
2353 AC_MSG_RESULT(no)])
2354 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002355 AC_CHECK_FUNCS(_getshort _getlong)
2356 AC_CHECK_MEMBER(HEADER.ad,
2357 [AC_DEFINE(HAVE_HEADER_AD)],,
2358 [#include <arpa/nameser.h>])
2359 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002360
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002361# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002362KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002363AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002364 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002365 [ if test "x$withval" != "xno" ; then
2366 if test "x$withval" = "xyes" ; then
2367 KRB5ROOT="/usr/local"
2368 else
2369 KRB5ROOT=${withval}
2370 fi
2371
2372 AC_DEFINE(KRB5)
2373 KRB5_MSG="yes"
2374
2375 AC_MSG_CHECKING(for krb5-config)
2376 if test -x $KRB5ROOT/bin/krb5-config ; then
2377 KRB5CONF=$KRB5ROOT/bin/krb5-config
2378 AC_MSG_RESULT($KRB5CONF)
2379
2380 AC_MSG_CHECKING(for gssapi support)
2381 if $KRB5CONF | grep gssapi >/dev/null ; then
2382 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002383 AC_DEFINE(GSSAPI)
2384 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002385 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002386 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002387 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002388 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002389 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2390 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002391 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002392 AC_MSG_CHECKING(whether we are using Heimdal)
2393 AC_TRY_COMPILE([ #include <krb5.h> ],
2394 [ char *tmp = heimdal_version; ],
2395 [ AC_MSG_RESULT(yes)
2396 AC_DEFINE(HEIMDAL) ],
2397 AC_MSG_RESULT(no)
2398 )
2399 else
2400 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002401 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002402 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002403 AC_MSG_CHECKING(whether we are using Heimdal)
2404 AC_TRY_COMPILE([ #include <krb5.h> ],
2405 [ char *tmp = heimdal_version; ],
2406 [ AC_MSG_RESULT(yes)
2407 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10002408 K5LIBS="-lkrb5 -ldes"
2409 K5LIBS="$K5LIBS -lcom_err -lasn1"
2410 AC_CHECK_LIB(roken, net_write,
2411 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11002412 ],
2413 [ AC_MSG_RESULT(no)
2414 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2415 ]
2416 )
Damien Miller200d0a72003-06-30 19:21:36 +10002417 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002418
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002419 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2420 [ AC_DEFINE(GSSAPI)
2421 K5LIBS="-lgssapi $K5LIBS" ],
2422 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2423 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002424 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002425 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2426 $K5LIBS)
2427 ],
2428 $K5LIBS)
2429
2430 AC_CHECK_HEADER(gssapi.h, ,
2431 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002432 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002433 AC_CHECK_HEADERS(gssapi.h, ,
2434 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002435 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002436 ]
2437 )
2438
2439 oldCPP="$CPPFLAGS"
2440 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2441 AC_CHECK_HEADER(gssapi_krb5.h, ,
2442 [ CPPFLAGS="$oldCPP" ])
2443
Damien Millera8e06ce2003-11-21 23:48:55 +11002444 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002445 if test ! -z "$need_dash_r" ; then
2446 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2447 fi
2448 if test ! -z "$blibpath" ; then
2449 blibpath="$blibpath:${KRB5ROOT}/lib"
2450 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002451 fi
2452
2453 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2454 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2455 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2456
2457 LIBS="$LIBS $K5LIBS"
2458 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
Ben Lindstroma8104b52004-04-07 04:16:11 +00002459 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
Darren Tucker0d27ed12004-02-24 10:37:33 +11002460 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002461)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002462
Damien Millera22ba012000-03-02 23:09:20 +11002463# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002464
Damien Millerf58c6722002-05-13 13:15:42 +10002465PRIVSEP_PATH=/var/empty
2466AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002467 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002468 [
2469 if test "x$withval" != "$no" ; then
2470 PRIVSEP_PATH=$withval
2471 fi
2472 ]
2473)
2474AC_SUBST(PRIVSEP_PATH)
2475
Damien Millera22ba012000-03-02 23:09:20 +11002476AC_ARG_WITH(xauth,
2477 [ --with-xauth=PATH Specify path to xauth program ],
2478 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002479 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002480 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002481 fi
2482 ],
2483 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002484 TestPath="$PATH"
2485 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2486 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2487 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2488 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2489 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002490 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002491 xauth_path="/usr/openwin/bin/xauth"
2492 fi
2493 ]
2494)
2495
Damien Miller7d901272003-01-13 16:55:22 +11002496STRIP_OPT=-s
2497AC_ARG_ENABLE(strip,
2498 [ --disable-strip Disable calling strip(1) on install],
2499 [
2500 if test "x$enableval" = "xno" ; then
2501 STRIP_OPT=
2502 fi
2503 ]
2504)
2505AC_SUBST(STRIP_OPT)
2506
Damien Millera19cf472000-11-29 13:28:50 +11002507if test -z "$xauth_path" ; then
2508 XAUTH_PATH="undefined"
2509 AC_SUBST(XAUTH_PATH)
2510else
Damien Millera22ba012000-03-02 23:09:20 +11002511 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002512 XAUTH_PATH=$xauth_path
2513 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002514fi
Damien Millera22ba012000-03-02 23:09:20 +11002515
2516# Check for mail directory (last resort if we cannot get it from headers)
2517if test ! -z "$MAIL" ; then
2518 maildir=`dirname $MAIL`
2519 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2520fi
2521
Darren Tucker623d92f2004-09-12 22:36:15 +10002522if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002523 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2524 disable_ptmx_check=yes
2525fi
Damien Millera22ba012000-03-02 23:09:20 +11002526if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002527 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002528 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002529 [
2530 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2531 have_dev_ptmx=1
2532 ]
2533 )
2534 fi
Damien Millera22ba012000-03-02 23:09:20 +11002535fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10002536
Darren Tucker623d92f2004-09-12 22:36:15 +10002537if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002538 AC_CHECK_FILE("/dev/ptc",
2539 [
2540 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2541 have_dev_ptc=1
2542 ]
2543 )
2544else
2545 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2546fi
Damien Miller204ad072000-03-02 23:56:12 +11002547
Damien Millera22ba012000-03-02 23:09:20 +11002548# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002549AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002550 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002551 [
Damien Miller897741e2001-04-16 10:41:46 +10002552 case "$withval" in
2553 man|cat|doc)
2554 MANTYPE=$withval
2555 ;;
2556 *)
2557 AC_MSG_ERROR(invalid man type: $withval)
2558 ;;
2559 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002560 ]
2561)
Ben Lindstrombc709922001-04-18 18:04:21 +00002562if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002563 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2564 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002565 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2566 MANTYPE=doc
2567 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2568 MANTYPE=man
2569 else
2570 MANTYPE=cat
2571 fi
2572fi
Damien Miller670a4b82000-01-22 13:53:11 +11002573AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002574if test "$MANTYPE" = "doc"; then
2575 mansubdir=man;
2576else
2577 mansubdir=$MANTYPE;
2578fi
2579AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002580
Damien Millera22ba012000-03-02 23:09:20 +11002581# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002582MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002583AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002584 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002585 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002586 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002587 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002588 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002589 fi
2590 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002591)
2592
Damien Millera22ba012000-03-02 23:09:20 +11002593# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002594AC_ARG_WITH(shadow,
2595 [ --without-shadow Disable shadow password support],
2596 [
2597 if test "x$withval" = "xno" ; then
2598 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002599 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002600 fi
2601 ]
2602)
2603
Damien Miller1f335fb2000-06-26 11:31:33 +10002604if test -z "$disable_shadow" ; then
2605 AC_MSG_CHECKING([if the systems has expire shadow information])
2606 AC_TRY_COMPILE(
2607 [
2608#include <sys/types.h>
2609#include <shadow.h>
2610 struct spwd sp;
2611 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2612 [ sp_expire_available=yes ], []
2613 )
2614
2615 if test "x$sp_expire_available" = "xyes" ; then
2616 AC_MSG_RESULT(yes)
2617 AC_DEFINE(HAS_SHADOW_EXPIRE)
2618 else
2619 AC_MSG_RESULT(no)
2620 fi
2621fi
2622
Damien Millera22ba012000-03-02 23:09:20 +11002623# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002624if test ! -z "$IPADDR_IN_DISPLAY" ; then
2625 DISPLAY_HACK_MSG="yes"
2626 AC_DEFINE(IPADDR_IN_DISPLAY)
2627else
Damien Millera8e06ce2003-11-21 23:48:55 +11002628 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002629 AC_ARG_WITH(ipaddr-display,
2630 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2631 [
2632 if test "x$withval" != "xno" ; then
2633 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002634 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002635 fi
2636 ]
2637 )
2638fi
Damien Miller76112de1999-12-21 11:18:08 +11002639
Darren Tuckere1a790d2003-09-16 11:52:19 +10002640# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002641AC_ARG_ENABLE(etc-default-login,
Darren Tucker1b6f2292005-02-11 16:11:49 +11002642 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
Darren Tucker2f9573d2005-02-10 22:28:54 +11002643 [ if test "x$enableval" = "xno"; then
2644 AC_MSG_NOTICE([/etc/default/login handling disabled])
2645 etc_default_login=no
2646 else
2647 etc_default_login=yes
2648 fi ],
2649 [ etc_default_login=yes ]
2650)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002651
Darren Tucker2f9573d2005-02-10 22:28:54 +11002652if test "x$etc_default_login" != "xno"; then
2653 AC_CHECK_FILE("/etc/default/login",
2654 [ external_path_file=/etc/default/login ])
Darren Tucker623d92f2004-09-12 22:36:15 +10002655 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2656 then
Darren Tuckera0c2b392004-09-11 23:26:37 +10002657 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2658 elif test "x$external_path_file" = "x/etc/default/login"; then
2659 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2660 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11002661fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002662
Tim Rice43a1c132002-04-17 21:19:14 -07002663dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2664if test $ac_cv_func_login_getcapbool = "yes" -a \
2665 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002666 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002667fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002668
Damien Millera22ba012000-03-02 23:09:20 +11002669# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002670SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002671AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002672 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002673 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002674 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002675 AC_MSG_WARN([
2676--with-default-path=PATH has no effect on this system.
2677Edit /etc/login.conf instead.])
2678 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002679 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002680 AC_MSG_WARN([
2681--with-default-path=PATH will only be used if PATH is not defined in
2682$external_path_file .])
2683 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002684 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002685 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002686 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002687 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002688 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2689 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002690 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002691 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002692 AC_MSG_WARN([
2693If PATH is defined in $external_path_file, ensure the path to scp is included,
2694otherwise scp will not work.])
2695 fi
2696 AC_TRY_RUN(
2697 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002698/* find out what STDPATH is */
2699#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002700#ifdef HAVE_PATHS_H
2701# include <paths.h>
2702#endif
2703#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002704# ifdef _PATH_USERPATH /* Irix */
2705# define _PATH_STDPATH _PATH_USERPATH
2706# else
2707# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2708# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002709#endif
2710#include <sys/types.h>
2711#include <sys/stat.h>
2712#include <fcntl.h>
2713#define DATA "conftest.stdpath"
2714
2715main()
2716{
2717 FILE *fd;
2718 int rc;
2719
2720 fd = fopen(DATA,"w");
2721 if(fd == NULL)
2722 exit(1);
2723
2724 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2725 exit(1);
2726
2727 exit(0);
2728}
2729 ], [ user_path=`cat conftest.stdpath` ],
2730 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2731 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2732 )
2733# make sure $bindir is in USER_PATH so scp will work
2734 t_bindir=`eval echo ${bindir}`
2735 case $t_bindir in
2736 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2737 esac
2738 case $t_bindir in
2739 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2740 esac
2741 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2742 if test $? -ne 0 ; then
2743 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2744 if test $? -ne 0 ; then
2745 user_path=$user_path:$t_bindir
2746 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2747 fi
2748 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002749 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002750)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002751if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002752 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2753 AC_SUBST(user_path)
2754fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002755
Damien Millera18bbd32002-05-13 10:48:57 +10002756# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002757AC_ARG_WITH(superuser-path,
2758 [ --with-superuser-path= Specify different path for super-user],
2759 [
2760 if test "x$withval" != "xno" ; then
2761 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2762 superuser_path=$withval
2763 fi
2764 ]
2765)
2766
2767
Damien Miller61e50f12000-05-08 20:49:37 +10002768AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002769IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002770AC_ARG_WITH(4in6,
2771 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2772 [
2773 if test "x$withval" != "xno" ; then
2774 AC_MSG_RESULT(yes)
2775 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002776 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002777 else
2778 AC_MSG_RESULT(no)
2779 fi
2780 ],[
2781 if test "x$inet6_default_4in6" = "xyes"; then
2782 AC_MSG_RESULT([yes (default)])
2783 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002784 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002785 else
2786 AC_MSG_RESULT([no (default)])
2787 fi
2788 ]
2789)
2790
Damien Miller60396b02001-02-18 17:01:00 +11002791# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002792BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002793AC_ARG_WITH(bsd-auth,
2794 [ --with-bsd-auth Enable BSD auth support],
2795 [
2796 if test "x$withval" != "xno" ; then
2797 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002798 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002799 fi
2800 ]
2801)
2802
Damien Millera22ba012000-03-02 23:09:20 +11002803# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002804piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002805# make sure the directory exists
2806if test ! -d $piddir ; then
2807 piddir=`eval echo ${sysconfdir}`
2808 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002809 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002810 esac
2811fi
2812
Tim Rice88f2ab52002-03-17 12:17:34 -08002813AC_ARG_WITH(pid-dir,
2814 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2815 [
2816 if test "x$withval" != "xno" ; then
2817 piddir=$withval
2818 if test ! -d $piddir ; then
2819 AC_MSG_WARN([** no $piddir directory on this system **])
2820 fi
2821 fi
2822 ]
2823)
2824
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002825AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002826AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002827
andre2ff7b5d2000-06-03 14:57:40 +00002828dnl allow user to disable some login recording features
2829AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002830 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002831 [
2832 if test "x$enableval" = "xno" ; then
2833 AC_DEFINE(DISABLE_LASTLOG)
2834 fi
2835 ]
andre2ff7b5d2000-06-03 14:57:40 +00002836)
2837AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002838 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002839 [
2840 if test "x$enableval" = "xno" ; then
2841 AC_DEFINE(DISABLE_UTMP)
2842 fi
2843 ]
andre2ff7b5d2000-06-03 14:57:40 +00002844)
2845AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002846 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002847 [
2848 if test "x$enableval" = "xno" ; then
2849 AC_DEFINE(DISABLE_UTMPX)
2850 fi
2851 ]
andre2ff7b5d2000-06-03 14:57:40 +00002852)
2853AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002854 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002855 [
2856 if test "x$enableval" = "xno" ; then
2857 AC_DEFINE(DISABLE_WTMP)
2858 fi
2859 ]
andre2ff7b5d2000-06-03 14:57:40 +00002860)
2861AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002862 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002863 [
2864 if test "x$enableval" = "xno" ; then
2865 AC_DEFINE(DISABLE_WTMPX)
2866 fi
2867 ]
andre2ff7b5d2000-06-03 14:57:40 +00002868)
2869AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002870 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002871 [
2872 if test "x$enableval" = "xno" ; then
2873 AC_DEFINE(DISABLE_LOGIN)
2874 fi
2875 ]
andre2ff7b5d2000-06-03 14:57:40 +00002876)
2877AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002878 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002879 [
2880 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002881 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002882 fi
2883 ]
andre2ff7b5d2000-06-03 14:57:40 +00002884)
2885AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002886 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002887 [
2888 if test "x$enableval" = "xno" ; then
2889 AC_DEFINE(DISABLE_PUTUTXLINE)
2890 fi
2891 ]
andre2ff7b5d2000-06-03 14:57:40 +00002892)
2893AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002894 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002895 [
2896 if test "x$withval" = "xno" ; then
2897 AC_DEFINE(DISABLE_LASTLOG)
2898 else
2899 conf_lastlog_location=$withval
2900 fi
2901 ]
2902)
andre2ff7b5d2000-06-03 14:57:40 +00002903
2904dnl lastlog, [uw]tmpx? detection
2905dnl NOTE: set the paths in the platform section to avoid the
2906dnl need for command-line parameters
2907dnl lastlog and [uw]tmp are subject to a file search if all else fails
2908
2909dnl lastlog detection
2910dnl NOTE: the code itself will detect if lastlog is a directory
2911AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2912AC_TRY_COMPILE([
2913#include <sys/types.h>
2914#include <utmp.h>
2915#ifdef HAVE_LASTLOG_H
2916# include <lastlog.h>
2917#endif
Damien Miller2994e082000-06-04 15:51:47 +10002918#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002919# include <paths.h>
2920#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002921#ifdef HAVE_LOGIN_H
2922# include <login.h>
2923#endif
andre2ff7b5d2000-06-03 14:57:40 +00002924 ],
2925 [ char *lastlog = LASTLOG_FILE; ],
2926 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002927 [
2928 AC_MSG_RESULT(no)
2929 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2930 AC_TRY_COMPILE([
2931#include <sys/types.h>
2932#include <utmp.h>
2933#ifdef HAVE_LASTLOG_H
2934# include <lastlog.h>
2935#endif
2936#ifdef HAVE_PATHS_H
2937# include <paths.h>
2938#endif
2939 ],
2940 [ char *lastlog = _PATH_LASTLOG; ],
2941 [ AC_MSG_RESULT(yes) ],
2942 [
andree441aa32000-06-12 22:34:38 +00002943 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002944 system_lastlog_path=no
2945 ])
2946 ]
andre2ff7b5d2000-06-03 14:57:40 +00002947)
Damien Miller2994e082000-06-04 15:51:47 +10002948
andre2ff7b5d2000-06-03 14:57:40 +00002949if test -z "$conf_lastlog_location"; then
2950 if test x"$system_lastlog_path" = x"no" ; then
2951 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002952 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002953 conf_lastlog_location=$f
2954 fi
2955 done
2956 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002957 AC_MSG_WARN([** Cannot find lastlog **])
2958 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002959 fi
2960 fi
2961fi
2962
2963if test -n "$conf_lastlog_location"; then
2964 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2965fi
2966
2967dnl utmp detection
2968AC_MSG_CHECKING([if your system defines UTMP_FILE])
2969AC_TRY_COMPILE([
2970#include <sys/types.h>
2971#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002972#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002973# include <paths.h>
2974#endif
2975 ],
2976 [ char *utmp = UTMP_FILE; ],
2977 [ AC_MSG_RESULT(yes) ],
2978 [ AC_MSG_RESULT(no)
2979 system_utmp_path=no ]
2980)
2981if test -z "$conf_utmp_location"; then
2982 if test x"$system_utmp_path" = x"no" ; then
2983 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2984 if test -f $f ; then
2985 conf_utmp_location=$f
2986 fi
2987 done
2988 if test -z "$conf_utmp_location"; then
2989 AC_DEFINE(DISABLE_UTMP)
2990 fi
2991 fi
2992fi
2993if test -n "$conf_utmp_location"; then
2994 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2995fi
2996
2997dnl wtmp detection
2998AC_MSG_CHECKING([if your system defines WTMP_FILE])
2999AC_TRY_COMPILE([
3000#include <sys/types.h>
3001#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003002#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003003# include <paths.h>
3004#endif
3005 ],
3006 [ char *wtmp = WTMP_FILE; ],
3007 [ AC_MSG_RESULT(yes) ],
3008 [ AC_MSG_RESULT(no)
3009 system_wtmp_path=no ]
3010)
3011if test -z "$conf_wtmp_location"; then
3012 if test x"$system_wtmp_path" = x"no" ; then
3013 for f in /usr/adm/wtmp /var/log/wtmp; do
3014 if test -f $f ; then
3015 conf_wtmp_location=$f
3016 fi
3017 done
3018 if test -z "$conf_wtmp_location"; then
3019 AC_DEFINE(DISABLE_WTMP)
3020 fi
3021 fi
3022fi
3023if test -n "$conf_wtmp_location"; then
3024 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
3025fi
3026
3027
3028dnl utmpx detection - I don't know any system so perverse as to require
3029dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3030dnl there, though.
3031AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3032AC_TRY_COMPILE([
3033#include <sys/types.h>
3034#include <utmp.h>
3035#ifdef HAVE_UTMPX_H
3036#include <utmpx.h>
3037#endif
Damien Miller2994e082000-06-04 15:51:47 +10003038#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003039# include <paths.h>
3040#endif
3041 ],
3042 [ char *utmpx = UTMPX_FILE; ],
3043 [ AC_MSG_RESULT(yes) ],
3044 [ AC_MSG_RESULT(no)
3045 system_utmpx_path=no ]
3046)
3047if test -z "$conf_utmpx_location"; then
3048 if test x"$system_utmpx_path" = x"no" ; then
3049 AC_DEFINE(DISABLE_UTMPX)
3050 fi
3051else
3052 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
3053fi
3054
3055dnl wtmpx detection
3056AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3057AC_TRY_COMPILE([
3058#include <sys/types.h>
3059#include <utmp.h>
3060#ifdef HAVE_UTMPX_H
3061#include <utmpx.h>
3062#endif
Damien Miller2994e082000-06-04 15:51:47 +10003063#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003064# include <paths.h>
3065#endif
3066 ],
3067 [ char *wtmpx = WTMPX_FILE; ],
3068 [ AC_MSG_RESULT(yes) ],
3069 [ AC_MSG_RESULT(no)
3070 system_wtmpx_path=no ]
3071)
3072if test -z "$conf_wtmpx_location"; then
3073 if test x"$system_wtmpx_path" = x"no" ; then
3074 AC_DEFINE(DISABLE_WTMPX)
3075 fi
3076else
3077 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
3078fi
3079
Damien Miller4018c192000-04-30 09:30:44 +10003080
Damien Miller29ea30d2000-03-17 10:54:15 +11003081if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003082 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3083 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003084fi
3085
Tim Rice4cec93f2002-02-26 08:40:48 -08003086dnl remove pam and dl because they are in $LIBPAM
3087if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003088 LIBS=`echo $LIBS | sed 's/-lpam //'`
3089fi
3090if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3091 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003092fi
3093
Damien Millerbac2d8a2000-09-05 16:13:06 +11003094AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003095AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3096 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003097AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003098
Damien Miller7b22d652000-06-18 14:07:04 +10003099# Print summary of options
3100
Damien Miller7b22d652000-06-18 14:07:04 +10003101# Someone please show me a better way :)
3102A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3103B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3104C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3105D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003106E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003107F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003108G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003109H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3110I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3111J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003112
3113echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003114echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003115echo " User binaries: $B"
3116echo " System binaries: $C"
3117echo " Configuration files: $D"
3118echo " Askpass program: $E"
3119echo " Manual pages: $F"
3120echo " PID file: $G"
3121echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003122if test "x$external_path_file" = "x/etc/login.conf" ; then
3123echo " At runtime, sshd will use the path defined in $external_path_file"
3124echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003125else
Damien Millerf58c6722002-05-13 13:15:42 +10003126echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003127 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003128echo " (If PATH is set in $external_path_file it will be used instead. If"
3129echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3130 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003131fi
Damien Millera18bbd32002-05-13 10:48:57 +10003132if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003133echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003134fi
Damien Millerf58c6722002-05-13 13:15:42 +10003135echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003136echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003137echo " KerberosV support: $KRB5_MSG"
3138echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003139echo " S/KEY support: $SKEY_MSG"
3140echo " TCP Wrappers support: $TCPW_MSG"
3141echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003142echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003143echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003144echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3145echo " BSD Auth support: $BSD_AUTH_MSG"
3146echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003147if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003148echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003149fi
3150
Damien Miller7b22d652000-06-18 14:07:04 +10003151echo ""
3152
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003153echo " Host: ${host}"
3154echo " Compiler: ${CC}"
3155echo " Compiler flags: ${CFLAGS}"
3156echo "Preprocessor flags: ${CPPFLAGS}"
3157echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003158echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003159
3160echo ""
3161
Tim Rice6f1f7582004-05-30 21:38:51 -07003162if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003163 echo "SVR4 style packages are supported with \"make package\""
3164 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003165fi
3166
Damien Miller82cf0ce2000-12-20 13:34:48 +11003167if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003168 echo "PAM is enabled. You may need to install a PAM control file "
3169 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003170 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003171 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003172 echo ""
3173fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003174
Damien Miller6c21c512002-01-22 21:57:53 +11003175if test ! -z "$RAND_HELPER_CMDHASH" ; then
3176 echo "WARNING: you are using the builtin random number collection "
3177 echo "service. Please read WARNING.RNG and request that your OS "
3178 echo "vendor includes kernel-based random number collection in "
3179 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003180 echo ""
3181fi
Damien Miller60396b02001-02-18 17:01:00 +11003182
Damien Millerb4097182004-05-23 14:09:40 +10003183if test ! -z "$NO_PEERCHECK" ; then
3184 echo "WARNING: the operating system that you are using does not "
3185 echo "appear to support either the getpeereid() API nor the "
3186 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3187 echo "enforce security checks to prevent unauthorised connections to "
3188 echo "ssh-agent. Their absence increases the risk that a malicious "
3189 echo "user can connect to your agent. "
3190 echo ""
3191fi
3192