blob: fe034aca60d6cdafa7380c8be354862ebcf1035d [file] [log] [blame]
Tim Ricefd80ddc2006-02-02 19:11:56 -08001# $Id: configure.ac,v 1.324 2006/02/03 03:11:56 tim Exp $
Damien Miller4fefe242004-03-11 14:20:10 +11002#
3# Copyright (c) 1999-2004 Damien Miller
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Damien Millere9cf3572001-02-09 12:55:35 +110016
Darren Tucker6a45f3d2005-06-03 19:33:10 +100017AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
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
Tim Ricefd80ddc2006-02-02 19:11:56 -080030AC_PROG_EGREP
Ben Lindstrom582d3982001-02-06 22:54:30 +000031AC_PATH_PROG(AR, ar)
Tim Rice5af9db92004-06-19 19:31:06 -070032AC_PATH_PROG(CAT, cat)
33AC_PATH_PROG(KILL, kill)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070034AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080035AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110036AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100037AC_PATH_PROG(ENT, ent)
38AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110039AC_PATH_PROG(TEST_MINUS_S_SH, bash)
40AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
41AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070042AC_PATH_PROG(SH, sh)
Tim Ricef7ba8f62004-06-20 10:37:32 -070043AC_SUBST(TEST_SHELL,sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110044
Tim Rice6f1f7582004-05-30 21:38:51 -070045dnl for buildpkg.sh
46AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
47 [/usr/sbin${PATH_SEPARATOR}/etc])
48AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd,
49 [/usr/sbin${PATH_SEPARATOR}/etc])
50AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no)
Darren Tuckerfbea7642006-01-30 00:22:39 +110051if test -x /sbin/sh; then
52 AC_SUBST(STARTUP_SCRIPT_SHELL,/sbin/sh)
53else
54 AC_SUBST(STARTUP_SCRIPT_SHELL,/bin/sh)
55fi
Tim Rice6f1f7582004-05-30 21:38:51 -070056
Damien Millere8bb4502001-09-25 16:39:35 +100057# System features
58AC_SYS_LARGEFILE
59
Damien Miller3f62aba2000-11-29 11:56:35 +110060if test -z "$AR" ; then
61 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
62fi
63
Damien Millerad833b32000-08-23 10:46:23 +100064# Use LOGIN_PROGRAM from environment if possible
65if test ! -z "$LOGIN_PROGRAM" ; then
Tim Rice7df8d392005-09-19 09:33:39 -070066 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM",
67 [If your header files don't define LOGIN_PROGRAM,
68 then use this (detected) from environment and PATH])
Damien Millerad833b32000-08-23 10:46:23 +100069else
70 # Search for login
71 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
72 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
73 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
74 fi
75fi
76
Darren Tucker23bc8d02004-02-06 16:24:31 +110077AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
78if test ! -z "$PATH_PASSWD_PROG" ; then
Tim Rice7df8d392005-09-19 09:33:39 -070079 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG",
80 [Full path of your "passwd" program])
Darren Tucker23bc8d02004-02-06 16:24:31 +110081fi
82
Damien Miller166bd442000-03-16 10:48:25 +110083if test -z "$LD" ; then
84 LD=$CC
85fi
86AC_SUBST(LD)
Tim Riceeae17cc2005-03-17 16:52:20 -080087
Damien Miller166bd442000-03-16 10:48:25 +110088AC_C_INLINE
Darren Tucker67b37032005-06-03 17:58:31 +100089
90AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
91
Damien Millera8e06ce2003-11-21 23:48:55 +110092if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Darren Tuckerdd352b62005-08-02 17:21:29 +100093 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
Darren Tucker3f9545e2005-11-12 15:20:52 +110094 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
Tim Rice3db1e3f2005-08-23 17:11:26 -070095 case $GCC_VER in
96 1.*) ;;
97 2.8* | 2.9*) CFLAGS="$CFLAGS -Wsign-compare" ;;
98 2.*) ;;
Darren Tuckerb0288092005-11-10 14:46:48 +110099 3.*) CFLAGS="$CFLAGS -Wsign-compare" ;;
Darren Tuckerf0324352005-11-10 21:30:36 +1100100 4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign" ;;
101 *) ;;
Tim Rice3db1e3f2005-08-23 17:11:26 -0700102 esac
Damien Millerde3cb0a2005-05-26 20:48:25 +1000103
Darren Tucker67b37032005-06-03 17:58:31 +1000104 if test -z "$have_llong_max"; then
105 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes
106 unset ac_cv_have_decl_LLONG_MAX
107 saved_CFLAGS="$CFLAGS"
108 CFLAGS="$CFLAGS -std=gnu99"
109 AC_CHECK_DECL(LLONG_MAX,
110 [have_llong_max=1],
111 [CFLAGS="$saved_CFLAGS"],
112 [#include <limits.h>]
113 )
114 fi
Damien Miller166bd442000-03-16 10:48:25 +1100115fi
116
Tim Rice88368a32003-12-08 12:35:59 -0800117AC_ARG_WITH(rpath,
118 [ --without-rpath Disable auto-added -R linker paths],
119 [
Tim Riceeae17cc2005-03-17 16:52:20 -0800120 if test "x$withval" = "xno" ; then
Tim Rice88368a32003-12-08 12:35:59 -0800121 need_dash_r=""
122 fi
123 if test "x$withval" = "xyes" ; then
124 need_dash_r=1
125 fi
126 ]
127)
128
Damien Millera22ba012000-03-02 23:09:20 +1100129# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +1100130case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +1100131*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +1100132 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +1000133 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -0800134 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100135 fi
Damien Millereab4bae2003-04-29 23:22:40 +1000136 saved_LDFLAGS="$LDFLAGS"
137 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
138 if (test -z "$blibflags"); then
139 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
140 AC_TRY_LINK([], [], [blibflags=$tryflags])
141 fi
142 done
143 if (test -z "$blibflags"); then
144 AC_MSG_RESULT(not found)
145 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
146 else
147 AC_MSG_RESULT($blibflags)
148 fi
149 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000150 dnl Check for authenticate. Might be in libs.a on older AIXes
Tim Rice7df8d392005-09-19 09:33:39 -0700151 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE, 1,
152 [Define if you want to enable AIX4's authenticate function])],
Tim Ricee958ed32002-07-05 07:12:33 -0700153 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000154 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -0700155 LIBS="$LIBS -ls"
156 ])
157 ])
Darren Tucker3c774c52005-02-16 22:49:31 +1100158 dnl Check for various auth function declarations in headers.
Darren Tucker04cfbe02005-02-20 23:27:11 +1100159 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
Darren Tuckere66519d2005-03-21 22:46:34 +1100160 passwdexpired, setauthdb], , , [#include <usersec.h>])
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000161 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
Darren Tucker3c774c52005-02-16 22:49:31 +1100162 AC_CHECK_DECLS(loginfailed,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000163 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
164 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000165 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000166 [(void)loginfailed("user","host","tty",0);],
167 [AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -0700168 AC_DEFINE(AIX_LOGINFAILED_4ARG, 1,
169 [Define if your AIX loginfailed() function
170 takes 4 arguments (AIX >= 5.2)])],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000171 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000172 )],
173 [],
174 [#include <usersec.h>]
175 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000176 AC_CHECK_FUNCS(setauthdb)
Darren Tucker691d5232005-02-15 21:45:57 +1100177 check_for_aix_broken_getaddrinfo=1
Tim Rice7df8d392005-09-19 09:33:39 -0700178 AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.])
179 AC_DEFINE(SETEUID_BREAKS_SETUID, 1,
180 [Define if your platform breaks doing a seteuid before a setuid])
181 AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken])
182 AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken])
andre60f3c982000-06-03 16:18:19 +0000183 dnl AIX handles lastlog as part of its login message
Tim Rice7df8d392005-09-19 09:33:39 -0700184 AC_DEFINE(DISABLE_LASTLOG, 1, [Define if you don't want to use lastlog])
185 AC_DEFINE(LOGIN_NEEDS_UTMPX, 1,
186 [Some systems need a utmpx entry for /bin/login to work])
187 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV,
188 [Define to a Set Process Title type if your system is
189 supported by bsd-setproctitle.c])
Darren Tucker91d25a02005-11-26 22:24:09 +1100190 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
191 [AIX 5.2 and 5.3 (and presumably newer) require this])
Damien Miller75b1d102000-01-07 14:01:41 +1100192 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100193*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100194 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800195 LIBS="$LIBS /usr/lib/textmode.o"
Tim Rice7df8d392005-09-19 09:33:39 -0700196 AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin])
197 AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()])
198 AC_DEFINE(DISABLE_SHADOW, 1,
199 [Define if you want to disable shadow passwords])
200 AC_DEFINE(IP_TOS_IS_BROKEN, 1,
201 [Define if your system choked on IP TOS setting])
202 AC_DEFINE(NO_X11_UNIX_SOCKETS, 1,
203 [Define if X11 doesn't support AF_UNIX sockets on that system])
204 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT, 1,
205 [Define if the concept of ports only accessible to
206 superusers isn't known])
207 AC_DEFINE(DISABLE_FD_PASSING, 1,
208 [Define if your platform needs to skip post auth
209 file descriptor passing])
Damien Millerbac2d8a2000-09-05 16:13:06 +1100210 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000211*-*-dgux*)
212 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100213 AC_DEFINE(SETEUID_BREAKS_SETUID)
214 AC_DEFINE(BROKEN_SETREUID)
215 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000216 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000217*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000218 AC_MSG_CHECKING(if we have working getaddrinfo)
219 AC_TRY_RUN([#include <mach-o/dyld.h>
220main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
221 exit(0);
222 else
223 exit(1);
224}], [AC_MSG_RESULT(working)],
225 [AC_MSG_RESULT(buggy)
Tim Rice7df8d392005-09-19 09:33:39 -0700226 AC_DEFINE(BROKEN_GETADDRINFO, 1, [getaddrinfo is broken (if present)])],
Tim Rice480ef8d2003-09-21 21:38:11 -0700227 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000228 AC_DEFINE(SETEUID_BREAKS_SETUID)
229 AC_DEFINE(BROKEN_SETREUID)
230 AC_DEFINE(BROKEN_SETREGID)
Tim Rice7df8d392005-09-19 09:33:39 -0700231 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1,
232 [Define if your resolver libs need this for getrrsetbyname])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000233 ;;
Darren Tuckerfd333282005-05-28 18:31:42 +1000234*-*-hpux*)
235 # first we define all of the options common to all HP-UX releases
Kevin Steves315f8b72001-06-28 00:24:41 +0000236 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100237 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000238 AC_DEFINE(USE_PIPES)
Tim Rice7df8d392005-09-19 09:33:39 -0700239 AC_DEFINE(LOGIN_NO_ENDOPT, 1,
240 [Define if your login program cannot handle end of options ("--")])
Kevin Steves5feaaef2002-04-23 20:45:55 +0000241 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Tim Rice7df8d392005-09-19 09:33:39 -0700242 AC_DEFINE(LOCKED_PASSWD_STRING, "*",
243 [String used in /etc/passwd to denote locked account])
Damien Miller35276252003-06-03 10:14:28 +1000244 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tucker1e6616b2005-10-08 12:07:01 +1000245 MAIL="/var/mail/username"
Tim Ricef028f1e2002-07-19 12:41:10 -0700246 LIBS="$LIBS -lsec"
Darren Tuckerfd333282005-05-28 18:31:42 +1000247 AC_CHECK_LIB(xnet, t_error, ,
248 AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
249
250 # next, we define all of the options specific to major releases
251 case "$host" in
252 *-*-hpux10*)
253 if test -z "$GCC"; then
254 CFLAGS="$CFLAGS -Ae"
255 fi
256 ;;
257 *-*-hpux11*)
Tim Rice7df8d392005-09-19 09:33:39 -0700258 AC_DEFINE(PAM_SUN_CODEBASE, 1,
259 [Define if you are using Solaris-derived PAM which
260 passes pam_messages to the conversation function
261 with an extra level of indirection])
262 AC_DEFINE(DISABLE_UTMP, 1,
263 [Define if you don't want to use utmp])
Darren Tuckerfd333282005-05-28 18:31:42 +1000264 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
265 check_for_hpux_broken_getaddrinfo=1
266 check_for_conflicting_getspnam=1
267 ;;
268 esac
269
270 # lastly, we define options specific to minor releases
271 case "$host" in
272 *-*-hpux10.26)
Tim Rice7df8d392005-09-19 09:33:39 -0700273 AC_DEFINE(HAVE_SECUREWARE, 1,
274 [Define if you have SecureWare-based
275 protected password database])
Darren Tuckerfd333282005-05-28 18:31:42 +1000276 disable_ptmx_check=yes
277 LIBS="$LIBS -lsecpw"
278 ;;
279 esac
Damien Miller1bead332000-04-30 00:47:29 +1000280 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100281*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100282 PATH="$PATH:/usr/etc"
Tim Rice7df8d392005-09-19 09:33:39 -0700283 AC_DEFINE(BROKEN_INET_NTOA, 1,
284 [Define if you system's inet_ntoa is busted
285 (e.g. Irix gcc issue)])
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000286 AC_DEFINE(SETEUID_BREAKS_SETUID)
287 AC_DEFINE(BROKEN_SETREUID)
288 AC_DEFINE(BROKEN_SETREGID)
Tim Rice7df8d392005-09-19 09:33:39 -0700289 AC_DEFINE(WITH_ABBREV_NO_TTY, 1,
290 [Define if you shouldn't strip 'tty' from your
291 ttyname in [uw]tmp])
Darren Tuckere41bba52003-08-25 11:51:19 +1000292 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100293 ;;
294*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100295 PATH="$PATH:/usr/etc"
Tim Rice7df8d392005-09-19 09:33:39 -0700296 AC_DEFINE(WITH_IRIX_ARRAY, 1,
297 [Define if you have/want arrays
298 (cluster-wide session managment, not C arrays)])
299 AC_DEFINE(WITH_IRIX_PROJECT, 1,
300 [Define if you want IRIX project management])
301 AC_DEFINE(WITH_IRIX_AUDIT, 1,
302 [Define if you want IRIX audit trails])
303 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS, 1,
304 [Define if you want IRIX kernel jobs])])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000305 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000306 AC_DEFINE(SETEUID_BREAKS_SETUID)
307 AC_DEFINE(BROKEN_SETREUID)
308 AC_DEFINE(BROKEN_SETREGID)
Tim Rice7df8d392005-09-19 09:33:39 -0700309 AC_DEFINE(BROKEN_UPDWTMPX, 1, [updwtmpx is broken (if present)])
Damien Millerf1b9d112002-04-23 23:09:19 +1000310 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000311 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100312 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100313*-*-linux*)
314 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100315 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000316 check_for_openpty_ctty_bug=1
Tim Rice7df8d392005-09-19 09:33:39 -0700317 AC_DEFINE(DONT_TRY_OTHER_AF, 1, [Workaround more Linux IPv6 quirks])
318 AC_DEFINE(PAM_TTY_KLUDGE, 1,
319 [Work around problematic Linux PAM modules handling of PAM_TTY])
320 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!",
321 [String used in /etc/passwd to denote locked account])
Damien Miller35276252003-06-03 10:14:28 +1000322 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Tim Rice7df8d392005-09-19 09:33:39 -0700323 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM,
324 [Define to whatever link() returns for "not supported"
325 if it doesn't return EOPNOTSUPP.])
Darren Tucker2fba9932005-02-02 23:30:24 +1100326 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
Tim Rice7df8d392005-09-19 09:33:39 -0700327 AC_DEFINE(USE_BTMP)
Damien Miller7bcb0892000-03-11 20:45:40 +1100328 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000329 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000330 1.*|2.0.*)
Tim Rice7df8d392005-09-19 09:33:39 -0700331 AC_DEFINE(BROKEN_CMSG_TYPE, 1,
332 [Define if cmsg_type is not passed correctly])
Darren Tucker3c016542003-05-02 20:48:21 +1000333 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000334 esac
Damien Miller89e03ba2005-12-31 16:42:03 +1100335 # tun(4) forwarding compat code
Damien Millerc4bcc912005-12-31 17:05:58 +1100336 AC_CHECK_HEADERS(linux/if_tun.h)
Damien Millerbd4e4102006-01-01 21:03:30 +1100337 if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then
Damien Miller89e03ba2005-12-31 16:42:03 +1100338 AC_DEFINE(SSH_TUN_LINUX, 1,
339 [Open tunnel devices the Linux tun/tap way])
340 AC_DEFINE(SSH_TUN_COMPAT_AF, 1,
341 [Use tunnel device compatibility to OpenBSD])
342 AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
343 [Prepend the address family to IP tunnel traffic])
344 fi
Damien Millerb29ea912000-01-15 14:12:03 +1100345 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000346mips-sony-bsd|mips-sony-newsos4)
Tim Rice7df8d392005-09-19 09:33:39 -0700347 AC_DEFINE(NEED_SETPRGP, 1, [Need setpgrp to acquire controlling tty])
Ben Lindstromb5628642000-10-18 00:02:25 +0000348 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000349 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100350*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000351 check_for_libcrypt_before=1
Tim Riceeae17cc2005-03-17 16:52:20 -0800352 if test "x$withval" != "xno" ; then
Tim Rice88368a32003-12-08 12:35:59 -0800353 need_dash_r=1
354 fi
Damien Miller2dcddbf2006-01-01 19:47:05 +1100355 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
356 AC_CHECK_HEADER([net/if_tap.h], ,
357 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support]))
358 AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
359 [Prepend the address family to IP tunnel traffic])
Damien Milleree1c0b32000-01-21 00:18:15 +1100360 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100361*-*-freebsd*)
362 check_for_libcrypt_later=1
Darren Tuckerac7e6302005-10-06 01:39:58 +1000363 AC_DEFINE(LOCKED_PASSWD_PREFIX, "*LOCKED*", [Account locked with pw(1)])
Damien Miller2dcddbf2006-01-01 19:47:05 +1100364 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
365 AC_CHECK_HEADER([net/if_tap.h], ,
366 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support]))
Damien Millerfbd884a2001-02-27 08:39:07 +1100367 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000368*-*-bsdi*)
369 AC_DEFINE(SETEUID_BREAKS_SETUID)
370 AC_DEFINE(BROKEN_SETREUID)
371 AC_DEFINE(BROKEN_SETREGID)
372 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000373*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000374 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100375 conf_utmp_location=/etc/utmp
376 conf_wtmp_location=/usr/adm/wtmp
377 MAIL=/usr/spool/mail
Tim Rice7df8d392005-09-19 09:33:39 -0700378 AC_DEFINE(HAVE_NEXT, 1, [Define if you are on NeXT])
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000379 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000380 AC_DEFINE(USE_PIPES)
Tim Rice7df8d392005-09-19 09:33:39 -0700381 AC_DEFINE(BROKEN_SAVED_UIDS, 1, [Needed for NeXT])
Damien Miller0f91b4e2000-06-18 15:43:25 +1000382 ;;
Darren Tucker4a422572005-07-14 17:22:11 +1000383*-*-openbsd*)
384 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
Darren Tucker9ac1a652005-10-09 11:40:03 +1000385 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded])
Damien Miller2dcddbf2006-01-01 19:47:05 +1100386 AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way])
Darren Tucker4a422572005-07-14 17:22:11 +1000387 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100388*-*-solaris*)
Tim Riceeae17cc2005-03-17 16:52:20 -0800389 if test "x$withval" != "xno" ; then
Tim Ricead4a1882004-02-29 15:53:37 -0800390 need_dash_r=1
391 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100392 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000393 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Tim Rice7df8d392005-09-19 09:33:39 -0700394 AC_DEFINE(LOGIN_NEEDS_TERM, 1,
395 [Some versions of /bin/login need the TERM supplied
396 on the commandline])
Ben Lindstrom95276712001-10-23 17:14:00 +0000397 AC_DEFINE(PAM_TTY_KLUDGE)
Tim Rice7df8d392005-09-19 09:33:39 -0700398 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
399 [Define if pam_chauthtok wants real uid set
400 to the unpriv'ed user])
Darren Tuckere41bba52003-08-25 11:51:19 +1000401 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000402 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
Tim Rice7df8d392005-09-19 09:33:39 -0700403 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1,
404 [Define if sshd somehow reacquires a controlling TTY
405 after setsid()])
Darren Tuckere1a790d2003-09-16 11:52:19 +1000406 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000407 # hardwire lastlog location (can't detect it on some versions)
408 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000409 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
410 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
411 if test "$sol2ver" -ge 8; then
412 AC_MSG_RESULT(yes)
413 AC_DEFINE(DISABLE_UTMP)
Tim Rice7df8d392005-09-19 09:33:39 -0700414 AC_DEFINE(DISABLE_WTMP, 1,
415 [Define if you don't want to use wtmp])
Damien Millera1cb6442000-06-09 11:58:35 +1000416 else
417 AC_MSG_RESULT(no)
418 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100419 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000420*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000421 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000422 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100423 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000424 conf_utmp_location=/etc/utmp
425 conf_wtmp_location=/var/adm/wtmp
426 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000427 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000428 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000429*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700430 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000431 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000432 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000433 AC_DEFINE(SETEUID_BREAKS_SETUID)
434 AC_DEFINE(BROKEN_SETREUID)
435 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000436 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000437*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700438 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000439 AC_CHECK_LIB(dl, dlsym, ,)
Darren Tucker79d09fa2005-11-24 22:34:54 +1100440 # -lresolv needs to be at the end of LIBS or DNS lookups break
441 AC_CHECK_LIB(resolv, res_query, [ LIBS="$LIBS -lresolv" ])
Damien Millerfd9885e2001-01-10 08:16:53 +1100442 IPADDR_IN_DISPLAY=yes
443 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000444 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000445 AC_DEFINE(SETEUID_BREAKS_SETUID)
446 AC_DEFINE(BROKEN_SETREUID)
447 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000448 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000449 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700450 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
451 # Attention: always take care to bind libsocket and libnsl before libc,
452 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000453 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800454# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
Damien Miller78315eb2000-09-29 23:01:36 +1100455*-*-sysv4.2*)
Damien Miller57f39152005-11-24 19:58:19 +1100456 CFLAGS="$CFLAGS -Dva_list=_VA_LIST"
Damien Miller5dfe9762001-02-16 12:05:39 +1100457 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700458 AC_DEFINE(SETEUID_BREAKS_SETUID)
459 AC_DEFINE(BROKEN_SETREUID)
460 AC_DEFINE(BROKEN_SETREGID)
Tim Rice2f97b8b2005-04-11 19:00:18 -0700461 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
Tim Rice46259d82005-11-28 18:40:34 -0800462 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller78315eb2000-09-29 23:01:36 +1100463 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800464# UnixWare 7.x, OpenUNIX 8
Damien Miller78315eb2000-09-29 23:01:36 +1100465*-*-sysv5*)
Tim Riceeb456542005-08-30 07:12:02 -0700466 check_for_libcrypt_later=1
467 AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars])
Damien Miller5dfe9762001-02-16 12:05:39 +1100468 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700469 AC_DEFINE(SETEUID_BREAKS_SETUID)
470 AC_DEFINE(BROKEN_SETREUID)
471 AC_DEFINE(BROKEN_SETREGID)
Tim Rice7df8d392005-09-19 09:33:39 -0700472 AC_DEFINE(PASSWD_NEEDS_USERNAME)
Tim Rice4dbacff2005-06-01 20:09:28 -0700473 case "$host" in
474 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x
475 TEST_SHELL=/u95/bin/sh
Tim Rice7df8d392005-09-19 09:33:39 -0700476 AC_DEFINE(BROKEN_LIBIAF, 1,
477 [ia_uinfo routines not supported by OS yet])
Tim Rice4dbacff2005-06-01 20:09:28 -0700478 ;;
Tim Rice46259d82005-11-28 18:40:34 -0800479 *) AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
480 ;;
Tim Rice4dbacff2005-06-01 20:09:28 -0700481 esac
Damien Miller78315eb2000-09-29 23:01:36 +1100482 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100483*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100484 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800485# SCO UNIX and OEM versions of SCO UNIX
Damien Miller78315eb2000-09-29 23:01:36 +1100486*-*-sco3.2v4*)
Tim Ricec390c8d2005-03-07 01:21:37 -0800487 AC_MSG_ERROR("This Platform is no longer supported.")
Damien Miller78315eb2000-09-29 23:01:36 +1100488 ;;
Tim Rice0f83d292004-12-08 18:29:58 -0800489# SCO OpenServer 5.x
Damien Miller78315eb2000-09-29 23:01:36 +1100490*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800491 if test -z "$GCC"; then
492 CFLAGS="$CFLAGS -belf"
493 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100494 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000495 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100496 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000497 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000498 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700499 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700500 AC_DEFINE(SETEUID_BREAKS_SETUID)
501 AC_DEFINE(BROKEN_SETREUID)
502 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700503 AC_DEFINE(WITH_ABBREV_NO_TTY)
Tim Rice816bd0d2004-07-19 10:19:26 -0700504 AC_DEFINE(BROKEN_UPDWTMPX)
Tim Rice7df8d392005-09-19 09:33:39 -0700505 AC_DEFINE(PASSWD_NEEDS_USERNAME)
Damien Miller217f5672001-02-16 12:12:41 +1100506 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700507 MANTYPE=man
Tim Ricef7ba8f62004-06-20 10:37:32 -0700508 TEST_SHELL=ksh
Damien Millera66626b2000-06-13 18:57:53 +1000509 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000510*-*-unicosmk*)
Tim Rice7df8d392005-09-19 09:33:39 -0700511 AC_DEFINE(NO_SSH_LASTLOG, 1,
512 [Define if you don't want to use lastlog in session.c])
Darren Tucker2df33432004-01-30 14:34:21 +1100513 AC_DEFINE(SETEUID_BREAKS_SETUID)
514 AC_DEFINE(BROKEN_SETREUID)
515 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000516 AC_DEFINE(USE_PIPES)
517 AC_DEFINE(DISABLE_FD_PASSING)
518 LDFLAGS="$LDFLAGS"
519 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
520 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000521 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000522*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100523 AC_DEFINE(SETEUID_BREAKS_SETUID)
524 AC_DEFINE(BROKEN_SETREUID)
525 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000526 AC_DEFINE(WITH_ABBREV_NO_TTY)
527 AC_DEFINE(USE_PIPES)
528 AC_DEFINE(DISABLE_FD_PASSING)
529 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100530 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000531 MANTYPE=cat
532 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000533*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100534 AC_DEFINE(SETEUID_BREAKS_SETUID)
535 AC_DEFINE(BROKEN_SETREUID)
536 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000537 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700538 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700539 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000540 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
541 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
542 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700543 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000544*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000545 AC_MSG_CHECKING(for Digital Unix SIA)
546 no_osfsia=""
547 AC_ARG_WITH(osfsia,
548 [ --with-osfsia Enable Digital Unix SIA],
549 [
550 if test "x$withval" = "xno" ; then
551 AC_MSG_RESULT(disabled)
552 no_osfsia=1
553 fi
554 ],
555 )
556 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000557 if test -f /etc/sia/matrix.conf; then
558 AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -0700559 AC_DEFINE(HAVE_OSF_SIA, 1,
560 [Define if you have Digital Unix Security
561 Integration Architecture])
562 AC_DEFINE(DISABLE_LOGIN, 1,
563 [Define if you don't want to use your
564 system's login() call])
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000565 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000566 LIBS="$LIBS -lsecurity -ldb -lm -laud"
567 else
568 AC_MSG_RESULT(no)
Tim Rice7df8d392005-09-19 09:33:39 -0700569 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin",
570 [String used in /etc/passwd to denote locked account])
Damien Millerb8c656e2000-06-28 15:22:41 +1000571 fi
572 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000573 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700574 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000575 AC_DEFINE(BROKEN_SETREUID)
576 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000577 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000578
579*-*-nto-qnx)
580 AC_DEFINE(USE_PIPES)
581 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Tim Rice7df8d392005-09-19 09:33:39 -0700582 AC_DEFINE(MISSING_NFDBITS, 1, [Define on *nto-qnx systems])
583 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems])
584 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems])
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000585 ;;
Darren Tucker2be1cbb2005-05-27 21:13:40 +1000586
587*-*-ultrix*)
Tim Rice7df8d392005-09-19 09:33:39 -0700588 AC_DEFINE(BROKEN_GETGROUPS, 1, [getgroups(0,NULL) will return -1])
589 AC_DEFINE(BROKEN_MMAP, 1, [Ultrix mmap can't map files])
590 AC_DEFINE(NEED_SETPRGP)
Tim Ricefcc7ff12005-06-02 20:28:29 -0700591 AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix])
592 ;;
Darren Tucker93e7e8f2005-08-23 08:06:55 +1000593
594*-*-lynxos)
595 CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
Tim Rice7df8d392005-09-19 09:33:39 -0700596 AC_DEFINE(MISSING_HOWMANY)
Darren Tucker93e7e8f2005-08-23 08:06:55 +1000597 AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation])
598 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100599esac
600
Damien Millere37bfc12000-06-05 09:37:43 +1000601# Allow user to specify flags
602AC_ARG_WITH(cflags,
603 [ --with-cflags Specify additional flags to pass to compiler],
604 [
Tim Rice35cc69d2005-03-17 16:44:25 -0800605 if test -n "$withval" && test "x$withval" != "xno" && \
606 test "x${withval}" != "xyes"; then
Damien Millere37bfc12000-06-05 09:37:43 +1000607 CFLAGS="$CFLAGS $withval"
608 fi
Tim Riceeae17cc2005-03-17 16:52:20 -0800609 ]
Damien Millere37bfc12000-06-05 09:37:43 +1000610)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000611AC_ARG_WITH(cppflags,
612 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
613 [
Tim Rice35cc69d2005-03-17 16:44:25 -0800614 if test -n "$withval" && test "x$withval" != "xno" && \
615 test "x${withval}" != "xyes"; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000616 CPPFLAGS="$CPPFLAGS $withval"
617 fi
618 ]
619)
Damien Millere37bfc12000-06-05 09:37:43 +1000620AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000621 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000622 [
Tim Rice35cc69d2005-03-17 16:44:25 -0800623 if test -n "$withval" && test "x$withval" != "xno" && \
624 test "x${withval}" != "xyes"; then
Damien Millere37bfc12000-06-05 09:37:43 +1000625 LDFLAGS="$LDFLAGS $withval"
626 fi
Tim Riceeae17cc2005-03-17 16:52:20 -0800627 ]
Damien Millere37bfc12000-06-05 09:37:43 +1000628)
629AC_ARG_WITH(libs,
630 [ --with-libs Specify additional libraries to link with],
631 [
Tim Rice35cc69d2005-03-17 16:44:25 -0800632 if test -n "$withval" && test "x$withval" != "xno" && \
633 test "x${withval}" != "xyes"; then
Damien Millere37bfc12000-06-05 09:37:43 +1000634 LIBS="$LIBS $withval"
635 fi
Tim Riceeae17cc2005-03-17 16:52:20 -0800636 ]
Damien Millere37bfc12000-06-05 09:37:43 +1000637)
Darren Tucker7da23cb2005-08-03 00:20:15 +1000638AC_ARG_WITH(Werror,
639 [ --with-Werror Build main code with -Werror],
640 [
641 if test -n "$withval" && test "x$withval" != "xno"; then
642 werror_flags="-Werror"
Damien Millere04ec6f2005-10-08 16:21:19 +1000643 if test "x${withval}" != "xyes"; then
Darren Tucker7da23cb2005-08-03 00:20:15 +1000644 werror_flags="$withval"
645 fi
646 fi
647 ]
648)
Damien Millere37bfc12000-06-05 09:37:43 +1000649
Darren Tucker6eb93042003-06-29 21:30:41 +1000650AC_MSG_CHECKING(compiler and flags for sanity)
Darren Tucker623d92f2004-09-12 22:36:15 +1000651AC_RUN_IFELSE(
652 [AC_LANG_SOURCE([
Darren Tucker6eb93042003-06-29 21:30:41 +1000653#include <stdio.h>
654int main(){exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +1000655 ])],
Darren Tucker6eb93042003-06-29 21:30:41 +1000656 [ AC_MSG_RESULT(yes) ],
657 [
658 AC_MSG_RESULT(no)
659 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000660 ],
661 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
Darren Tucker6eb93042003-06-29 21:30:41 +1000662)
663
Darren Tucker0c9653f2005-05-28 15:58:14 +1000664dnl Checks for header files.
665AC_CHECK_HEADERS( \
666 bstring.h \
667 crypt.h \
668 dirent.h \
669 endian.h \
670 features.h \
671 floatingpoint.h \
672 getopt.h \
673 glob.h \
674 ia.h \
Tim Rice2291c002005-08-26 13:15:19 -0700675 iaf.h \
Darren Tucker0c9653f2005-05-28 15:58:14 +1000676 lastlog.h \
677 limits.h \
678 login.h \
679 login_cap.h \
680 maillock.h \
681 ndir.h \
Damien Miller7b58e802005-12-13 19:33:19 +1100682 net/if.h \
Darren Tucker0c9653f2005-05-28 15:58:14 +1000683 netdb.h \
684 netgroup.h \
685 netinet/in_systm.h \
686 pam/pam_appl.h \
687 paths.h \
688 pty.h \
689 readpassphrase.h \
690 rpc/types.h \
691 security/pam_appl.h \
692 shadow.h \
693 stddef.h \
694 stdint.h \
Darren Tucker390b6d52005-05-28 16:54:36 +1000695 string.h \
Darren Tucker0c9653f2005-05-28 15:58:14 +1000696 strings.h \
697 sys/audit.h \
698 sys/bitypes.h \
699 sys/bsdtty.h \
700 sys/cdefs.h \
701 sys/dir.h \
702 sys/mman.h \
703 sys/ndir.h \
704 sys/prctl.h \
705 sys/pstat.h \
706 sys/select.h \
707 sys/stat.h \
708 sys/stream.h \
709 sys/stropts.h \
710 sys/strtio.h \
711 sys/sysmacros.h \
712 sys/time.h \
713 sys/timers.h \
714 sys/un.h \
715 time.h \
716 tmpdir.h \
717 ttyent.h \
Darren Tucker7d2171b2005-05-28 16:57:00 +1000718 unistd.h \
Darren Tucker0c9653f2005-05-28 15:58:14 +1000719 usersec.h \
720 util.h \
721 utime.h \
722 utmp.h \
723 utmpx.h \
Darren Tuckere910be12005-05-28 16:01:18 +1000724 vis.h \
Darren Tucker0c9653f2005-05-28 15:58:14 +1000725)
Tim Rice4cec93f2002-02-26 08:40:48 -0800726
Darren Tucker48d99d32004-08-29 17:04:50 +1000727# sys/ptms.h requires sys/stream.h to be included first on Solaris
728AC_CHECK_HEADERS(sys/ptms.h, [], [], [
729#ifdef HAVE_SYS_STREAM_H
730# include <sys/stream.h>
731#endif
732])
733
Damien Millera22ba012000-03-02 23:09:20 +1100734# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700735AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
736AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000737
Tim Rice1e1ef642003-09-11 22:19:31 -0700738dnl IRIX and Solaris 2.5.1 have dirname() in libgen
739AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
740 AC_CHECK_LIB(gen, dirname,[
741 AC_CACHE_CHECK([for broken dirname],
742 ac_cv_have_broken_dirname, [
743 save_LIBS="$LIBS"
744 LIBS="$LIBS -lgen"
Darren Tucker314d89e2005-10-17 23:29:23 +1000745 AC_RUN_IFELSE(
746 [AC_LANG_SOURCE([[
Tim Rice1e1ef642003-09-11 22:19:31 -0700747#include <libgen.h>
748#include <string.h>
749
750int main(int argc, char **argv) {
751 char *s, buf[32];
752
753 strncpy(buf,"/etc", 32);
754 s = dirname(buf);
755 if (!s || strncmp(s, "/", 32) != 0) {
756 exit(1);
757 } else {
758 exit(0);
759 }
760}
Darren Tucker314d89e2005-10-17 23:29:23 +1000761 ]])],
Tim Rice1e1ef642003-09-11 22:19:31 -0700762 [ ac_cv_have_broken_dirname="no" ],
Darren Tucker314d89e2005-10-17 23:29:23 +1000763 [ ac_cv_have_broken_dirname="yes" ],
764 [ ac_cv_have_broken_dirname="no" ],
Tim Rice1e1ef642003-09-11 22:19:31 -0700765 )
766 LIBS="$save_LIBS"
767 ])
768 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
769 LIBS="$LIBS -lgen"
770 AC_DEFINE(HAVE_DIRNAME)
771 AC_CHECK_HEADERS(libgen.h)
772 fi
773 ])
774])
775
776AC_CHECK_FUNC(getspnam, ,
777 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice7df8d392005-09-19 09:33:39 -0700778AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME, 1,
779 [Define if you have the basename function.]))
Tim Rice1e1ef642003-09-11 22:19:31 -0700780
Tim Rice13aae5e2001-10-21 17:53:58 -0700781dnl zlib is required
782AC_ARG_WITH(zlib,
783 [ --with-zlib=PATH Use zlib in PATH],
Darren Tucker86a5f8d2005-03-21 09:55:17 +1100784 [ if test "x$withval" = "xno" ; then
785 AC_MSG_ERROR([*** zlib is required ***])
786 elif test "x$withval" != "xyes"; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700787 if test -d "$withval/lib"; then
788 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700789 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700790 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700791 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700792 fi
793 else
794 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700795 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700796 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700797 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700798 fi
799 fi
800 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700801 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700802 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700803 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700804 fi
Darren Tucker86a5f8d2005-03-21 09:55:17 +1100805 fi ]
Tim Rice13aae5e2001-10-21 17:53:58 -0700806)
807
Tim Ricefcb62202004-01-23 18:35:16 -0800808AC_CHECK_LIB(z, deflate, ,
809 [
810 saved_CPPFLAGS="$CPPFLAGS"
811 saved_LDFLAGS="$LDFLAGS"
812 save_LIBS="$LIBS"
813 dnl Check default zlib install dir
814 if test -n "${need_dash_r}"; then
815 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
816 else
817 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
818 fi
819 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
820 LIBS="$LIBS -lz"
821 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
822 [
823 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
824 ]
825 )
826 ]
827)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100828AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100829
830AC_ARG_WITH(zlib-version-check,
831 [ --without-zlib-version-check Disable zlib version check],
832 [ if test "x$withval" = "xno" ; then
833 zlib_check_nonfatal=1
834 fi
835 ]
836)
837
Darren Tucker2f0b5c42005-04-24 17:52:22 +1000838AC_MSG_CHECKING(for possibly buggy zlib)
Darren Tucker623d92f2004-09-12 22:36:15 +1000839AC_RUN_IFELSE([AC_LANG_SOURCE([[
Darren Tucker2f0b5c42005-04-24 17:52:22 +1000840#include <stdio.h>
Darren Tucker2dcd2392004-01-23 17:13:33 +1100841#include <zlib.h>
842int main()
843{
Darren Tucker2f0b5c42005-04-24 17:52:22 +1000844 int a=0, b=0, c=0, d=0, n, v;
845 n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
846 if (n != 3 && n != 4)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100847 exit(1);
Darren Tucker2f0b5c42005-04-24 17:52:22 +1000848 v = a*1000000 + b*10000 + c*100 + d;
849 fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
850
851 /* 1.1.4 is OK */
852 if (a == 1 && b == 1 && c >= 4)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100853 exit(0);
Darren Tucker2f0b5c42005-04-24 17:52:22 +1000854
Darren Tucker41097ed2005-07-25 15:24:21 +1000855 /* 1.2.3 and up are OK */
856 if (v >= 1020300)
Darren Tucker2f0b5c42005-04-24 17:52:22 +1000857 exit(0);
858
Darren Tucker2dcd2392004-01-23 17:13:33 +1100859 exit(2);
860}
Darren Tucker623d92f2004-09-12 22:36:15 +1000861 ]])],
Darren Tucker2f0b5c42005-04-24 17:52:22 +1000862 AC_MSG_RESULT(no),
863 [ AC_MSG_RESULT(yes)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100864 if test -z "$zlib_check_nonfatal" ; then
865 AC_MSG_ERROR([*** zlib too old - check config.log ***
866Your reported zlib version has known security problems. It's possible your
867vendor has fixed these problems without changing the version number. If you
868are sure this is the case, you can disable the check by running
869"./configure --without-zlib-version-check".
Darren Tuckerac1910f2005-07-26 12:00:42 +1000870If you are in doubt, upgrade zlib to version 1.2.3 or greater.
Darren Tucker2f0b5c42005-04-24 17:52:22 +1000871See http://www.gzip.org/zlib/ for details.])
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100872 else
873 AC_MSG_WARN([zlib version may have security problems])
874 fi
Darren Tuckera0c2b392004-09-11 23:26:37 +1000875 ],
876 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100877)
Damien Miller6f9c3372000-10-25 10:06:04 +1100878
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000879dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100880AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000881 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
882)
Darren Tucker5bfe1682005-11-12 18:42:36 +1100883AC_CHECK_FUNCS(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700884 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
885 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000886)
Damien Millerab18c411999-11-11 10:40:23 +1100887
Tim Ricee589a292001-11-03 11:09:32 -0800888dnl Checks for libutil functions
889AC_CHECK_HEADERS(libutil.h)
Tim Rice7df8d392005-09-19 09:33:39 -0700890AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1,
891 [Define if your libraries define login()])])
Tim Ricee589a292001-11-03 11:09:32 -0800892AC_CHECK_FUNCS(logout updwtmp logwtmp)
893
Ben Lindstrom8697e082001-02-24 21:41:10 +0000894AC_FUNC_STRFTIME
895
Damien Miller3c027682001-03-14 11:39:45 +1100896# Check for ALTDIRFUNC glob() extension
897AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
898AC_EGREP_CPP(FOUNDIT,
899 [
900 #include <glob.h>
901 #ifdef GLOB_ALTDIRFUNC
902 FOUNDIT
903 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100904 ],
Damien Miller3c027682001-03-14 11:39:45 +1100905 [
Tim Rice7df8d392005-09-19 09:33:39 -0700906 AC_DEFINE(GLOB_HAS_ALTDIRFUNC, 1,
907 [Define if your system glob() function has
908 the GLOB_ALTDIRFUNC extension])
Damien Miller3c027682001-03-14 11:39:45 +1100909 AC_MSG_RESULT(yes)
910 ],
911 [
912 AC_MSG_RESULT(no)
913 ]
914)
Damien Millerab18c411999-11-11 10:40:23 +1100915
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000916# Check for g.gl_matchc glob() extension
917AC_MSG_CHECKING(for gl_matchc field in glob_t)
918AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100919 [
920 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000921 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100922 ],
923 [
Tim Rice7df8d392005-09-19 09:33:39 -0700924 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1,
925 [Define if your system glob() function has
926 gl_matchc options in glob_t])
Damien Millera8e06ce2003-11-21 23:48:55 +1100927 AC_MSG_RESULT(yes)
928 ],
929 [
930 AC_MSG_RESULT(no)
931 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000932)
933
Damien Miller18bb4732001-03-28 14:35:30 +1000934AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000935AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +1000936 [AC_LANG_SOURCE([[
Damien Miller18bb4732001-03-28 14:35:30 +1000937#include <sys/types.h>
938#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700939int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Darren Tucker623d92f2004-09-12 22:36:15 +1000940 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +1100941 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000942 [
943 AC_MSG_RESULT(no)
Tim Rice7df8d392005-09-19 09:33:39 -0700944 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME, 1,
Darren Tucker79d09fa2005-11-24 22:34:54 +1100945 [Define if your struct dirent expects you to
Tim Rice7df8d392005-09-19 09:33:39 -0700946 allocate extra space for d_name])
Darren Tuckera0c2b392004-09-11 23:26:37 +1000947 ],
Tim Riceeae17cc2005-03-17 16:52:20 -0800948 [
Darren Tuckera0c2b392004-09-11 23:26:37 +1000949 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
950 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
Damien Miller18bb4732001-03-28 14:35:30 +1000951 ]
952)
953
Damien Miller36f49652004-08-15 18:40:59 +1000954AC_MSG_CHECKING([for /proc/pid/fd directory])
955if test -d "/proc/$$/fd" ; then
Tim Rice7df8d392005-09-19 09:33:39 -0700956 AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd])
Damien Miller36f49652004-08-15 18:40:59 +1000957 AC_MSG_RESULT(yes)
958else
959 AC_MSG_RESULT(no)
960fi
961
Damien Millerc547bf12001-02-16 10:18:12 +1100962# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100963SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100964AC_ARG_WITH(skey,
Darren Tucker1b6f2292005-02-11 16:11:49 +1100965 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100966 [
967 if test "x$withval" != "xno" ; then
968
969 if test "x$withval" != "xyes" ; then
970 CPPFLAGS="$CPPFLAGS -I${withval}/include"
971 LDFLAGS="$LDFLAGS -L${withval}/lib"
972 fi
973
Tim Rice7df8d392005-09-19 09:33:39 -0700974 AC_DEFINE(SKEY, 1, [Define if you want S/Key support])
Damien Millerc547bf12001-02-16 10:18:12 +1100975 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100976 SKEY_MSG="yes"
Tim Riceeae17cc2005-03-17 16:52:20 -0800977
Tim Rice4cec93f2002-02-26 08:40:48 -0800978 AC_MSG_CHECKING([for s/key support])
Darren Tucker314d89e2005-10-17 23:29:23 +1000979 AC_LINK_IFELSE(
980 [AC_LANG_SOURCE([[
Tim Rice4cec93f2002-02-26 08:40:48 -0800981#include <stdio.h>
982#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700983int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Darren Tucker314d89e2005-10-17 23:29:23 +1000984 ]])],
Tim Rice4cec93f2002-02-26 08:40:48 -0800985 [AC_MSG_RESULT(yes)],
986 [
987 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100988 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
989 ])
Darren Tucker3b908f62004-04-14 15:26:39 +1000990 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
991 AC_TRY_COMPILE(
992 [#include <stdio.h>
993 #include <skey.h>],
994 [(void)skeychallenge(NULL,"name","",0);],
995 [AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -0700996 AC_DEFINE(SKEYCHALLENGE_4ARG, 1,
997 [Define if your skeychallenge()
998 function takes 4 arguments (NetBSD)])],
Darren Tucker3b908f62004-04-14 15:26:39 +1000999 [AC_MSG_RESULT(no)]
1000 )
Damien Millerc547bf12001-02-16 10:18:12 +11001001 fi
1002 ]
1003)
1004
1005# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -07001006TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +11001007AC_ARG_WITH(tcp-wrappers,
Darren Tucker1b6f2292005-02-11 16:11:49 +11001008 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +11001009 [
1010 if test "x$withval" != "xno" ; then
1011 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -07001012 saved_LDFLAGS="$LDFLAGS"
1013 saved_CPPFLAGS="$CPPFLAGS"
Tim Rice8bb561b2005-03-17 16:23:19 -08001014 if test -n "${withval}" && \
Tim Rice35cc69d2005-03-17 16:44:25 -08001015 test "x${withval}" != "xyes"; then
Tim Rice13aae5e2001-10-21 17:53:58 -07001016 if test -d "${withval}/lib"; then
1017 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -07001018 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -07001019 else
Tim Rice02cebcd2001-10-25 10:01:30 -07001020 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -07001021 fi
1022 else
1023 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -07001024 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -07001025 else
Tim Rice02cebcd2001-10-25 10:01:30 -07001026 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -07001027 fi
1028 fi
1029 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -07001030 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -07001031 else
Tim Rice02cebcd2001-10-25 10:01:30 -07001032 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -07001033 fi
Tim Rice13aae5e2001-10-21 17:53:58 -07001034 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001035 LIBWRAP="-lwrap"
1036 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +11001037 AC_MSG_CHECKING(for libwrap)
1038 AC_TRY_LINK(
1039 [
Damien Miller0ac45002004-04-14 20:14:26 +10001040#include <sys/types.h>
1041#include <sys/socket.h>
1042#include <netinet/in.h>
Damien Millerc547bf12001-02-16 10:18:12 +11001043#include <tcpd.h>
1044 int deny_severity = 0, allow_severity = 0;
1045 ],
1046 [hosts_access(0);],
1047 [
1048 AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -07001049 AC_DEFINE(LIBWRAP, 1,
1050 [Define if you want
1051 TCP Wrappers support])
Tim Rice4cec93f2002-02-26 08:40:48 -08001052 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -07001053 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +11001054 ],
1055 [
1056 AC_MSG_ERROR([*** libwrap missing])
1057 ]
1058 )
Tim Rice4cec93f2002-02-26 08:40:48 -08001059 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +11001060 fi
1061 ]
1062)
1063
Darren Tucker16bcc1c2004-11-07 20:14:34 +11001064# Check whether user wants libedit support
1065LIBEDIT_MSG="no"
1066AC_ARG_WITH(libedit,
Darren Tucker1b6f2292005-02-11 16:11:49 +11001067 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
Darren Tucker16bcc1c2004-11-07 20:14:34 +11001068 [ if test "x$withval" != "xno" ; then
Darren Tucker1df61452005-03-21 09:58:07 +11001069 if test "x$withval" != "xyes"; then
Darren Tuckerc373a562005-09-22 20:15:08 +10001070 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1071 if test -n "${need_dash_r}"; then
1072 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1073 else
1074 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1075 fi
Darren Tucker1df61452005-03-21 09:58:07 +11001076 fi
Darren Tucker16bcc1c2004-11-07 20:14:34 +11001077 AC_CHECK_LIB(edit, el_init,
Tim Rice7df8d392005-09-19 09:33:39 -07001078 [ AC_DEFINE(USE_LIBEDIT, 1, [Use libedit for sftp])
Darren Tucker16bcc1c2004-11-07 20:14:34 +11001079 LIBEDIT="-ledit -lcurses"
1080 LIBEDIT_MSG="yes"
1081 AC_SUBST(LIBEDIT)
1082 ],
Darren Tucker1df61452005-03-21 09:58:07 +11001083 [ AC_MSG_ERROR(libedit not found) ],
1084 [ -lcurses ]
Darren Tucker16bcc1c2004-11-07 20:14:34 +11001085 )
Darren Tuckerc7572b22005-08-10 20:34:15 +10001086 AC_MSG_CHECKING(if libedit version is compatible)
Tim Ricec1819c82005-08-15 17:48:40 -07001087 AC_COMPILE_IFELSE(
1088 [AC_LANG_SOURCE([[
1089#include <histedit.h>
Darren Tuckerc7572b22005-08-10 20:34:15 +10001090int main(void)
1091{
1092 int i = H_SETSIZE;
1093 el_init("", NULL, NULL, NULL);
1094 exit(0);
1095}
Tim Ricec1819c82005-08-15 17:48:40 -07001096 ]])],
Darren Tuckerc7572b22005-08-10 20:34:15 +10001097 [ AC_MSG_RESULT(yes) ],
1098 [ AC_MSG_RESULT(no)
1099 AC_MSG_ERROR(libedit version is not compatible) ]
1100 )
Darren Tucker16bcc1c2004-11-07 20:14:34 +11001101 fi ]
1102)
1103
Darren Tuckerd9f88912005-02-20 21:01:48 +11001104AUDIT_MODULE=none
1105AC_ARG_WITH(audit,
1106 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)],
1107 [
1108 AC_MSG_CHECKING(for supported audit module)
1109 case "$withval" in
1110 bsm)
1111 AC_MSG_RESULT(bsm)
1112 AUDIT_MODULE=bsm
1113 dnl Checks for headers, libs and functions
1114 AC_CHECK_HEADERS(bsm/audit.h, [],
1115 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)])
1116 AC_CHECK_LIB(bsm, getaudit, [],
1117 [AC_MSG_ERROR(BSM enabled and required library not found)])
1118 AC_CHECK_FUNCS(getaudit, [],
1119 [AC_MSG_ERROR(BSM enabled and required function not found)])
1120 # These are optional
Darren Tucker0d096692005-03-07 17:34:45 +11001121 AC_CHECK_FUNCS(getaudit_addr)
Tim Rice7df8d392005-09-19 09:33:39 -07001122 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module])
Darren Tuckerd9f88912005-02-20 21:01:48 +11001123 ;;
1124 debug)
1125 AUDIT_MODULE=debug
1126 AC_MSG_RESULT(debug)
Tim Rice7df8d392005-09-19 09:33:39 -07001127 AC_DEFINE(SSH_AUDIT_EVENTS, 1, Use audit debugging module)
Darren Tuckerd9f88912005-02-20 21:01:48 +11001128 ;;
Tim Rice8bc6b902005-08-09 10:09:53 -07001129 no)
Tim Ricec1819c82005-08-15 17:48:40 -07001130 AC_MSG_RESULT(no)
Tim Rice8bc6b902005-08-09 10:09:53 -07001131 ;;
Darren Tuckerd9f88912005-02-20 21:01:48 +11001132 *)
1133 AC_MSG_ERROR([Unknown audit module $withval])
1134 ;;
1135 esac ]
1136)
1137
Damien Millerfe1f1432003-02-24 15:45:42 +11001138dnl Checks for library functions. Please keep in alphabetical order
Darren Tucker0c9653f2005-05-28 15:58:14 +10001139AC_CHECK_FUNCS( \
1140 arc4random \
Damien Miller57f39152005-11-24 19:58:19 +11001141 asprintf \
Darren Tucker0c9653f2005-05-28 15:58:14 +10001142 b64_ntop \
1143 __b64_ntop \
1144 b64_pton \
1145 __b64_pton \
1146 bcopy \
1147 bindresvport_sa \
1148 clock \
1149 closefrom \
1150 dirfd \
Darren Tucker0c9653f2005-05-28 15:58:14 +10001151 fchmod \
1152 fchown \
1153 freeaddrinfo \
1154 futimes \
1155 getaddrinfo \
1156 getcwd \
1157 getgrouplist \
1158 getnameinfo \
1159 getopt \
1160 getpeereid \
1161 _getpty \
1162 getrlimit \
1163 getttyent \
1164 glob \
1165 inet_aton \
1166 inet_ntoa \
1167 inet_ntop \
1168 innetgr \
1169 login_getcapbool \
1170 md5_crypt \
1171 memmove \
1172 mkdtemp \
1173 mmap \
1174 ngetaddrinfo \
1175 nsleep \
1176 ogetaddrinfo \
1177 openlog_r \
1178 openpty \
1179 prctl \
1180 pstat \
1181 readpassphrase \
1182 realpath \
1183 recvmsg \
1184 rresvport_af \
1185 sendmsg \
1186 setdtablesize \
1187 setegid \
1188 setenv \
1189 seteuid \
1190 setgroups \
1191 setlogin \
1192 setpcred \
1193 setproctitle \
1194 setregid \
1195 setreuid \
1196 setrlimit \
1197 setsid \
1198 setvbuf \
1199 sigaction \
1200 sigvec \
1201 snprintf \
1202 socketpair \
1203 strdup \
1204 strerror \
1205 strlcat \
1206 strlcpy \
1207 strmode \
1208 strnvis \
1209 strtonum \
Darren Tucker81eb5d52005-06-01 21:39:33 +10001210 strtoll \
Darren Tucker0c9653f2005-05-28 15:58:14 +10001211 strtoul \
1212 sysconf \
1213 tcgetpgrp \
1214 truncate \
1215 unsetenv \
1216 updwtmpx \
Damien Miller57f39152005-11-24 19:58:19 +11001217 vasprintf \
Darren Tucker0c9653f2005-05-28 15:58:14 +10001218 vhangup \
1219 vsnprintf \
1220 waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +11001221)
Tim Rice13aae5e2001-10-21 17:53:58 -07001222
Darren Tuckerd5e082f2003-09-22 12:08:23 +10001223# IRIX has a const char return value for gai_strerror()
1224AC_CHECK_FUNCS(gai_strerror,[
1225 AC_DEFINE(HAVE_GAI_STRERROR)
1226 AC_TRY_COMPILE([
1227#include <sys/types.h>
1228#include <sys/socket.h>
1229#include <netdb.h>
1230
1231const char *gai_strerror(int);],[
1232char *str;
1233
1234str = gai_strerror(0);],[
1235 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
1236 [Define if gai_strerror() returns const char *])])])
1237
Tim Rice7df8d392005-09-19 09:33:39 -07001238AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1,
1239 [Some systems put nanosleep outside of libc]))
Damien Millercd6853c2003-01-28 11:33:42 +11001240
Darren Tuckerf1159b52003-07-07 19:44:01 +10001241dnl Make sure prototypes are defined for these before using them.
Darren Tuckerf1159b52003-07-07 19:44:01 +10001242AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Darren Tucker390b6d52005-05-28 16:54:36 +10001243AC_CHECK_DECL(strsep,
1244 [AC_CHECK_FUNCS(strsep)],
1245 [],
1246 [
1247#ifdef HAVE_STRING_H
1248# include <string.h>
1249#endif
1250 ])
Ben Lindstrom3e006472002-10-16 00:24:03 +00001251
Darren Tuckerb2427c82003-09-10 15:22:44 +10001252dnl tcsendbreak might be a macro
1253AC_CHECK_DECL(tcsendbreak,
1254 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +11001255 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +10001256 [#include <termios.h>]
1257)
1258
Darren Tucker5bb14002004-04-23 18:53:10 +10001259AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
1260
Darren Tucker2a6b0292003-12-31 14:59:17 +11001261AC_CHECK_FUNCS(setresuid, [
1262 dnl Some platorms have setresuid that isn't implemented, test for this
1263 AC_MSG_CHECKING(if setresuid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +10001264 AC_RUN_IFELSE(
1265 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +11001266#include <stdlib.h>
1267#include <errno.h>
1268int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +10001269 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +11001270 [AC_MSG_RESULT(yes)],
Tim Rice7df8d392005-09-19 09:33:39 -07001271 [AC_DEFINE(BROKEN_SETRESUID, 1,
1272 [Define if your setresuid() is broken])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001273 AC_MSG_RESULT(not implemented)],
1274 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +11001275 )
1276])
Darren Tuckere937be32003-12-17 18:53:26 +11001277
Darren Tucker2a6b0292003-12-31 14:59:17 +11001278AC_CHECK_FUNCS(setresgid, [
1279 dnl Some platorms have setresgid that isn't implemented, test for this
1280 AC_MSG_CHECKING(if setresgid seems to work)
Darren Tucker623d92f2004-09-12 22:36:15 +10001281 AC_RUN_IFELSE(
1282 [AC_LANG_SOURCE([[
Darren Tuckere937be32003-12-17 18:53:26 +11001283#include <stdlib.h>
1284#include <errno.h>
1285int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker623d92f2004-09-12 22:36:15 +10001286 ]])],
Darren Tucker2a6b0292003-12-31 14:59:17 +11001287 [AC_MSG_RESULT(yes)],
Tim Rice7df8d392005-09-19 09:33:39 -07001288 [AC_DEFINE(BROKEN_SETRESGID, 1,
1289 [Define if your setresgid() is broken])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001290 AC_MSG_RESULT(not implemented)],
1291 [AC_MSG_WARN([cross compiling: not checking setresuid])]
Darren Tucker2a6b0292003-12-31 14:59:17 +11001292 )
1293])
Darren Tuckere937be32003-12-17 18:53:26 +11001294
Damien Millerad833b32000-08-23 10:46:23 +10001295dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +00001296AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +10001297dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +00001298AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +00001299AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +10001300dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +00001301AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +00001302AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +11001303
Damien Millera8e06ce2003-11-21 23:48:55 +11001304AC_CHECK_FUNC(daemon,
Tim Rice7df8d392005-09-19 09:33:39 -07001305 [AC_DEFINE(HAVE_DAEMON, 1, [Define if your libraries define daemon()])],
1306 [AC_CHECK_LIB(bsd, daemon,
1307 [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
Damien Miller04f80141999-11-19 15:32:34 +11001308)
1309
Damien Millera8e06ce2003-11-21 23:48:55 +11001310AC_CHECK_FUNC(getpagesize,
Tim Rice7df8d392005-09-19 09:33:39 -07001311 [AC_DEFINE(HAVE_GETPAGESIZE, 1,
1312 [Define if your libraries define getpagesize()])],
1313 [AC_CHECK_LIB(ucb, getpagesize,
1314 [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
Damien Miller9fb07e42000-03-05 16:22:59 +11001315)
1316
Damien Millercb170cb2000-07-01 16:52:55 +10001317# Check for broken snprintf
1318if test "x$ac_cv_func_snprintf" = "xyes" ; then
1319 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001320 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001321 [AC_LANG_SOURCE([[
Damien Millercb170cb2000-07-01 16:52:55 +10001322#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001323int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Darren Tucker623d92f2004-09-12 22:36:15 +10001324 ]])],
Damien Millera8e06ce2003-11-21 23:48:55 +11001325 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +10001326 [
1327 AC_MSG_RESULT(no)
Tim Rice7df8d392005-09-19 09:33:39 -07001328 AC_DEFINE(BROKEN_SNPRINTF, 1,
1329 [Define if your snprintf is busted])
Damien Millercb170cb2000-07-01 16:52:55 +10001330 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001331 ],
1332 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
Damien Millercb170cb2000-07-01 16:52:55 +10001333 )
1334fi
1335
Damien Miller57f39152005-11-24 19:58:19 +11001336# If we don't have a working asprintf, then we strongly depend on vsnprintf
1337# returning the right thing on overflow: the number of characters it tried to
1338# create (as per SUSv3)
1339if test "x$ac_cv_func_asprintf" != "xyes" && \
1340 test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1341 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
1342 AC_RUN_IFELSE(
1343 [AC_LANG_SOURCE([[
1344#include <sys/types.h>
1345#include <stdio.h>
1346#include <stdarg.h>
1347
1348int x_snprintf(char *str,size_t count,const char *fmt,...)
1349{
1350 size_t ret; va_list ap;
1351 va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);
1352 return ret;
1353}
1354int main(void)
1355{
1356 char x[1];
1357 exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
1358} ]])],
1359 [AC_MSG_RESULT(yes)],
1360 [
1361 AC_MSG_RESULT(no)
1362 AC_DEFINE(BROKEN_SNPRINTF, 1,
1363 [Define if your snprintf is busted])
1364 AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor])
1365 ],
1366 [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ]
1367 )
1368fi
1369
Darren Tuckerd40c66c2005-12-17 22:32:03 +11001370# On systems where [v]snprintf is broken, but is declared in stdio,
1371# check that the fmt argument is const char * or just char *.
1372# This is only useful for when BROKEN_SNPRINTF
1373AC_MSG_CHECKING([whether snprintf can declare const char *fmt])
1374AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
1375 int snprintf(char *a, size_t b, const char *c, ...) { return 0; }
1376 int main(void) { snprintf(0, 0, 0); }
1377 ]])],
1378 [AC_MSG_RESULT(yes)
1379 AC_DEFINE(SNPRINTF_CONST, [const],
1380 [Define as const if snprintf() can declare const char *fmt])],
1381 [AC_MSG_RESULT(no)
1382 AC_DEFINE(SNPRINTF_CONST, [/* not const */])])
1383
Damien Millerb4097182004-05-23 14:09:40 +10001384# Check for missing getpeereid (or equiv) support
1385NO_PEERCHECK=""
1386if test "x$ac_cv_func_getpeereid" != "xyes" ; then
1387 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1388 AC_TRY_COMPILE(
1389 [#include <sys/types.h>
1390 #include <sys/socket.h>],
1391 [int i = SO_PEERCRED;],
Darren Tucker9d2562c2005-04-05 19:22:45 +10001392 [ AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -07001393 AC_DEFINE(HAVE_SO_PEERCRED, 1, [Have PEERCRED socket option])
Darren Tucker9d2562c2005-04-05 19:22:45 +10001394 ],
Damien Millerb4097182004-05-23 14:09:40 +10001395 [AC_MSG_RESULT(no)
1396 NO_PEERCHECK=1]
1397 )
1398fi
1399
Damien Millere8328192003-01-07 15:18:32 +11001400dnl see whether mkstemp() requires XXXXXX
1401if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1402AC_MSG_CHECKING([for (overly) strict mkstemp])
Darren Tucker314d89e2005-10-17 23:29:23 +10001403AC_RUN_IFELSE(
1404 [AC_LANG_SOURCE([[
Damien Millere8328192003-01-07 15:18:32 +11001405#include <stdlib.h>
1406main() { char template[]="conftest.mkstemp-test";
1407if (mkstemp(template) == -1)
1408 exit(1);
1409unlink(template); exit(0);
1410}
Darren Tucker314d89e2005-10-17 23:29:23 +10001411 ]])],
Damien Millere8328192003-01-07 15:18:32 +11001412 [
1413 AC_MSG_RESULT(no)
1414 ],
Damien Millera8e06ce2003-11-21 23:48:55 +11001415 [
Damien Millere8328192003-01-07 15:18:32 +11001416 AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -07001417 AC_DEFINE(HAVE_STRICT_MKSTEMP, 1, [Silly mkstemp()])
Damien Millere8328192003-01-07 15:18:32 +11001418 ],
1419 [
1420 AC_MSG_RESULT(yes)
1421 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +11001422 ]
Damien Millere8328192003-01-07 15:18:32 +11001423)
1424fi
1425
Darren Tucker70a3d552003-08-21 17:58:29 +10001426dnl make sure that openpty does not reacquire controlling terminal
1427if test ! -z "$check_for_openpty_ctty_bug"; then
1428 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
Darren Tucker314d89e2005-10-17 23:29:23 +10001429 AC_RUN_IFELSE(
1430 [AC_LANG_SOURCE([[
Darren Tucker70a3d552003-08-21 17:58:29 +10001431#include <stdio.h>
1432#include <sys/fcntl.h>
1433#include <sys/types.h>
1434#include <sys/wait.h>
1435
1436int
1437main()
1438{
1439 pid_t pid;
1440 int fd, ptyfd, ttyfd, status;
1441
1442 pid = fork();
1443 if (pid < 0) { /* failed */
1444 exit(1);
1445 } else if (pid > 0) { /* parent */
1446 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +11001447 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +10001448 exit(WEXITSTATUS(status));
1449 else
1450 exit(2);
1451 } else { /* child */
1452 close(0); close(1); close(2);
1453 setsid();
1454 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
1455 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1456 if (fd >= 0)
1457 exit(3); /* Acquired ctty: broken */
1458 else
1459 exit(0); /* Did not acquire ctty: OK */
1460 }
1461}
Darren Tucker314d89e2005-10-17 23:29:23 +10001462 ]])],
Darren Tucker70a3d552003-08-21 17:58:29 +10001463 [
1464 AC_MSG_RESULT(yes)
1465 ],
1466 [
1467 AC_MSG_RESULT(no)
1468 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker314d89e2005-10-17 23:29:23 +10001469 ],
1470 [
1471 AC_MSG_RESULT(cross-compiling, assuming yes)
Darren Tucker70a3d552003-08-21 17:58:29 +10001472 ]
1473 )
1474fi
1475
Tim Rice8bb561b2005-03-17 16:23:19 -08001476if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1477 test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
Darren Tucker4398cf52004-04-06 21:39:02 +10001478 AC_MSG_CHECKING(if getaddrinfo seems to work)
Darren Tucker314d89e2005-10-17 23:29:23 +10001479 AC_RUN_IFELSE(
1480 [AC_LANG_SOURCE([[
Darren Tucker4398cf52004-04-06 21:39:02 +10001481#include <stdio.h>
1482#include <sys/socket.h>
1483#include <netdb.h>
1484#include <errno.h>
1485#include <netinet/in.h>
1486
1487#define TEST_PORT "2222"
1488
1489int
1490main(void)
1491{
1492 int err, sock;
1493 struct addrinfo *gai_ai, *ai, hints;
1494 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1495
1496 memset(&hints, 0, sizeof(hints));
1497 hints.ai_family = PF_UNSPEC;
1498 hints.ai_socktype = SOCK_STREAM;
1499 hints.ai_flags = AI_PASSIVE;
1500
1501 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1502 if (err != 0) {
1503 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1504 exit(1);
1505 }
1506
1507 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1508 if (ai->ai_family != AF_INET6)
1509 continue;
1510
1511 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1512 sizeof(ntop), strport, sizeof(strport),
1513 NI_NUMERICHOST|NI_NUMERICSERV);
1514
1515 if (err != 0) {
1516 if (err == EAI_SYSTEM)
1517 perror("getnameinfo EAI_SYSTEM");
1518 else
1519 fprintf(stderr, "getnameinfo failed: %s\n",
1520 gai_strerror(err));
1521 exit(2);
1522 }
1523
1524 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1525 if (sock < 0)
1526 perror("socket");
1527 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1528 if (errno == EBADF)
1529 exit(3);
1530 }
1531 }
1532 exit(0);
1533}
Darren Tucker314d89e2005-10-17 23:29:23 +10001534 ]])],
Darren Tucker4398cf52004-04-06 21:39:02 +10001535 [
1536 AC_MSG_RESULT(yes)
1537 ],
1538 [
1539 AC_MSG_RESULT(no)
1540 AC_DEFINE(BROKEN_GETADDRINFO)
Darren Tucker314d89e2005-10-17 23:29:23 +10001541 ],
1542 [
1543 AC_MSG_RESULT(cross-compiling, assuming yes)
Darren Tucker4398cf52004-04-06 21:39:02 +10001544 ]
1545 )
1546fi
1547
Tim Rice8bb561b2005-03-17 16:23:19 -08001548if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1549 test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
Darren Tucker691d5232005-02-15 21:45:57 +11001550 AC_MSG_CHECKING(if getaddrinfo seems to work)
Darren Tucker314d89e2005-10-17 23:29:23 +10001551 AC_RUN_IFELSE(
1552 [AC_LANG_SOURCE([[
Darren Tucker691d5232005-02-15 21:45:57 +11001553#include <stdio.h>
1554#include <sys/socket.h>
1555#include <netdb.h>
1556#include <errno.h>
1557#include <netinet/in.h>
1558
1559#define TEST_PORT "2222"
1560
1561int
1562main(void)
1563{
1564 int err, sock;
1565 struct addrinfo *gai_ai, *ai, hints;
1566 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1567
1568 memset(&hints, 0, sizeof(hints));
1569 hints.ai_family = PF_UNSPEC;
1570 hints.ai_socktype = SOCK_STREAM;
1571 hints.ai_flags = AI_PASSIVE;
1572
1573 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1574 if (err != 0) {
1575 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1576 exit(1);
1577 }
1578
1579 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1580 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1581 continue;
1582
1583 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1584 sizeof(ntop), strport, sizeof(strport),
1585 NI_NUMERICHOST|NI_NUMERICSERV);
1586
1587 if (ai->ai_family == AF_INET && err != 0) {
1588 perror("getnameinfo");
1589 exit(2);
1590 }
1591 }
1592 exit(0);
1593}
Darren Tucker314d89e2005-10-17 23:29:23 +10001594 ]])],
Darren Tucker691d5232005-02-15 21:45:57 +11001595 [
1596 AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -07001597 AC_DEFINE(AIX_GETNAMEINFO_HACK, 1,
1598 [Define if you have a getaddrinfo that fails
1599 for the all-zeros IPv6 address])
Darren Tucker691d5232005-02-15 21:45:57 +11001600 ],
1601 [
1602 AC_MSG_RESULT(no)
1603 AC_DEFINE(BROKEN_GETADDRINFO)
Darren Tucker314d89e2005-10-17 23:29:23 +10001604 ],
1605 AC_MSG_RESULT(cross-compiling, assuming no)
Darren Tucker691d5232005-02-15 21:45:57 +11001606 ]
1607 )
1608fi
1609
Darren Tuckera56f1912004-11-02 20:30:54 +11001610if test "x$check_for_conflicting_getspnam" = "x1"; then
1611 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1612 AC_COMPILE_IFELSE(
1613 [
1614#include <shadow.h>
1615int main(void) {exit(0);}
1616 ],
1617 [
1618 AC_MSG_RESULT(no)
1619 ],
1620 [
1621 AC_MSG_RESULT(yes)
1622 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1623 [Conflicting defs for getspnam])
1624 ]
1625 )
1626fi
1627
Damien Miller606f8802000-09-16 15:39:56 +11001628AC_FUNC_GETPGRP
1629
Damien Millera64b57a2001-01-17 10:44:13 +11001630# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +10001631PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +11001632AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +11001633 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +11001634 [
Damien Millera64b57a2001-01-17 10:44:13 +11001635 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +11001636 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1637 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +11001638 AC_MSG_ERROR([PAM headers not found])
1639 fi
1640
1641 AC_CHECK_LIB(dl, dlopen, , )
1642 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1643 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001644 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001645
Damien Millera64b57a2001-01-17 10:44:13 +11001646 PAM_MSG="yes"
1647
Tim Rice7df8d392005-09-19 09:33:39 -07001648 AC_DEFINE(USE_PAM, 1,
1649 [Define if you want to enable PAM support])
Tim Rice7d2d1f12002-02-26 22:05:11 -08001650 if test $ac_cv_lib_dl_dlopen = yes; then
1651 LIBPAM="-lpam -ldl"
1652 else
1653 LIBPAM="-lpam"
1654 fi
1655 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001656 fi
1657 ]
1658)
Damien Millera22ba012000-03-02 23:09:20 +11001659
Damien Millera64b57a2001-01-17 10:44:13 +11001660# Check for older PAM
1661if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001662 # Check PAM strerror arguments (old PAM)
1663 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1664 AC_TRY_COMPILE(
1665 [
Damien Miller81171112000-04-23 11:14:01 +10001666#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001667#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001668#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001669#elif defined (HAVE_PAM_PAM_APPL_H)
1670#include <pam/pam_appl.h>
1671#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001672 ],
1673 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001674 [AC_MSG_RESULT(no)],
1675 [
Tim Rice7df8d392005-09-19 09:33:39 -07001676 AC_DEFINE(HAVE_OLD_PAM, 1,
1677 [Define if you have an old version of PAM
1678 which takes only one argument to pam_strerror])
Damien Millera22ba012000-03-02 23:09:20 +11001679 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001680 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001681 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001682 )
Damien Millera22ba012000-03-02 23:09:20 +11001683fi
1684
Tim Riceaef73712002-05-11 13:17:42 -07001685# Search for OpenSSL
1686saved_CPPFLAGS="$CPPFLAGS"
1687saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001688AC_ARG_WITH(ssl-dir,
1689 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1690 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001691 if test "x$withval" != "xno" ; then
Darren Tuckerc7e38d52005-02-09 22:12:30 +11001692 case "$withval" in
1693 # Relative paths
1694 ./*|../*) withval="`pwd`/$withval"
1695 esac
Tim Riceaef73712002-05-11 13:17:42 -07001696 if test -d "$withval/lib"; then
1697 if test -n "${need_dash_r}"; then
1698 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1699 else
1700 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1701 fi
1702 else
1703 if test -n "${need_dash_r}"; then
1704 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1705 else
1706 LDFLAGS="-L${withval} ${LDFLAGS}"
1707 fi
1708 fi
1709 if test -d "$withval/include"; then
1710 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1711 else
1712 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1713 fi
Damien Millera22ba012000-03-02 23:09:20 +11001714 fi
1715 ]
1716)
Tim Rice3d5352e2004-02-12 09:27:21 -08001717LIBS="-lcrypto $LIBS"
Tim Rice7df8d392005-09-19 09:33:39 -07001718AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
1719 [Define if your ssl headers are included
1720 with #include <openssl/header.h>]),
Damien Miller3b512e12000-05-17 23:29:18 +10001721 [
Tim Riceaef73712002-05-11 13:17:42 -07001722 dnl Check default openssl install dir
1723 if test -n "${need_dash_r}"; then
1724 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001725 else
Tim Riceaef73712002-05-11 13:17:42 -07001726 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001727 fi
Tim Riceaef73712002-05-11 13:17:42 -07001728 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1729 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1730 [
1731 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1732 ]
1733 )
1734 ]
1735)
1736
Tim Riced730b782002-08-13 18:52:10 -07001737# Determine OpenSSL header version
1738AC_MSG_CHECKING([OpenSSL header version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001739AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001740 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001741#include <stdio.h>
1742#include <string.h>
1743#include <openssl/opensslv.h>
1744#define DATA "conftest.sslincver"
1745int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001746 FILE *fd;
1747 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001748
Damien Millera8e06ce2003-11-21 23:48:55 +11001749 fd = fopen(DATA,"w");
1750 if(fd == NULL)
1751 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001752
1753 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1754 exit(1);
1755
1756 exit(0);
1757}
Darren Tucker623d92f2004-09-12 22:36:15 +10001758 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001759 [
1760 ssl_header_ver=`cat conftest.sslincver`
1761 AC_MSG_RESULT($ssl_header_ver)
1762 ],
1763 [
1764 AC_MSG_RESULT(not found)
1765 AC_MSG_ERROR(OpenSSL version header not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001766 ],
1767 [
1768 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001769 ]
1770)
1771
1772# Determine OpenSSL library version
1773AC_MSG_CHECKING([OpenSSL library version])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001774AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001775 [AC_LANG_SOURCE([[
Tim Riced730b782002-08-13 18:52:10 -07001776#include <stdio.h>
1777#include <string.h>
1778#include <openssl/opensslv.h>
1779#include <openssl/crypto.h>
1780#define DATA "conftest.ssllibver"
1781int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001782 FILE *fd;
1783 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001784
Damien Millera8e06ce2003-11-21 23:48:55 +11001785 fd = fopen(DATA,"w");
1786 if(fd == NULL)
1787 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001788
1789 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1790 exit(1);
1791
1792 exit(0);
1793}
Darren Tucker623d92f2004-09-12 22:36:15 +10001794 ]])],
Tim Riced730b782002-08-13 18:52:10 -07001795 [
1796 ssl_library_ver=`cat conftest.ssllibver`
1797 AC_MSG_RESULT($ssl_library_ver)
1798 ],
1799 [
1800 AC_MSG_RESULT(not found)
1801 AC_MSG_ERROR(OpenSSL library not found.)
Darren Tuckera0c2b392004-09-11 23:26:37 +10001802 ],
1803 [
1804 AC_MSG_WARN([cross compiling: not checking])
Tim Riced730b782002-08-13 18:52:10 -07001805 ]
1806)
Damien Millera22ba012000-03-02 23:09:20 +11001807
Damien Millerec932372002-01-22 22:16:03 +11001808# Sanity check OpenSSL headers
1809AC_MSG_CHECKING([whether OpenSSL's headers match the library])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001810AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001811 [AC_LANG_SOURCE([[
Damien Millerec932372002-01-22 22:16:03 +11001812#include <string.h>
1813#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001814int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001815 ]])],
Damien Millerec932372002-01-22 22:16:03 +11001816 [
1817 AC_MSG_RESULT(yes)
1818 ],
1819 [
1820 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001821 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1822Check config.log for details.
1823Also see contrib/findssl.sh for help identifying header/library mismatches.])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001824 ],
1825 [
1826 AC_MSG_WARN([cross compiling: not checking])
Damien Millerec932372002-01-22 22:16:03 +11001827 ]
1828)
1829
Darren Tucker129d0bb2005-12-19 17:40:40 +11001830# Check for OpenSSL without EVP_aes_{192,256}_cbc
1831AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
1832AC_COMPILE_IFELSE(
1833 [AC_LANG_SOURCE([[
1834#include <string.h>
1835#include <openssl/evp.h>
Darren Tuckercc7c2122006-02-02 18:44:19 +11001836int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);}
Darren Tucker129d0bb2005-12-19 17:40:40 +11001837 ]])],
1838 [
1839 AC_MSG_RESULT(no)
1840 ],
1841 [
1842 AC_MSG_RESULT(yes)
1843 AC_DEFINE(OPENSSL_LOBOTOMISED_AES, 1,
1844 [libcrypto is missing AES 192 and 256 bit functions])
1845 ]
1846)
1847
Tim Rice3d5352e2004-02-12 09:27:21 -08001848# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1849# because the system crypt() is more featureful.
1850if test "x$check_for_libcrypt_before" = "x1"; then
1851 AC_CHECK_LIB(crypt, crypt)
1852fi
1853
Damien Millera8e06ce2003-11-21 23:48:55 +11001854# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001855# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001856if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001857 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001858fi
1859
Tim Rice2291c002005-08-26 13:15:19 -07001860AC_CHECK_LIB(iaf, ia_openinfo)
Damien Miller6c21c512002-01-22 21:57:53 +11001861
1862### Configure cryptographic random number support
1863
1864# Check wheter OpenSSL seeds itself
1865AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
Darren Tuckera0c2b392004-09-11 23:26:37 +10001866AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10001867 [AC_LANG_SOURCE([[
Damien Miller6c21c512002-01-22 21:57:53 +11001868#include <string.h>
1869#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001870int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Darren Tucker623d92f2004-09-12 22:36:15 +10001871 ]])],
Damien Miller6c21c512002-01-22 21:57:53 +11001872 [
1873 OPENSSL_SEEDS_ITSELF=yes
1874 AC_MSG_RESULT(yes)
1875 ],
1876 [
1877 AC_MSG_RESULT(no)
1878 # Default to use of the rand helper if OpenSSL doesn't
1879 # seed itself
1880 USE_RAND_HELPER=yes
Darren Tuckera0c2b392004-09-11 23:26:37 +10001881 ],
1882 [
1883 AC_MSG_WARN([cross compiling: assuming yes])
1884 # This is safe, since all recent OpenSSL versions will
Tim Riceeae17cc2005-03-17 16:52:20 -08001885 # complain at runtime if not seeded correctly.
Darren Tuckera0c2b392004-09-11 23:26:37 +10001886 OPENSSL_SEEDS_ITSELF=yes
Damien Miller6c21c512002-01-22 21:57:53 +11001887 ]
1888)
1889
1890
1891# Do we want to force the use of the rand helper?
1892AC_ARG_WITH(rand-helper,
1893 [ --with-rand-helper Use subprocess to gather strong randomness ],
1894 [
1895 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001896 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001897 # the previous test showed it to be unseeded.
1898 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1899 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1900 OPENSSL_SEEDS_ITSELF=yes
1901 USE_RAND_HELPER=""
1902 fi
1903 else
1904 USE_RAND_HELPER=yes
1905 fi
1906 ],
Tim Riceeae17cc2005-03-17 16:52:20 -08001907)
Damien Miller6c21c512002-01-22 21:57:53 +11001908
1909# Which randomness source do we use?
Tim Rice8bb561b2005-03-17 16:23:19 -08001910if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001911 # OpenSSL only
Tim Rice7df8d392005-09-19 09:33:39 -07001912 AC_DEFINE(OPENSSL_PRNG_ONLY, 1,
1913 [Define if you want OpenSSL's internally seeded PRNG only])
Damien Miller6c21c512002-01-22 21:57:53 +11001914 RAND_MSG="OpenSSL internal ONLY"
1915 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001916elif test ! -z "$USE_RAND_HELPER" ; then
1917 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001918 RAND_MSG="ssh-rand-helper"
1919 INSTALL_SSH_RAND_HELPER="yes"
1920fi
1921AC_SUBST(INSTALL_SSH_RAND_HELPER)
1922
1923### Configuration of ssh-rand-helper
1924
1925# PRNGD TCP socket
1926AC_ARG_WITH(prngd-port,
1927 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1928 [
Damien Millere996d722002-01-23 11:20:59 +11001929 case "$withval" in
1930 no)
1931 withval=""
1932 ;;
1933 [[0-9]]*)
1934 ;;
1935 *)
1936 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1937 ;;
1938 esac
1939 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001940 PRNGD_PORT="$withval"
Tim Rice7df8d392005-09-19 09:33:39 -07001941 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT,
1942 [Port number of PRNGD/EGD random number socket])
Damien Miller6c21c512002-01-22 21:57:53 +11001943 fi
1944 ]
1945)
1946
1947# PRNGD Unix domain socket
1948AC_ARG_WITH(prngd-socket,
1949 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1950 [
Damien Millere996d722002-01-23 11:20:59 +11001951 case "$withval" in
1952 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001953 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001954 ;;
1955 no)
1956 withval=""
1957 ;;
1958 /*)
1959 ;;
1960 *)
1961 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1962 ;;
1963 esac
1964
1965 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001966 if test ! -z "$PRNGD_PORT" ; then
1967 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1968 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001969 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001970 AC_MSG_WARN(Entropy socket is not readable)
1971 fi
1972 PRNGD_SOCKET="$withval"
Tim Rice7df8d392005-09-19 09:33:39 -07001973 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET",
1974 [Location of PRNGD/EGD random number socket])
Damien Miller6c21c512002-01-22 21:57:53 +11001975 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001976 ],
1977 [
1978 # Check for existing socket only if we don't have a random device already
1979 if test "$USE_RAND_HELPER" = yes ; then
1980 AC_MSG_CHECKING(for PRNGD/EGD socket)
1981 # Insert other locations here
1982 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1983 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1984 PRNGD_SOCKET="$sock"
1985 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1986 break;
1987 fi
1988 done
1989 if test ! -z "$PRNGD_SOCKET" ; then
1990 AC_MSG_RESULT($PRNGD_SOCKET)
1991 else
1992 AC_MSG_RESULT(not found)
1993 fi
1994 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001995 ]
1996)
1997
1998# Change default command timeout for hashing entropy source
1999entropy_timeout=200
2000AC_ARG_WITH(entropy-timeout,
2001 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
2002 [
Tim Rice35cc69d2005-03-17 16:44:25 -08002003 if test -n "$withval" && test "x$withval" != "xno" && \
2004 test "x${withval}" != "xyes"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002005 entropy_timeout=$withval
2006 fi
Tim Riceeae17cc2005-03-17 16:52:20 -08002007 ]
Damien Miller6c21c512002-01-22 21:57:53 +11002008)
Tim Rice7df8d392005-09-19 09:33:39 -07002009AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout,
2010 [Builtin PRNG command timeout])
Damien Miller6c21c512002-01-22 21:57:53 +11002011
Damien Millerd3f6ad22002-06-25 10:24:47 +10002012SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00002013AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00002014 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00002015 [
Tim Rice35cc69d2005-03-17 16:44:25 -08002016 if test -n "$withval" && test "x$withval" != "xno" && \
2017 test "x${withval}" != "xyes"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10002018 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00002019 fi
Tim Riceeae17cc2005-03-17 16:52:20 -08002020 ]
Kevin Steves7ff91122002-04-07 19:22:54 +00002021)
Tim Rice7df8d392005-09-19 09:33:39 -07002022AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER",
2023 [non-privileged user for privilege separation])
Damien Millerd3f6ad22002-06-25 10:24:47 +10002024AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00002025
Tim Rice88f2ab52002-03-17 12:17:34 -08002026# We do this little dance with the search path to insure
2027# that programs that we select for use by installed programs
2028# (which may be run by the super-user) come from trusted
2029# locations before they come from the user's private area.
2030# This should help avoid accidentally configuring some
2031# random version of a program in someone's personal bin.
2032
2033OPATH=$PATH
2034PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07002035test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08002036test -d /sbin && PATH=$PATH:/sbin
2037test -d /usr/sbin && PATH=$PATH:/usr/sbin
2038PATH=$PATH:/etc:$OPATH
2039
Damien Millera8e06ce2003-11-21 23:48:55 +11002040# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11002041OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
2042OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
2043OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
2044OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
2045OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
2046OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
2047OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
2048OSSH_PATH_ENTROPY_PROG(PROG_W, w)
2049OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
2050OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
2051OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
2052OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
2053OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
2054OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
2055OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
2056OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08002057# restore PATH
2058PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11002059
2060# Where does ssh-rand-helper get its randomness from?
2061INSTALL_SSH_PRNG_CMDS=""
2062if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
2063 if test ! -z "$PRNGD_PORT" ; then
2064 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
2065 elif test ! -z "$PRNGD_SOCKET" ; then
2066 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
2067 else
2068 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
2069 RAND_HELPER_CMDHASH=yes
2070 INSTALL_SSH_PRNG_CMDS="yes"
2071 fi
2072fi
2073AC_SUBST(INSTALL_SSH_PRNG_CMDS)
2074
2075
Ben Lindstromb5628642000-10-18 00:02:25 +00002076# Cheap hack to ensure NEWS-OS libraries are arranged right.
2077if test ! -z "$SONY" ; then
2078 LIBS="$LIBS -liberty";
2079fi
2080
Damien Miller57f39152005-11-24 19:58:19 +11002081# Check for long long datatypes
2082AC_CHECK_TYPES([long long, unsigned long long, long double])
2083
2084# Check datatype sizes
Damien Millere0f45742000-01-18 09:12:06 +11002085AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11002086AC_CHECK_SIZEOF(short int, 2)
2087AC_CHECK_SIZEOF(int, 4)
2088AC_CHECK_SIZEOF(long int, 4)
2089AC_CHECK_SIZEOF(long long int, 8)
2090
Damien Millerfa2bb692002-04-23 23:22:25 +10002091# Sanity check long long for some platforms (AIX)
2092if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
2093 ac_cv_sizeof_long_long_int=0
2094fi
2095
Darren Tucker537f1ed2005-10-25 18:38:33 +10002096# compute LLONG_MIN and LLONG_MAX if we don't know them.
2097if test -z "$have_llong_max"; then
2098 AC_MSG_CHECKING([for max value of long long])
2099 AC_RUN_IFELSE(
2100 [AC_LANG_SOURCE([[
2101#include <stdio.h>
2102/* Why is this so damn hard? */
2103#ifdef __GNUC__
2104# undef __GNUC__
2105#endif
2106#define __USE_ISOC99
2107#include <limits.h>
2108#define DATA "conftest.llminmax"
2109int main(void) {
2110 FILE *f;
2111 long long i, llmin, llmax = 0;
2112
2113 if((f = fopen(DATA,"w")) == NULL)
2114 exit(1);
2115
2116#if defined(LLONG_MIN) && defined(LLONG_MAX)
2117 fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
2118 llmin = LLONG_MIN;
2119 llmax = LLONG_MAX;
2120#else
2121 fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
2122 /* This will work on one's complement and two's complement */
2123 for (i = 1; i > llmax; i <<= 1, i++)
2124 llmax = i;
2125 llmin = llmax + 1LL; /* wrap */
2126#endif
2127
2128 /* Sanity check */
2129 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
2130 || llmax - 1 > llmax) {
2131 fprintf(f, "unknown unknown\n");
2132 exit(2);
2133 }
2134
2135 if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
2136 exit(3);
2137
2138 exit(0);
2139}
2140 ]])],
2141 [
2142 llong_min=`$AWK '{print $1}' conftest.llminmax`
2143 llong_max=`$AWK '{print $2}' conftest.llminmax`
2144
2145 # snprintf on some Tru64s doesn't understand "%lld"
2146 case "$host" in
2147 alpha-dec-osf*)
2148 if test "x$ac_cv_sizeof_long_long_int" = "x8" &&
2149 test "x$llong_max" = "xld"; then
2150 llong_min="-9223372036854775808"
2151 llong_max="9223372036854775807"
2152 fi
2153 ;;
2154 esac
2155
2156 AC_MSG_RESULT($llong_max)
2157 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
2158 [max value of long long calculated by configure])
2159 AC_MSG_CHECKING([for min value of long long])
2160 AC_MSG_RESULT($llong_min)
2161 AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL],
2162 [min value of long long calculated by configure])
2163 ],
2164 [
2165 AC_MSG_RESULT(not found)
2166 ],
2167 [
2168 AC_MSG_WARN([cross compiling: not checking])
2169 ]
2170 )
2171fi
2172
2173
Damien Millera22ba012000-03-02 23:09:20 +11002174# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11002175AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
2176 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002177 [ #include <sys/types.h> ],
2178 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11002179 [ ac_cv_have_u_int="yes" ],
2180 [ ac_cv_have_u_int="no" ]
2181 )
2182])
2183if test "x$ac_cv_have_u_int" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002184 AC_DEFINE(HAVE_U_INT, 1, [define if you have u_int data type])
Damien Millercaf6dd62000-08-29 11:33:50 +11002185 have_u_int=1
2186fi
2187
Damien Miller61e50f12000-05-08 20:49:37 +10002188AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
2189 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002190 [ #include <sys/types.h> ],
2191 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10002192 [ ac_cv_have_intxx_t="yes" ],
2193 [ ac_cv_have_intxx_t="no" ]
2194 )
2195])
2196if test "x$ac_cv_have_intxx_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002197 AC_DEFINE(HAVE_INTXX_T, 1, [define if you have intxx_t data type])
Damien Miller61e50f12000-05-08 20:49:37 +10002198 have_intxx_t=1
2199fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002200
2201if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11002202 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002203then
2204 AC_MSG_CHECKING([for intXX_t types in stdint.h])
2205 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002206 [ #include <stdint.h> ],
2207 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002208 [
2209 AC_DEFINE(HAVE_INTXX_T)
2210 AC_MSG_RESULT(yes)
2211 ],
2212 [ AC_MSG_RESULT(no) ]
2213 )
2214fi
2215
Damien Miller578783e2000-09-23 14:12:24 +11002216AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
2217 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07002218 [
2219#include <sys/types.h>
2220#ifdef HAVE_STDINT_H
2221# include <stdint.h>
2222#endif
2223#include <sys/socket.h>
2224#ifdef HAVE_SYS_BITYPES_H
2225# include <sys/bitypes.h>
2226#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11002227 ],
2228 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11002229 [ ac_cv_have_int64_t="yes" ],
2230 [ ac_cv_have_int64_t="no" ]
2231 )
2232])
2233if test "x$ac_cv_have_int64_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002234 AC_DEFINE(HAVE_INT64_T, 1, [define if you have int64_t data type])
Tim Rice4cec93f2002-02-26 08:40:48 -08002235fi
2236
Damien Miller61e50f12000-05-08 20:49:37 +10002237AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
2238 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002239 [ #include <sys/types.h> ],
2240 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10002241 [ ac_cv_have_u_intxx_t="yes" ],
2242 [ ac_cv_have_u_intxx_t="no" ]
2243 )
2244])
2245if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002246 AC_DEFINE(HAVE_U_INTXX_T, 1, [define if you have u_intxx_t data type])
Damien Miller61e50f12000-05-08 20:49:37 +10002247 have_u_intxx_t=1
2248fi
Damien Millerc6398ef1999-11-20 12:18:40 +11002249
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002250if test -z "$have_u_intxx_t" ; then
2251 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
2252 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002253 [ #include <sys/socket.h> ],
2254 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002255 [
2256 AC_DEFINE(HAVE_U_INTXX_T)
2257 AC_MSG_RESULT(yes)
2258 ],
2259 [ AC_MSG_RESULT(no) ]
2260 )
2261fi
2262
Damien Miller578783e2000-09-23 14:12:24 +11002263AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
2264 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002265 [ #include <sys/types.h> ],
2266 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11002267 [ ac_cv_have_u_int64_t="yes" ],
2268 [ ac_cv_have_u_int64_t="no" ]
2269 )
2270])
2271if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002272 AC_DEFINE(HAVE_U_INT64_T, 1, [define if you have u_int64_t data type])
Damien Miller578783e2000-09-23 14:12:24 +11002273 have_u_int64_t=1
2274fi
2275
Tim Rice4cec93f2002-02-26 08:40:48 -08002276if test -z "$have_u_int64_t" ; then
2277 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
2278 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002279 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08002280 [ u_int64_t a; a = 1],
2281 [
2282 AC_DEFINE(HAVE_U_INT64_T)
2283 AC_MSG_RESULT(yes)
2284 ],
2285 [ AC_MSG_RESULT(no) ]
2286 )
2287fi
2288
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002289if test -z "$have_u_intxx_t" ; then
2290 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
2291 AC_TRY_COMPILE(
2292 [
2293#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002294 ],
2295 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002296 [ ac_cv_have_uintxx_t="yes" ],
2297 [ ac_cv_have_uintxx_t="no" ]
2298 )
2299 ])
2300 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002301 AC_DEFINE(HAVE_UINTXX_T, 1,
2302 [define if you have uintxx_t data type])
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002303 fi
2304fi
2305
2306if test -z "$have_uintxx_t" ; then
2307 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
2308 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002309 [ #include <stdint.h> ],
2310 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002311 [
2312 AC_DEFINE(HAVE_UINTXX_T)
2313 AC_MSG_RESULT(yes)
2314 ],
2315 [ AC_MSG_RESULT(no) ]
2316 )
2317fi
2318
Damien Milleredb82922000-06-20 13:25:52 +10002319if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11002320 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11002321then
2322 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2323 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10002324 [
2325#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002326 ],
Damien Millerb29ea912000-01-15 14:12:03 +11002327 [
Damien Miller70494d12000-04-03 15:57:06 +10002328 int8_t a; int16_t b; int32_t c;
2329 u_int8_t e; u_int16_t f; u_int32_t g;
2330 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11002331 ],
Damien Millerb29ea912000-01-15 14:12:03 +11002332 [
2333 AC_DEFINE(HAVE_U_INTXX_T)
2334 AC_DEFINE(HAVE_INTXX_T)
2335 AC_MSG_RESULT(yes)
2336 ],
2337 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11002338 )
Damien Millerb29ea912000-01-15 14:12:03 +11002339fi
2340
Damien Miller58be7382001-09-15 21:31:54 +10002341
2342AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
2343 AC_TRY_COMPILE(
2344 [
2345#include <sys/types.h>
2346 ],
2347 [ u_char foo; foo = 125; ],
2348 [ ac_cv_have_u_char="yes" ],
2349 [ ac_cv_have_u_char="no" ]
2350 )
2351])
2352if test "x$ac_cv_have_u_char" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002353 AC_DEFINE(HAVE_U_CHAR, 1, [define if you have u_char data type])
Damien Miller58be7382001-09-15 21:31:54 +10002354fi
2355
Tim Rice13aae5e2001-10-21 17:53:58 -07002356TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11002357
Tim Rice200a5c02002-02-26 22:12:34 -08002358AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08002359
Damien Miller848b9932005-02-24 12:12:34 +11002360AC_CHECK_TYPES(in_addr_t,,,
2361[#include <sys/types.h>
2362#include <netinet/in.h>])
Darren Tuckerd9f88912005-02-20 21:01:48 +11002363
Damien Miller61e50f12000-05-08 20:49:37 +10002364AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
2365 AC_TRY_COMPILE(
2366 [
2367#include <sys/types.h>
2368 ],
2369 [ size_t foo; foo = 1235; ],
2370 [ ac_cv_have_size_t="yes" ],
2371 [ ac_cv_have_size_t="no" ]
2372 )
2373])
2374if test "x$ac_cv_have_size_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002375 AC_DEFINE(HAVE_SIZE_T, 1, [define if you have size_t data type])
Damien Miller61e50f12000-05-08 20:49:37 +10002376fi
Damien Miller95058511999-12-29 10:36:45 +11002377
Damien Miller615f9392000-05-17 22:53:33 +10002378AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
2379 AC_TRY_COMPILE(
2380 [
2381#include <sys/types.h>
2382 ],
2383 [ ssize_t foo; foo = 1235; ],
2384 [ ac_cv_have_ssize_t="yes" ],
2385 [ ac_cv_have_ssize_t="no" ]
2386 )
2387])
2388if test "x$ac_cv_have_ssize_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002389 AC_DEFINE(HAVE_SSIZE_T, 1, [define if you have ssize_t data type])
Damien Miller615f9392000-05-17 22:53:33 +10002390fi
2391
Ben Lindstrom0d5af602001-01-09 00:50:29 +00002392AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
2393 AC_TRY_COMPILE(
2394 [
2395#include <time.h>
2396 ],
2397 [ clock_t foo; foo = 1235; ],
2398 [ ac_cv_have_clock_t="yes" ],
2399 [ ac_cv_have_clock_t="no" ]
2400 )
2401])
2402if test "x$ac_cv_have_clock_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002403 AC_DEFINE(HAVE_CLOCK_T, 1, [define if you have clock_t data type])
Ben Lindstrom0d5af602001-01-09 00:50:29 +00002404fi
2405
Damien Millerb54b40e2000-06-23 08:23:34 +10002406AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
2407 AC_TRY_COMPILE(
2408 [
2409#include <sys/types.h>
2410#include <sys/socket.h>
2411 ],
2412 [ sa_family_t foo; foo = 1235; ],
2413 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11002414 [ AC_TRY_COMPILE(
2415 [
2416#include <sys/types.h>
2417#include <sys/socket.h>
2418#include <netinet/in.h>
2419 ],
2420 [ sa_family_t foo; foo = 1235; ],
2421 [ ac_cv_have_sa_family_t="yes" ],
2422
Damien Millerb54b40e2000-06-23 08:23:34 +10002423 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11002424 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10002425 )
2426])
2427if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002428 AC_DEFINE(HAVE_SA_FAMILY_T, 1,
2429 [define if you have sa_family_t data type])
Damien Millerb54b40e2000-06-23 08:23:34 +10002430fi
2431
Damien Miller0f91b4e2000-06-18 15:43:25 +10002432AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
2433 AC_TRY_COMPILE(
2434 [
2435#include <sys/types.h>
2436 ],
2437 [ pid_t foo; foo = 1235; ],
2438 [ ac_cv_have_pid_t="yes" ],
2439 [ ac_cv_have_pid_t="no" ]
2440 )
2441])
2442if test "x$ac_cv_have_pid_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002443 AC_DEFINE(HAVE_PID_T, 1, [define if you have pid_t data type])
Damien Miller0f91b4e2000-06-18 15:43:25 +10002444fi
2445
2446AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
2447 AC_TRY_COMPILE(
2448 [
2449#include <sys/types.h>
2450 ],
2451 [ mode_t foo; foo = 1235; ],
2452 [ ac_cv_have_mode_t="yes" ],
2453 [ ac_cv_have_mode_t="no" ]
2454 )
2455])
2456if test "x$ac_cv_have_mode_t" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002457 AC_DEFINE(HAVE_MODE_T, 1, [define if you have mode_t data type])
Damien Miller0f91b4e2000-06-18 15:43:25 +10002458fi
2459
Damien Miller61e50f12000-05-08 20:49:37 +10002460
2461AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
2462 AC_TRY_COMPILE(
2463 [
Damien Miller81171112000-04-23 11:14:01 +10002464#include <sys/types.h>
2465#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002466 ],
2467 [ struct sockaddr_storage s; ],
2468 [ ac_cv_have_struct_sockaddr_storage="yes" ],
2469 [ ac_cv_have_struct_sockaddr_storage="no" ]
2470 )
2471])
2472if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002473 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
2474 [define if you have struct sockaddr_storage data type])
Damien Miller61e50f12000-05-08 20:49:37 +10002475fi
Damien Miller34132e52000-01-14 15:45:46 +11002476
Damien Miller61e50f12000-05-08 20:49:37 +10002477AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
2478 AC_TRY_COMPILE(
2479 [
Damien Miller7b22d652000-06-18 14:07:04 +10002480#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002481#include <netinet/in.h>
2482 ],
2483 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
2484 [ ac_cv_have_struct_sockaddr_in6="yes" ],
2485 [ ac_cv_have_struct_sockaddr_in6="no" ]
2486 )
2487])
2488if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002489 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1,
2490 [define if you have struct sockaddr_in6 data type])
Damien Miller61e50f12000-05-08 20:49:37 +10002491fi
Damien Miller34132e52000-01-14 15:45:46 +11002492
Damien Miller61e50f12000-05-08 20:49:37 +10002493AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
2494 AC_TRY_COMPILE(
2495 [
Damien Miller7b22d652000-06-18 14:07:04 +10002496#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002497#include <netinet/in.h>
2498 ],
2499 [ struct in6_addr s; s.s6_addr[0] = 0; ],
2500 [ ac_cv_have_struct_in6_addr="yes" ],
2501 [ ac_cv_have_struct_in6_addr="no" ]
2502 )
2503])
2504if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002505 AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1,
2506 [define if you have struct in6_addr data type])
Damien Miller61e50f12000-05-08 20:49:37 +10002507fi
Damien Miller34132e52000-01-14 15:45:46 +11002508
Damien Miller61e50f12000-05-08 20:49:37 +10002509AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
2510 AC_TRY_COMPILE(
2511 [
Damien Miller81171112000-04-23 11:14:01 +10002512#include <sys/types.h>
2513#include <sys/socket.h>
2514#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002515 ],
2516 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
2517 [ ac_cv_have_struct_addrinfo="yes" ],
2518 [ ac_cv_have_struct_addrinfo="no" ]
2519 )
2520])
2521if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002522 AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1,
2523 [define if you have struct addrinfo data type])
Damien Miller61e50f12000-05-08 20:49:37 +10002524fi
2525
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002526AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
2527 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11002528 [ #include <sys/time.h> ],
2529 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002530 [ ac_cv_have_struct_timeval="yes" ],
2531 [ ac_cv_have_struct_timeval="no" ]
2532 )
2533])
2534if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002535 AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [define if you have struct timeval])
Ben Lindstrom42202bc2001-01-15 02:34:37 +00002536 have_struct_timeval=1
2537fi
2538
Tim Rice4e4dc562003-03-18 10:21:40 -08002539AC_CHECK_TYPES(struct timespec)
2540
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002541# We need int64_t or else certian parts of the compile will fail.
Tim Rice8bb561b2005-03-17 16:23:19 -08002542if test "x$ac_cv_have_int64_t" = "xno" && \
2543 test "x$ac_cv_sizeof_long_int" != "x8" && \
2544 test "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00002545 echo "OpenSSH requires int64_t support. Contact your vendor or install"
2546 echo "an alternative compiler (I.E., GCC) before continuing."
2547 echo ""
2548 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08002549else
2550dnl test snprintf (broken on SCO w/gcc)
Darren Tuckera0c2b392004-09-11 23:26:37 +10002551 AC_RUN_IFELSE(
Darren Tucker623d92f2004-09-12 22:36:15 +10002552 [AC_LANG_SOURCE([[
Tim Ricebee3f222001-03-11 17:32:12 -08002553#include <stdio.h>
2554#include <string.h>
2555#ifdef HAVE_SNPRINTF
2556main()
2557{
2558 char buf[50];
2559 char expected_out[50];
2560 int mazsize = 50 ;
2561#if (SIZEOF_LONG_INT == 8)
2562 long int num = 0x7fffffffffffffff;
2563#else
Kevin Steves6482ec82001-07-15 02:09:28 +00002564 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08002565#endif
2566 strcpy(expected_out, "9223372036854775807");
2567 snprintf(buf, mazsize, "%lld", num);
2568 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11002569 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08002570 exit(0);
2571}
2572#else
2573main() { exit(0); }
2574#endif
Darren Tucker623d92f2004-09-12 22:36:15 +10002575 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
Darren Tuckera0c2b392004-09-11 23:26:37 +10002576 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
Tim Ricebee3f222001-03-11 17:32:12 -08002577 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002578fi
2579
Damien Miller78315eb2000-09-29 23:01:36 +11002580dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10002581OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
2582OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
2583OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
2584OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
2585OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10002586OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002587OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
2588OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10002589OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10002590OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
2591OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
2592OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
2593OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00002594OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
2595OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
2596OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
2597OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07002598
2599AC_CHECK_MEMBERS([struct stat.st_blksize])
Darren Tucker58e298d2005-11-25 13:14:58 +11002600AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE(__res_state, state,
2601 [Define if we don't have struct __res_state in resolv.h])],
2602[
2603#include <stdio.h>
2604#if HAVE_SYS_TYPES_H
2605# include <sys/types.h>
2606#endif
2607#include <netinet/in.h>
2608#include <arpa/nameser.h>
2609#include <resolv.h>
2610])
andre2ff7b5d2000-06-03 14:57:40 +00002611
Damien Miller61e50f12000-05-08 20:49:37 +10002612AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
2613 ac_cv_have_ss_family_in_struct_ss, [
2614 AC_TRY_COMPILE(
2615 [
Damien Miller81171112000-04-23 11:14:01 +10002616#include <sys/types.h>
2617#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002618 ],
2619 [ struct sockaddr_storage s; s.ss_family = 1; ],
2620 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
2621 [ ac_cv_have_ss_family_in_struct_ss="no" ],
2622 )
2623])
2624if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002625 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Fields in struct sockaddr_storage])
Damien Miller61e50f12000-05-08 20:49:37 +10002626fi
2627
Damien Miller61e50f12000-05-08 20:49:37 +10002628AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
2629 ac_cv_have___ss_family_in_struct_ss, [
2630 AC_TRY_COMPILE(
2631 [
Damien Miller81171112000-04-23 11:14:01 +10002632#include <sys/types.h>
2633#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10002634 ],
2635 [ struct sockaddr_storage s; s.__ss_family = 1; ],
2636 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
2637 [ ac_cv_have___ss_family_in_struct_ss="no" ]
2638 )
2639])
2640if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002641 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1,
2642 [Fields in struct sockaddr_storage])
Damien Miller61e50f12000-05-08 20:49:37 +10002643fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11002644
Damien Millerad833b32000-08-23 10:46:23 +10002645AC_CACHE_CHECK([for pw_class field in struct passwd],
2646 ac_cv_have_pw_class_in_struct_passwd, [
2647 AC_TRY_COMPILE(
2648 [
Damien Millerad833b32000-08-23 10:46:23 +10002649#include <pwd.h>
2650 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00002651 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10002652 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
2653 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
2654 )
2655])
2656if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002657 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD, 1,
2658 [Define if your password has a pw_class field])
Damien Millerad833b32000-08-23 10:46:23 +10002659fi
2660
Kevin Steves82456952001-06-22 21:14:18 +00002661AC_CACHE_CHECK([for pw_expire field in struct passwd],
2662 ac_cv_have_pw_expire_in_struct_passwd, [
2663 AC_TRY_COMPILE(
2664 [
2665#include <pwd.h>
2666 ],
2667 [ struct passwd p; p.pw_expire = 0; ],
2668 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
2669 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
2670 )
2671])
2672if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002673 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD, 1,
2674 [Define if your password has a pw_expire field])
Kevin Steves82456952001-06-22 21:14:18 +00002675fi
2676
2677AC_CACHE_CHECK([for pw_change field in struct passwd],
2678 ac_cv_have_pw_change_in_struct_passwd, [
2679 AC_TRY_COMPILE(
2680 [
2681#include <pwd.h>
2682 ],
2683 [ struct passwd p; p.pw_change = 0; ],
2684 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
2685 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
2686 )
2687])
2688if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002689 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD, 1,
2690 [Define if your password has a pw_change field])
Kevin Steves82456952001-06-22 21:14:18 +00002691fi
Damien Miller61e50f12000-05-08 20:49:37 +10002692
Tim Rice28bbb0c2002-05-27 17:37:32 -07002693dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00002694AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2695 ac_cv_have_accrights_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002696 AC_COMPILE_IFELSE(
Kevin Steves939c9db2002-03-22 17:23:25 +00002697 [
Tim Riceae49fe62002-04-12 10:26:21 -07002698#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00002699#include <sys/socket.h>
2700#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002701int main() {
2702#ifdef msg_accrights
Darren Tuckera0c2b392004-09-11 23:26:37 +10002703#error "msg_accrights is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002704exit(1);
2705#endif
2706struct msghdr m;
2707m.msg_accrights = 0;
2708exit(0);
2709}
Kevin Steves939c9db2002-03-22 17:23:25 +00002710 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00002711 [ ac_cv_have_accrights_in_msghdr="yes" ],
2712 [ ac_cv_have_accrights_in_msghdr="no" ]
2713 )
2714])
2715if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002716 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR, 1,
2717 [Define if your system uses access rights style
2718 file descriptor passing])
Kevin Steves939c9db2002-03-22 17:23:25 +00002719fi
2720
Kevin Stevesa44e0352002-04-07 16:18:03 +00002721AC_CACHE_CHECK([for msg_control field in struct msghdr],
2722 ac_cv_have_control_in_msghdr, [
Darren Tuckera0c2b392004-09-11 23:26:37 +10002723 AC_COMPILE_IFELSE(
Kevin Stevesa44e0352002-04-07 16:18:03 +00002724 [
Tim Riceae49fe62002-04-12 10:26:21 -07002725#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00002726#include <sys/socket.h>
2727#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07002728int main() {
2729#ifdef msg_control
Darren Tuckera0c2b392004-09-11 23:26:37 +10002730#error "msg_control is a macro"
Tim Rice28bbb0c2002-05-27 17:37:32 -07002731exit(1);
2732#endif
2733struct msghdr m;
2734m.msg_control = 0;
2735exit(0);
2736}
Kevin Stevesa44e0352002-04-07 16:18:03 +00002737 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00002738 [ ac_cv_have_control_in_msghdr="yes" ],
2739 [ ac_cv_have_control_in_msghdr="no" ]
2740 )
2741])
2742if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002743 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR, 1,
2744 [Define if your system uses ancillary data style
2745 file descriptor passing])
Kevin Stevesa44e0352002-04-07 16:18:03 +00002746fi
2747
Damien Miller61e50f12000-05-08 20:49:37 +10002748AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002749 AC_TRY_LINK([],
2750 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10002751 [ ac_cv_libc_defines___progname="yes" ],
2752 [ ac_cv_libc_defines___progname="no" ]
2753 )
2754])
2755if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002756 AC_DEFINE(HAVE___PROGNAME, 1, [Define if libc defines __progname])
Damien Miller61e50f12000-05-08 20:49:37 +10002757fi
2758
Kevin Steves4846f4a2002-03-22 18:19:53 +00002759AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2760 AC_TRY_LINK([
2761#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002762],
2763 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002764 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2765 [ ac_cv_cc_implements___FUNCTION__="no" ]
2766 )
2767])
2768if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002769 AC_DEFINE(HAVE___FUNCTION__, 1,
2770 [Define if compiler implements __FUNCTION__])
Kevin Steves4846f4a2002-03-22 18:19:53 +00002771fi
2772
2773AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2774 AC_TRY_LINK([
2775#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11002776],
2777 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00002778 [ ac_cv_cc_implements___func__="yes" ],
2779 [ ac_cv_cc_implements___func__="no" ]
2780 )
2781])
2782if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002783 AC_DEFINE(HAVE___func__, 1, [Define if compiler implements __func__])
Kevin Steves4846f4a2002-03-22 18:19:53 +00002784fi
2785
Damien Miller57f39152005-11-24 19:58:19 +11002786AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
2787 AC_TRY_LINK(
2788 [#include <stdarg.h>
2789 va_list x,y;],
2790 [va_copy(x,y);],
2791 [ ac_cv_have_va_copy="yes" ],
2792 [ ac_cv_have_va_copy="no" ]
2793 )
2794])
2795if test "x$ac_cv_have_va_copy" = "xyes" ; then
2796 AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy exists])
2797fi
2798
2799AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
2800 AC_TRY_LINK(
2801 [#include <stdarg.h>
2802 va_list x,y;],
2803 [__va_copy(x,y);],
2804 [ ac_cv_have___va_copy="yes" ],
2805 [ ac_cv_have___va_copy="no" ]
2806 )
2807])
2808if test "x$ac_cv_have___va_copy" = "xyes" ; then
2809 AC_DEFINE(HAVE___VA_COPY, 1, [Define if __va_copy exists])
2810fi
2811
Damien Miller4f8e6692001-07-14 13:22:53 +10002812AC_CACHE_CHECK([whether getopt has optreset support],
2813 ac_cv_have_getopt_optreset, [
2814 AC_TRY_LINK(
2815 [
2816#include <getopt.h>
2817 ],
2818 [ extern int optreset; optreset = 0; ],
2819 [ ac_cv_have_getopt_optreset="yes" ],
2820 [ ac_cv_have_getopt_optreset="no" ]
2821 )
2822])
2823if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002824 AC_DEFINE(HAVE_GETOPT_OPTRESET, 1,
2825 [Define if your getopt(3) defines and uses optreset])
Damien Miller4f8e6692001-07-14 13:22:53 +10002826fi
Damien Millera22ba012000-03-02 23:09:20 +11002827
Damien Millerecbb26d2000-07-15 14:59:14 +10002828AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002829 AC_TRY_LINK([],
2830 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002831 [ ac_cv_libc_defines_sys_errlist="yes" ],
2832 [ ac_cv_libc_defines_sys_errlist="no" ]
2833 )
2834])
2835if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002836 AC_DEFINE(HAVE_SYS_ERRLIST, 1,
2837 [Define if your system defines sys_errlist[]])
Damien Millerecbb26d2000-07-15 14:59:14 +10002838fi
2839
2840
Damien Miller11fa2cc2000-08-16 10:35:58 +10002841AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002842 AC_TRY_LINK([],
2843 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002844 [ ac_cv_libc_defines_sys_nerr="yes" ],
2845 [ ac_cv_libc_defines_sys_nerr="no" ]
2846 )
2847])
2848if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07002849 AC_DEFINE(HAVE_SYS_NERR, 1, [Define if your system defines sys_nerr])
Damien Miller11fa2cc2000-08-16 10:35:58 +10002850fi
2851
Damien Millera8e06ce2003-11-21 23:48:55 +11002852SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002853# Check whether user wants sectok support
2854AC_ARG_WITH(sectok,
2855 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002856 [
2857 if test "x$withval" != "xno" ; then
2858 if test "x$withval" != "xyes" ; then
2859 CPPFLAGS="$CPPFLAGS -I${withval}"
2860 LDFLAGS="$LDFLAGS -L${withval}"
2861 if test ! -z "$need_dash_r" ; then
2862 LDFLAGS="$LDFLAGS -R${withval}"
2863 fi
2864 if test ! -z "$blibpath" ; then
2865 blibpath="$blibpath:${withval}"
2866 fi
2867 fi
2868 AC_CHECK_HEADERS(sectok.h)
2869 if test "$ac_cv_header_sectok_h" != yes; then
2870 AC_MSG_ERROR(Can't find sectok.h)
2871 fi
2872 AC_CHECK_LIB(sectok, sectok_open)
2873 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2874 AC_MSG_ERROR(Can't find libsectok)
2875 fi
Tim Rice7df8d392005-09-19 09:33:39 -07002876 AC_DEFINE(SMARTCARD, 1,
2877 [Define if you want smartcard support])
2878 AC_DEFINE(USE_SECTOK, 1,
2879 [Define if you want smartcard support
2880 using sectok])
Damien Millera8e06ce2003-11-21 23:48:55 +11002881 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002882 fi
2883 ]
2884)
2885
2886# Check whether user wants OpenSC support
Tim Rice12ee8e22005-03-17 13:37:04 -08002887OPENSC_CONFIG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002888AC_ARG_WITH(opensc,
Darren Tucker82171c62005-09-22 20:19:54 +10002889 [ --with-opensc[[=PFX]] Enable smartcard support using OpenSC (optionally in PATH)],
Tim Rice12ee8e22005-03-17 13:37:04 -08002890 [
2891 if test "x$withval" != "xno" ; then
2892 if test "x$withval" != "xyes" ; then
2893 OPENSC_CONFIG=$withval/bin/opensc-config
2894 else
2895 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2896 fi
2897 if test "$OPENSC_CONFIG" != "no"; then
2898 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2899 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2900 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2901 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2902 AC_DEFINE(SMARTCARD)
Tim Rice7df8d392005-09-19 09:33:39 -07002903 AC_DEFINE(USE_OPENSC, 1,
2904 [Define if you want smartcard support
2905 using OpenSC])
Tim Rice12ee8e22005-03-17 13:37:04 -08002906 SCARD_MSG="yes, using OpenSC"
2907 fi
2908 fi
2909 ]
2910)
Damien Miller85de5802001-09-18 14:01:11 +10002911
Darren Tucker5f88d342003-10-15 16:57:57 +10002912# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002913AC_SEARCH_LIBS(getrrsetbyname, resolv,
Tim Rice7df8d392005-09-19 09:33:39 -07002914 [AC_DEFINE(HAVE_GETRRSETBYNAME, 1,
2915 [Define if getrrsetbyname() exists])],
Damien Miller7abe09b2003-05-15 10:53:49 +10002916 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002917 # Needed by our getrrsetbyname()
2918 AC_SEARCH_LIBS(res_query, resolv)
2919 AC_SEARCH_LIBS(dn_expand, resolv)
Darren Tucker8e968a52004-05-13 11:56:16 +10002920 AC_MSG_CHECKING(if res_query will link)
2921 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2922 [AC_MSG_RESULT(no)
2923 saved_LIBS="$LIBS"
2924 LIBS="$LIBS -lresolv"
2925 AC_MSG_CHECKING(for res_query in -lresolv)
2926 AC_LINK_IFELSE([
2927#include <resolv.h>
2928int main()
2929{
2930 res_query (0, 0, 0, 0, 0);
2931 return 0;
2932}
2933 ],
2934 [LIBS="$LIBS -lresolv"
2935 AC_MSG_RESULT(yes)],
2936 [LIBS="$saved_LIBS"
2937 AC_MSG_RESULT(no)])
2938 ])
Darren Tucker5f88d342003-10-15 16:57:57 +10002939 AC_CHECK_FUNCS(_getshort _getlong)
Darren Tuckerd886e1c2005-06-01 18:57:45 +10002940 AC_CHECK_DECLS([_getshort, _getlong], , ,
Tim Ricefcc7ff12005-06-02 20:28:29 -07002941 [#include <sys/types.h>
2942 #include <arpa/nameser.h>])
Darren Tucker5f88d342003-10-15 16:57:57 +10002943 AC_CHECK_MEMBER(HEADER.ad,
Tim Rice7df8d392005-09-19 09:33:39 -07002944 [AC_DEFINE(HAVE_HEADER_AD, 1,
2945 [Define if HEADER.ad exists in arpa/nameser.h])],,
Darren Tucker5f88d342003-10-15 16:57:57 +10002946 [#include <arpa/nameser.h>])
2947 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002948
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002949# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002950KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002951AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002952 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002953 [ if test "x$withval" != "xno" ; then
2954 if test "x$withval" = "xyes" ; then
2955 KRB5ROOT="/usr/local"
2956 else
2957 KRB5ROOT=${withval}
2958 fi
2959
Tim Rice7df8d392005-09-19 09:33:39 -07002960 AC_DEFINE(KRB5, 1, [Define if you want Kerberos 5 support])
Darren Tucker1d3ca582004-01-22 12:05:34 +11002961 KRB5_MSG="yes"
2962
2963 AC_MSG_CHECKING(for krb5-config)
2964 if test -x $KRB5ROOT/bin/krb5-config ; then
2965 KRB5CONF=$KRB5ROOT/bin/krb5-config
2966 AC_MSG_RESULT($KRB5CONF)
2967
2968 AC_MSG_CHECKING(for gssapi support)
2969 if $KRB5CONF | grep gssapi >/dev/null ; then
2970 AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -07002971 AC_DEFINE(GSSAPI, 1,
2972 [Define this if you want GSSAPI
2973 support in the version 2 protocol])
Darren Tucker0d27ed12004-02-24 10:37:33 +11002974 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002975 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002976 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002977 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002978 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002979 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2980 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002981 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002982 AC_MSG_CHECKING(whether we are using Heimdal)
2983 AC_TRY_COMPILE([ #include <krb5.h> ],
2984 [ char *tmp = heimdal_version; ],
2985 [ AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -07002986 AC_DEFINE(HEIMDAL, 1,
2987 [Define this if you are using the
2988 Heimdal version of Kerberos V5]) ],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002989 AC_MSG_RESULT(no)
2990 )
2991 else
2992 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002993 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002994 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002995 AC_MSG_CHECKING(whether we are using Heimdal)
2996 AC_TRY_COMPILE([ #include <krb5.h> ],
2997 [ char *tmp = heimdal_version; ],
2998 [ AC_MSG_RESULT(yes)
2999 AC_DEFINE(HEIMDAL)
Damien Miller5561e0b2004-04-20 20:28:55 +10003000 K5LIBS="-lkrb5 -ldes"
3001 K5LIBS="$K5LIBS -lcom_err -lasn1"
Tim Riceeae17cc2005-03-17 16:52:20 -08003002 AC_CHECK_LIB(roken, net_write,
Damien Miller5561e0b2004-04-20 20:28:55 +10003003 [K5LIBS="$K5LIBS -lroken"])
Damien Millera8e06ce2003-11-21 23:48:55 +11003004 ],
3005 [ AC_MSG_RESULT(no)
3006 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
3007 ]
3008 )
Damien Miller200d0a72003-06-30 19:21:36 +10003009 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10003010
Darren Tucker49aaf4a2003-08-26 11:58:16 +10003011 AC_CHECK_LIB(gssapi,gss_init_sec_context,
3012 [ AC_DEFINE(GSSAPI)
3013 K5LIBS="-lgssapi $K5LIBS" ],
3014 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
3015 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11003016 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10003017 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
3018 $K5LIBS)
3019 ],
3020 $K5LIBS)
Tim Riceeae17cc2005-03-17 16:52:20 -08003021
Darren Tucker49aaf4a2003-08-26 11:58:16 +10003022 AC_CHECK_HEADER(gssapi.h, ,
3023 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11003024 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10003025 AC_CHECK_HEADERS(gssapi.h, ,
3026 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11003027 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10003028 ]
3029 )
3030
3031 oldCPP="$CPPFLAGS"
3032 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
3033 AC_CHECK_HEADER(gssapi_krb5.h, ,
3034 [ CPPFLAGS="$oldCPP" ])
3035
Damien Millera8e06ce2003-11-21 23:48:55 +11003036 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11003037 if test ! -z "$need_dash_r" ; then
3038 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
3039 fi
3040 if test ! -z "$blibpath" ; then
3041 blibpath="$blibpath:${KRB5ROOT}/lib"
3042 fi
Tim Ricefd9e9e32005-09-12 17:36:10 -07003043
3044 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
3045 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
3046 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
3047
3048 LIBS="$LIBS $K5LIBS"
Tim Rice7df8d392005-09-19 09:33:39 -07003049 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS, 1,
3050 [Define this if you want to use libkafs' AFS support]))
Darren Tucker0d27ed12004-02-24 10:37:33 +11003051 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11003052 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10003053)
Damien Millerc79bc0d2001-03-28 13:03:42 +10003054
Damien Millera22ba012000-03-02 23:09:20 +11003055# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11003056
Damien Millerf58c6722002-05-13 13:15:42 +10003057PRIVSEP_PATH=/var/empty
3058AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07003059 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10003060 [
Tim Rice35cc69d2005-03-17 16:44:25 -08003061 if test -n "$withval" && test "x$withval" != "xno" && \
3062 test "x${withval}" != "xyes"; then
Damien Millerf58c6722002-05-13 13:15:42 +10003063 PRIVSEP_PATH=$withval
3064 fi
3065 ]
3066)
3067AC_SUBST(PRIVSEP_PATH)
3068
Damien Millera22ba012000-03-02 23:09:20 +11003069AC_ARG_WITH(xauth,
3070 [ --with-xauth=PATH Specify path to xauth program ],
3071 [
Tim Rice35cc69d2005-03-17 16:44:25 -08003072 if test -n "$withval" && test "x$withval" != "xno" && \
3073 test "x${withval}" != "xyes"; then
Damien Miller7b22d652000-06-18 14:07:04 +10003074 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11003075 fi
3076 ],
3077 [
Tim Ricee22be3b2002-07-17 19:20:07 -07003078 TestPath="$PATH"
3079 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
3080 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
3081 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
3082 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
3083 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10003084 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11003085 xauth_path="/usr/openwin/bin/xauth"
3086 fi
3087 ]
3088)
3089
Damien Miller7d901272003-01-13 16:55:22 +11003090STRIP_OPT=-s
3091AC_ARG_ENABLE(strip,
3092 [ --disable-strip Disable calling strip(1) on install],
3093 [
3094 if test "x$enableval" = "xno" ; then
3095 STRIP_OPT=
3096 fi
3097 ]
3098)
3099AC_SUBST(STRIP_OPT)
3100
Damien Millera19cf472000-11-29 13:28:50 +11003101if test -z "$xauth_path" ; then
3102 XAUTH_PATH="undefined"
3103 AC_SUBST(XAUTH_PATH)
3104else
Tim Rice7df8d392005-09-19 09:33:39 -07003105 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path",
3106 [Define if xauth is found in your path])
Damien Millera19cf472000-11-29 13:28:50 +11003107 XAUTH_PATH=$xauth_path
3108 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11003109fi
Damien Millera22ba012000-03-02 23:09:20 +11003110
3111# Check for mail directory (last resort if we cannot get it from headers)
3112if test ! -z "$MAIL" ; then
3113 maildir=`dirname $MAIL`
Tim Rice7df8d392005-09-19 09:33:39 -07003114 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir",
3115 [Set this to your mail directory if you don't have maillock.h])
Damien Millera22ba012000-03-02 23:09:20 +11003116fi
3117
Darren Tucker623d92f2004-09-12 22:36:15 +10003118if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10003119 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
3120 disable_ptmx_check=yes
3121fi
Damien Millera22ba012000-03-02 23:09:20 +11003122if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00003123 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11003124 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00003125 [
Tim Rice7df8d392005-09-19 09:33:39 -07003126 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1,
3127 [Define if you have /dev/ptmx])
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00003128 have_dev_ptmx=1
3129 ]
3130 )
3131 fi
Damien Millera22ba012000-03-02 23:09:20 +11003132fi
Darren Tuckera0c2b392004-09-11 23:26:37 +10003133
Darren Tucker623d92f2004-09-12 22:36:15 +10003134if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
Darren Tuckera0c2b392004-09-11 23:26:37 +10003135 AC_CHECK_FILE("/dev/ptc",
3136 [
Tim Rice7df8d392005-09-19 09:33:39 -07003137 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1,
3138 [Define if you have /dev/ptc])
Darren Tuckera0c2b392004-09-11 23:26:37 +10003139 have_dev_ptc=1
3140 ]
3141 )
3142else
3143 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
3144fi
Damien Miller204ad072000-03-02 23:56:12 +11003145
Damien Millera22ba012000-03-02 23:09:20 +11003146# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00003147AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10003148 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11003149 [
Damien Miller897741e2001-04-16 10:41:46 +10003150 case "$withval" in
3151 man|cat|doc)
3152 MANTYPE=$withval
3153 ;;
3154 *)
3155 AC_MSG_ERROR(invalid man type: $withval)
3156 ;;
3157 esac
Damien Miller670a4b82000-01-22 13:53:11 +11003158 ]
3159)
Ben Lindstrombc709922001-04-18 18:04:21 +00003160if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07003161 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
3162 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00003163 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
3164 MANTYPE=doc
3165 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
3166 MANTYPE=man
3167 else
3168 MANTYPE=cat
3169 fi
3170fi
Damien Miller670a4b82000-01-22 13:53:11 +11003171AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00003172if test "$MANTYPE" = "doc"; then
3173 mansubdir=man;
3174else
3175 mansubdir=$MANTYPE;
3176fi
3177AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11003178
Damien Millera22ba012000-03-02 23:09:20 +11003179# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11003180MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11003181AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11003182 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11003183 [
Damien Millerb85dcad2000-03-11 11:37:00 +11003184 if test "x$withval" != "xno" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07003185 AC_DEFINE(HAVE_MD5_PASSWORDS, 1,
3186 [Define if you want to allow MD5 passwords])
Damien Millera8e06ce2003-11-21 23:48:55 +11003187 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11003188 fi
3189 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11003190)
3191
Damien Millera22ba012000-03-02 23:09:20 +11003192# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11003193AC_ARG_WITH(shadow,
3194 [ --without-shadow Disable shadow password support],
3195 [
Tim Riceeae17cc2005-03-17 16:52:20 -08003196 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11003197 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10003198 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11003199 fi
3200 ]
3201)
3202
Damien Miller1f335fb2000-06-26 11:31:33 +10003203if test -z "$disable_shadow" ; then
3204 AC_MSG_CHECKING([if the systems has expire shadow information])
3205 AC_TRY_COMPILE(
3206 [
3207#include <sys/types.h>
3208#include <shadow.h>
3209 struct spwd sp;
3210 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
3211 [ sp_expire_available=yes ], []
3212 )
3213
3214 if test "x$sp_expire_available" = "xyes" ; then
3215 AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -07003216 AC_DEFINE(HAS_SHADOW_EXPIRE, 1,
3217 [Define if you want to use shadow password expire field])
Damien Miller1f335fb2000-06-26 11:31:33 +10003218 else
3219 AC_MSG_RESULT(no)
3220 fi
3221fi
3222
Damien Millera22ba012000-03-02 23:09:20 +11003223# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11003224if test ! -z "$IPADDR_IN_DISPLAY" ; then
3225 DISPLAY_HACK_MSG="yes"
Tim Rice7df8d392005-09-19 09:33:39 -07003226 AC_DEFINE(IPADDR_IN_DISPLAY, 1,
3227 [Define if you need to use IP address
3228 instead of hostname in $DISPLAY])
Damien Miller9a947342000-08-30 10:03:33 +11003229else
Damien Millera8e06ce2003-11-21 23:48:55 +11003230 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11003231 AC_ARG_WITH(ipaddr-display,
3232 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
3233 [
Tim Riceeae17cc2005-03-17 16:52:20 -08003234 if test "x$withval" != "xno" ; then
Damien Miller9a947342000-08-30 10:03:33 +11003235 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11003236 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11003237 fi
3238 ]
3239 )
3240fi
Damien Miller76112de1999-12-21 11:18:08 +11003241
Darren Tuckere1a790d2003-09-16 11:52:19 +10003242# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07003243AC_ARG_ENABLE(etc-default-login,
Darren Tucker1b6f2292005-02-11 16:11:49 +11003244 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
Darren Tucker2f9573d2005-02-10 22:28:54 +11003245 [ if test "x$enableval" = "xno"; then
3246 AC_MSG_NOTICE([/etc/default/login handling disabled])
3247 etc_default_login=no
3248 else
3249 etc_default_login=yes
3250 fi ],
Darren Tucker314d89e2005-10-17 23:29:23 +10003251 [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
3252 then
3253 AC_MSG_WARN([cross compiling: not checking /etc/default/login])
3254 etc_default_login=no
3255 else
3256 etc_default_login=yes
3257 fi ]
Darren Tucker2f9573d2005-02-10 22:28:54 +11003258)
Darren Tuckere1a790d2003-09-16 11:52:19 +10003259
Darren Tucker2f9573d2005-02-10 22:28:54 +11003260if test "x$etc_default_login" != "xno"; then
3261 AC_CHECK_FILE("/etc/default/login",
3262 [ external_path_file=/etc/default/login ])
Darren Tucker314d89e2005-10-17 23:29:23 +10003263 if test "x$external_path_file" = "x/etc/default/login"; then
Tim Rice7df8d392005-09-19 09:33:39 -07003264 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN, 1,
3265 [Define if your system has /etc/default/login])
Darren Tuckera0c2b392004-09-11 23:26:37 +10003266 fi
Darren Tucker2f9573d2005-02-10 22:28:54 +11003267fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10003268
Tim Rice43a1c132002-04-17 21:19:14 -07003269dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
Tim Rice8bb561b2005-03-17 16:23:19 -08003270if test $ac_cv_func_login_getcapbool = "yes" && \
3271 test $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003272 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07003273fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10003274
Damien Millera22ba012000-03-02 23:09:20 +11003275# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11003276SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11003277AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10003278 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11003279 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10003280 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07003281 AC_MSG_WARN([
3282--with-default-path=PATH has no effect on this system.
3283Edit /etc/login.conf instead.])
Tim Riceeae17cc2005-03-17 16:52:20 -08003284 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07003285 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003286 AC_MSG_WARN([
3287--with-default-path=PATH will only be used if PATH is not defined in
3288$external_path_file .])
3289 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08003290 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11003291 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11003292 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08003293 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10003294 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
3295 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07003296 else
Tim Riceb925b4b2003-09-15 22:40:49 -07003297 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003298 AC_MSG_WARN([
3299If PATH is defined in $external_path_file, ensure the path to scp is included,
3300otherwise scp will not work.])
3301 fi
Darren Tucker314d89e2005-10-17 23:29:23 +10003302 AC_RUN_IFELSE(
3303 [AC_LANG_SOURCE([[
Tim Rice59ea0a02001-03-10 13:50:45 -08003304/* find out what STDPATH is */
3305#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08003306#ifdef HAVE_PATHS_H
3307# include <paths.h>
3308#endif
3309#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08003310# ifdef _PATH_USERPATH /* Irix */
3311# define _PATH_STDPATH _PATH_USERPATH
3312# else
3313# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
3314# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08003315#endif
3316#include <sys/types.h>
3317#include <sys/stat.h>
3318#include <fcntl.h>
3319#define DATA "conftest.stdpath"
3320
3321main()
3322{
3323 FILE *fd;
3324 int rc;
Tim Riceeae17cc2005-03-17 16:52:20 -08003325
Tim Rice59ea0a02001-03-10 13:50:45 -08003326 fd = fopen(DATA,"w");
3327 if(fd == NULL)
3328 exit(1);
Tim Riceeae17cc2005-03-17 16:52:20 -08003329
Tim Rice59ea0a02001-03-10 13:50:45 -08003330 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
3331 exit(1);
3332
3333 exit(0);
3334}
Darren Tucker314d89e2005-10-17 23:29:23 +10003335 ]])],
3336 [ user_path=`cat conftest.stdpath` ],
Tim Rice59ea0a02001-03-10 13:50:45 -08003337 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
3338 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
3339 )
3340# make sure $bindir is in USER_PATH so scp will work
3341 t_bindir=`eval echo ${bindir}`
3342 case $t_bindir in
3343 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
3344 esac
3345 case $t_bindir in
3346 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
3347 esac
3348 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
3349 if test $? -ne 0 ; then
3350 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
3351 if test $? -ne 0 ; then
3352 user_path=$user_path:$t_bindir
3353 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
3354 fi
3355 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003356 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11003357)
Darren Tuckere1a790d2003-09-16 11:52:19 +10003358if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07003359 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path", [Specify default $PATH])
Tim Rice43a1c132002-04-17 21:19:14 -07003360 AC_SUBST(user_path)
3361fi
Damien Miller5a3e6831999-12-27 09:48:56 +11003362
Damien Millera18bbd32002-05-13 10:48:57 +10003363# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10003364AC_ARG_WITH(superuser-path,
3365 [ --with-superuser-path= Specify different path for super-user],
3366 [
Tim Rice35cc69d2005-03-17 16:44:25 -08003367 if test -n "$withval" && test "x$withval" != "xno" && \
3368 test "x${withval}" != "xyes"; then
Tim Rice7df8d392005-09-19 09:33:39 -07003369 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval",
3370 [Define if you want a different $PATH
3371 for the superuser])
Damien Millera18bbd32002-05-13 10:48:57 +10003372 superuser_path=$withval
3373 fi
3374 ]
3375)
3376
3377
Damien Miller61e50f12000-05-08 20:49:37 +10003378AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11003379IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11003380AC_ARG_WITH(4in6,
3381 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
3382 [
3383 if test "x$withval" != "xno" ; then
3384 AC_MSG_RESULT(yes)
Tim Rice7df8d392005-09-19 09:33:39 -07003385 AC_DEFINE(IPV4_IN_IPV6, 1,
3386 [Detect IPv4 in IPv6 mapped addresses
3387 and treat as IPv4])
Damien Millera8e06ce2003-11-21 23:48:55 +11003388 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11003389 else
3390 AC_MSG_RESULT(no)
3391 fi
3392 ],[
3393 if test "x$inet6_default_4in6" = "xyes"; then
3394 AC_MSG_RESULT([yes (default)])
3395 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11003396 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11003397 else
3398 AC_MSG_RESULT([no (default)])
3399 fi
3400 ]
3401)
3402
Damien Miller60396b02001-02-18 17:01:00 +11003403# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11003404BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11003405AC_ARG_WITH(bsd-auth,
3406 [ --with-bsd-auth Enable BSD auth support],
3407 [
Tim Riceeae17cc2005-03-17 16:52:20 -08003408 if test "x$withval" != "xno" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07003409 AC_DEFINE(BSD_AUTH, 1,
3410 [Define if you have BSD auth support])
Damien Miller6c21c512002-01-22 21:57:53 +11003411 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11003412 fi
3413 ]
3414)
3415
Damien Millera22ba012000-03-02 23:09:20 +11003416# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11003417piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11003418# make sure the directory exists
Tim Riceeae17cc2005-03-17 16:52:20 -08003419if test ! -d $piddir ; then
Damien Miller78315eb2000-09-29 23:01:36 +11003420 piddir=`eval echo ${sysconfdir}`
3421 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11003422 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11003423 esac
3424fi
3425
Tim Rice88f2ab52002-03-17 12:17:34 -08003426AC_ARG_WITH(pid-dir,
3427 [ --with-pid-dir=PATH Specify location of ssh.pid file],
3428 [
Tim Rice35cc69d2005-03-17 16:44:25 -08003429 if test -n "$withval" && test "x$withval" != "xno" && \
3430 test "x${withval}" != "xyes"; then
Tim Rice88f2ab52002-03-17 12:17:34 -08003431 piddir=$withval
Tim Riceeae17cc2005-03-17 16:52:20 -08003432 if test ! -d $piddir ; then
Tim Rice88f2ab52002-03-17 12:17:34 -08003433 AC_MSG_WARN([** no $piddir directory on this system **])
3434 fi
3435 fi
3436 ]
3437)
3438
Tim Rice7df8d392005-09-19 09:33:39 -07003439AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir", [Specify location of ssh.pid])
Damien Millerb13c73e2000-01-17 22:02:17 +11003440AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11003441
andre2ff7b5d2000-06-03 14:57:40 +00003442dnl allow user to disable some login recording features
3443AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00003444 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10003445 [
3446 if test "x$enableval" = "xno" ; then
3447 AC_DEFINE(DISABLE_LASTLOG)
3448 fi
3449 ]
andre2ff7b5d2000-06-03 14:57:40 +00003450)
3451AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00003452 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10003453 [
3454 if test "x$enableval" = "xno" ; then
3455 AC_DEFINE(DISABLE_UTMP)
3456 fi
3457 ]
andre2ff7b5d2000-06-03 14:57:40 +00003458)
3459AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00003460 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10003461 [
3462 if test "x$enableval" = "xno" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07003463 AC_DEFINE(DISABLE_UTMPX, 1,
3464 [Define if you don't want to use utmpx])
Darren Tuckera3020db2003-06-28 12:54:33 +10003465 fi
3466 ]
andre2ff7b5d2000-06-03 14:57:40 +00003467)
3468AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00003469 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10003470 [
3471 if test "x$enableval" = "xno" ; then
3472 AC_DEFINE(DISABLE_WTMP)
3473 fi
3474 ]
andre2ff7b5d2000-06-03 14:57:40 +00003475)
3476AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00003477 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10003478 [
3479 if test "x$enableval" = "xno" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07003480 AC_DEFINE(DISABLE_WTMPX, 1,
3481 [Define if you don't want to use wtmpx])
Darren Tuckera3020db2003-06-28 12:54:33 +10003482 fi
3483 ]
andre2ff7b5d2000-06-03 14:57:40 +00003484)
3485AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00003486 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10003487 [
3488 if test "x$enableval" = "xno" ; then
3489 AC_DEFINE(DISABLE_LOGIN)
3490 fi
3491 ]
andre2ff7b5d2000-06-03 14:57:40 +00003492)
3493AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00003494 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10003495 [
3496 if test "x$enableval" = "xno" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07003497 AC_DEFINE(DISABLE_PUTUTLINE, 1,
3498 [Define if you don't want to use pututline()
3499 etc. to write [uw]tmp])
Darren Tuckera3020db2003-06-28 12:54:33 +10003500 fi
3501 ]
andre2ff7b5d2000-06-03 14:57:40 +00003502)
3503AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00003504 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10003505 [
3506 if test "x$enableval" = "xno" ; then
Tim Rice7df8d392005-09-19 09:33:39 -07003507 AC_DEFINE(DISABLE_PUTUTXLINE, 1,
3508 [Define if you don't want to use pututxline()
3509 etc. to write [uw]tmpx])
Darren Tuckera3020db2003-06-28 12:54:33 +10003510 fi
3511 ]
andre2ff7b5d2000-06-03 14:57:40 +00003512)
3513AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00003514 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11003515 [
Tim Riceeae17cc2005-03-17 16:52:20 -08003516 if test "x$withval" = "xno" ; then
Damien Miller709528a2001-01-31 09:57:55 +11003517 AC_DEFINE(DISABLE_LASTLOG)
Tim Rice35cc69d2005-03-17 16:44:25 -08003518 elif test -n "$withval" && test "x${withval}" != "xyes"; then
Damien Miller709528a2001-01-31 09:57:55 +11003519 conf_lastlog_location=$withval
3520 fi
3521 ]
3522)
andre2ff7b5d2000-06-03 14:57:40 +00003523
3524dnl lastlog, [uw]tmpx? detection
3525dnl NOTE: set the paths in the platform section to avoid the
3526dnl need for command-line parameters
3527dnl lastlog and [uw]tmp are subject to a file search if all else fails
3528
3529dnl lastlog detection
3530dnl NOTE: the code itself will detect if lastlog is a directory
3531AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
3532AC_TRY_COMPILE([
3533#include <sys/types.h>
3534#include <utmp.h>
3535#ifdef HAVE_LASTLOG_H
3536# include <lastlog.h>
3537#endif
Damien Miller2994e082000-06-04 15:51:47 +10003538#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003539# include <paths.h>
3540#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00003541#ifdef HAVE_LOGIN_H
3542# include <login.h>
3543#endif
andre2ff7b5d2000-06-03 14:57:40 +00003544 ],
3545 [ char *lastlog = LASTLOG_FILE; ],
3546 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10003547 [
3548 AC_MSG_RESULT(no)
3549 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
3550 AC_TRY_COMPILE([
3551#include <sys/types.h>
3552#include <utmp.h>
3553#ifdef HAVE_LASTLOG_H
3554# include <lastlog.h>
3555#endif
3556#ifdef HAVE_PATHS_H
3557# include <paths.h>
3558#endif
3559 ],
3560 [ char *lastlog = _PATH_LASTLOG; ],
3561 [ AC_MSG_RESULT(yes) ],
3562 [
andree441aa32000-06-12 22:34:38 +00003563 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10003564 system_lastlog_path=no
3565 ])
3566 ]
andre2ff7b5d2000-06-03 14:57:40 +00003567)
Damien Miller2994e082000-06-04 15:51:47 +10003568
andre2ff7b5d2000-06-03 14:57:40 +00003569if test -z "$conf_lastlog_location"; then
3570 if test x"$system_lastlog_path" = x"no" ; then
3571 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10003572 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00003573 conf_lastlog_location=$f
3574 fi
3575 done
3576 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00003577 AC_MSG_WARN([** Cannot find lastlog **])
3578 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00003579 fi
3580 fi
3581fi
3582
3583if test -n "$conf_lastlog_location"; then
Tim Rice7df8d392005-09-19 09:33:39 -07003584 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location",
3585 [Define if you want to specify the path to your lastlog file])
Tim Riceeae17cc2005-03-17 16:52:20 -08003586fi
andre2ff7b5d2000-06-03 14:57:40 +00003587
3588dnl utmp detection
3589AC_MSG_CHECKING([if your system defines UTMP_FILE])
3590AC_TRY_COMPILE([
3591#include <sys/types.h>
3592#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003593#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003594# include <paths.h>
3595#endif
3596 ],
3597 [ char *utmp = UTMP_FILE; ],
3598 [ AC_MSG_RESULT(yes) ],
3599 [ AC_MSG_RESULT(no)
3600 system_utmp_path=no ]
3601)
3602if test -z "$conf_utmp_location"; then
3603 if test x"$system_utmp_path" = x"no" ; then
3604 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
3605 if test -f $f ; then
3606 conf_utmp_location=$f
3607 fi
3608 done
3609 if test -z "$conf_utmp_location"; then
3610 AC_DEFINE(DISABLE_UTMP)
3611 fi
3612 fi
3613fi
3614if test -n "$conf_utmp_location"; then
Tim Rice7df8d392005-09-19 09:33:39 -07003615 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location",
3616 [Define if you want to specify the path to your utmp file])
Tim Riceeae17cc2005-03-17 16:52:20 -08003617fi
andre2ff7b5d2000-06-03 14:57:40 +00003618
3619dnl wtmp detection
3620AC_MSG_CHECKING([if your system defines WTMP_FILE])
3621AC_TRY_COMPILE([
3622#include <sys/types.h>
3623#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10003624#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003625# include <paths.h>
3626#endif
3627 ],
3628 [ char *wtmp = WTMP_FILE; ],
3629 [ AC_MSG_RESULT(yes) ],
3630 [ AC_MSG_RESULT(no)
3631 system_wtmp_path=no ]
3632)
3633if test -z "$conf_wtmp_location"; then
3634 if test x"$system_wtmp_path" = x"no" ; then
3635 for f in /usr/adm/wtmp /var/log/wtmp; do
3636 if test -f $f ; then
3637 conf_wtmp_location=$f
3638 fi
3639 done
3640 if test -z "$conf_wtmp_location"; then
3641 AC_DEFINE(DISABLE_WTMP)
3642 fi
3643 fi
3644fi
3645if test -n "$conf_wtmp_location"; then
Tim Rice7df8d392005-09-19 09:33:39 -07003646 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location",
3647 [Define if you want to specify the path to your wtmp file])
Tim Riceeae17cc2005-03-17 16:52:20 -08003648fi
andre2ff7b5d2000-06-03 14:57:40 +00003649
3650
3651dnl utmpx detection - I don't know any system so perverse as to require
3652dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
3653dnl there, though.
3654AC_MSG_CHECKING([if your system defines UTMPX_FILE])
3655AC_TRY_COMPILE([
3656#include <sys/types.h>
3657#include <utmp.h>
3658#ifdef HAVE_UTMPX_H
3659#include <utmpx.h>
3660#endif
Damien Miller2994e082000-06-04 15:51:47 +10003661#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003662# include <paths.h>
3663#endif
3664 ],
3665 [ char *utmpx = UTMPX_FILE; ],
3666 [ AC_MSG_RESULT(yes) ],
3667 [ AC_MSG_RESULT(no)
3668 system_utmpx_path=no ]
3669)
3670if test -z "$conf_utmpx_location"; then
3671 if test x"$system_utmpx_path" = x"no" ; then
3672 AC_DEFINE(DISABLE_UTMPX)
3673 fi
3674else
Tim Rice7df8d392005-09-19 09:33:39 -07003675 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location",
3676 [Define if you want to specify the path to your utmpx file])
Tim Riceeae17cc2005-03-17 16:52:20 -08003677fi
andre2ff7b5d2000-06-03 14:57:40 +00003678
3679dnl wtmpx detection
3680AC_MSG_CHECKING([if your system defines WTMPX_FILE])
3681AC_TRY_COMPILE([
3682#include <sys/types.h>
3683#include <utmp.h>
3684#ifdef HAVE_UTMPX_H
3685#include <utmpx.h>
3686#endif
Damien Miller2994e082000-06-04 15:51:47 +10003687#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00003688# include <paths.h>
3689#endif
3690 ],
3691 [ char *wtmpx = WTMPX_FILE; ],
3692 [ AC_MSG_RESULT(yes) ],
3693 [ AC_MSG_RESULT(no)
3694 system_wtmpx_path=no ]
3695)
3696if test -z "$conf_wtmpx_location"; then
3697 if test x"$system_wtmpx_path" = x"no" ; then
3698 AC_DEFINE(DISABLE_WTMPX)
3699 fi
3700else
Tim Rice7df8d392005-09-19 09:33:39 -07003701 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location",
3702 [Define if you want to specify the path to your wtmpx file])
Tim Riceeae17cc2005-03-17 16:52:20 -08003703fi
andre2ff7b5d2000-06-03 14:57:40 +00003704
Damien Miller4018c192000-04-30 09:30:44 +10003705
Damien Miller29ea30d2000-03-17 10:54:15 +11003706if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10003707 LDFLAGS="$LDFLAGS $blibflags$blibpath"
3708 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11003709fi
3710
Tim Rice4cec93f2002-02-26 08:40:48 -08003711dnl remove pam and dl because they are in $LIBPAM
3712if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08003713 LIBS=`echo $LIBS | sed 's/-lpam //'`
3714fi
3715if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3716 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08003717fi
3718
Darren Tucker7da23cb2005-08-03 00:20:15 +10003719dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3720dnl Add now.
3721CFLAGS="$CFLAGS $werror_flags"
3722
Damien Millerbac2d8a2000-09-05 16:13:06 +11003723AC_EXEEXT
Darren Tucker72c025d2005-01-18 12:05:18 +11003724AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3725 scard/Makefile ssh_prng_cmds survey.sh])
Tim Rice13aae5e2001-10-21 17:53:58 -07003726AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10003727
Damien Miller7b22d652000-06-18 14:07:04 +10003728# Print summary of options
3729
Damien Miller7b22d652000-06-18 14:07:04 +10003730# Someone please show me a better way :)
3731A=`eval echo ${prefix}` ; A=`eval echo ${A}`
3732B=`eval echo ${bindir}` ; B=`eval echo ${B}`
3733C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
3734D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00003735E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00003736F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10003737G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10003738H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
3739I=`eval echo ${user_path}` ; I=`eval echo ${I}`
3740J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10003741
3742echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00003743echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10003744echo " User binaries: $B"
3745echo " System binaries: $C"
3746echo " Configuration files: $D"
3747echo " Askpass program: $E"
3748echo " Manual pages: $F"
3749echo " PID file: $G"
3750echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10003751if test "x$external_path_file" = "x/etc/login.conf" ; then
3752echo " At runtime, sshd will use the path defined in $external_path_file"
3753echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07003754else
Damien Millerf58c6722002-05-13 13:15:42 +10003755echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07003756 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10003757echo " (If PATH is set in $external_path_file it will be used instead. If"
3758echo " used, ensure the path to scp is present, otherwise scp will not work.)"
3759 fi
Tim Rice43a1c132002-04-17 21:19:14 -07003760fi
Damien Millera18bbd32002-05-13 10:48:57 +10003761if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003762echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10003763fi
Damien Millerf58c6722002-05-13 13:15:42 +10003764echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10003765echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003766echo " KerberosV support: $KRB5_MSG"
3767echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003768echo " S/KEY support: $SKEY_MSG"
3769echo " TCP Wrappers support: $TCPW_MSG"
3770echo " MD5 password support: $MD5_MSG"
Darren Tucker16bcc1c2004-11-07 20:14:34 +11003771echo " libedit support: $LIBEDIT_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10003772echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10003773echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3774echo " BSD Auth support: $BSD_AUTH_MSG"
3775echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11003776if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10003777echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11003778fi
3779
Damien Miller7b22d652000-06-18 14:07:04 +10003780echo ""
3781
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00003782echo " Host: ${host}"
3783echo " Compiler: ${CC}"
3784echo " Compiler flags: ${CFLAGS}"
3785echo "Preprocessor flags: ${CPPFLAGS}"
3786echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08003787echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10003788
3789echo ""
3790
Tim Rice6f1f7582004-05-30 21:38:51 -07003791if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
Darren Tuckercf59d312004-08-29 21:18:09 +10003792 echo "SVR4 style packages are supported with \"make package\""
3793 echo ""
Tim Rice6f1f7582004-05-30 21:38:51 -07003794fi
3795
Damien Miller82cf0ce2000-12-20 13:34:48 +11003796if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11003797 echo "PAM is enabled. You may need to install a PAM control file "
3798 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11003799 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11003800 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11003801 echo ""
3802fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003803
Damien Miller6c21c512002-01-22 21:57:53 +11003804if test ! -z "$RAND_HELPER_CMDHASH" ; then
3805 echo "WARNING: you are using the builtin random number collection "
3806 echo "service. Please read WARNING.RNG and request that your OS "
3807 echo "vendor includes kernel-based random number collection in "
3808 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00003809 echo ""
3810fi
Damien Miller60396b02001-02-18 17:01:00 +11003811
Damien Millerb4097182004-05-23 14:09:40 +10003812if test ! -z "$NO_PEERCHECK" ; then
3813 echo "WARNING: the operating system that you are using does not "
3814 echo "appear to support either the getpeereid() API nor the "
3815 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
3816 echo "enforce security checks to prevent unauthorised connections to "
3817 echo "ssh-agent. Their absence increases the risk that a malicious "
3818 echo "user can connect to your agent. "
3819 echo ""
3820fi
3821
Darren Tuckerd9f88912005-02-20 21:01:48 +11003822if test "$AUDIT_MODULE" = "bsm" ; then
3823 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
3824 echo "See the Solaris section in README.platform for details."
3825fi