blob: 172182eaa232565aafe8d4d39b67ea75b768710d [file] [log] [blame]
Damien Miller4fefe242004-03-11 14:20:10 +11001# $Id: configure.ac,v 1.206 2004/03/11 03:20:10 djm Exp $
2#
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
Tim Rice13aae5e2001-10-21 17:53:58 -070017AC_INIT
18AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +100019
20AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +110021AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +110022AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +110023AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100024
Damien Millera22ba012000-03-02 23:09:20 +110025# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100026AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110027AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100028AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110029AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000030AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070031AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080032AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110033AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100034AC_PATH_PROG(ENT, ent)
35AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110036AC_PATH_PROG(TEST_MINUS_S_SH, bash)
37AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
38AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070039AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110040
Damien Millere8bb4502001-09-25 16:39:35 +100041# System features
42AC_SYS_LARGEFILE
43
Damien Miller3f62aba2000-11-29 11:56:35 +110044if test -z "$AR" ; then
45 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
46fi
47
Damien Millerad833b32000-08-23 10:46:23 +100048# Use LOGIN_PROGRAM from environment if possible
49if test ! -z "$LOGIN_PROGRAM" ; then
50 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
51else
52 # Search for login
53 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
54 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
55 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
56 fi
57fi
58
Darren Tucker23bc8d02004-02-06 16:24:31 +110059AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
60if test ! -z "$PATH_PASSWD_PROG" ; then
61 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
62fi
63
Damien Miller166bd442000-03-16 10:48:25 +110064if test -z "$LD" ; then
65 LD=$CC
66fi
67AC_SUBST(LD)
68
Damien Miller166bd442000-03-16 10:48:25 +110069AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110070if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100071 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110072fi
73
Tim Rice88368a32003-12-08 12:35:59 -080074AC_ARG_WITH(rpath,
75 [ --without-rpath Disable auto-added -R linker paths],
76 [
77 if test "x$withval" = "xno" ; then
78 need_dash_r=""
79 fi
80 if test "x$withval" = "xyes" ; then
81 need_dash_r=1
82 fi
83 ]
84)
85
Damien Millera22ba012000-03-02 23:09:20 +110086# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110087case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110088*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110089 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +100090 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -080091 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110092 fi
Damien Millereab4bae2003-04-29 23:22:40 +100093 saved_LDFLAGS="$LDFLAGS"
94 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
95 if (test -z "$blibflags"); then
96 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
97 AC_TRY_LINK([], [], [blibflags=$tryflags])
98 fi
99 done
100 if (test -z "$blibflags"); then
101 AC_MSG_RESULT(not found)
102 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
103 else
104 AC_MSG_RESULT($blibflags)
105 fi
106 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000107 dnl Check for authenticate. Might be in libs.a on older AIXes
108 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -0700109 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000110 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -0700111 LIBS="$LIBS -ls"
112 ])
113 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000114 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
115 AC_CHECK_DECL(loginfailed,
116 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
117 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000118 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000119 [(void)loginfailed("user","host","tty",0);],
120 [AC_MSG_RESULT(yes)
121 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000122 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000123 )],
124 [],
125 [#include <usersec.h>]
126 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000127 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +1100128 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000129 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000130 AC_DEFINE(SETEUID_BREAKS_SETUID)
131 AC_DEFINE(BROKEN_SETREUID)
132 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000133 dnl AIX handles lastlog as part of its login message
134 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000135 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000136 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100137 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100138*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100139 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800140 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100141 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000142 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100143 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100144 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000145 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000146 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700147 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000148 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100149 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000150*-*-dgux*)
151 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100152 AC_DEFINE(SETEUID_BREAKS_SETUID)
153 AC_DEFINE(BROKEN_SETREUID)
154 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000155 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000156*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000157 AC_MSG_CHECKING(if we have working getaddrinfo)
158 AC_TRY_RUN([#include <mach-o/dyld.h>
159main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
160 exit(0);
161 else
162 exit(1);
163}], [AC_MSG_RESULT(working)],
164 [AC_MSG_RESULT(buggy)
165 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700166 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000167 AC_DEFINE(SETEUID_BREAKS_SETUID)
168 AC_DEFINE(BROKEN_SETREUID)
169 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100170 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000171 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000172*-*-hpux10.26)
173 if test -z "$GCC"; then
174 CFLAGS="$CFLAGS -Ae"
175 fi
176 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
177 IPADDR_IN_DISPLAY=yes
178 AC_DEFINE(HAVE_SECUREWARE)
179 AC_DEFINE(USE_PIPES)
180 AC_DEFINE(LOGIN_NO_ENDOPT)
181 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000182 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000183 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700184 LIBS="$LIBS -lsec -lsecpw"
185 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000186 disable_ptmx_check=yes
187 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100188*-*-hpux10*)
189 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000190 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100191 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000192 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100193 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000194 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000195 AC_DEFINE(LOGIN_NO_ENDOPT)
196 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000197 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000198 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700199 LIBS="$LIBS -lsec"
200 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100201 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000202*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000203 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100204 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100205 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100206 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000207 AC_DEFINE(LOGIN_NO_ENDOPT)
208 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100209 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000210 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000211 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tuckerf58fb7e2004-02-06 15:59:06 +1100212 case "$host" in
213 *-*-hpux11.11*)
214 AC_DEFINE(BROKEN_GETADDRINFO);;
215 esac
Tim Ricef028f1e2002-07-19 12:41:10 -0700216 LIBS="$LIBS -lsec"
217 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000218 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100219*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100220 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000221 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000222 AC_DEFINE(SETEUID_BREAKS_SETUID)
223 AC_DEFINE(BROKEN_SETREUID)
224 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000225 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000226 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100227 ;;
228*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100229 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000230 AC_DEFINE(WITH_IRIX_ARRAY)
231 AC_DEFINE(WITH_IRIX_PROJECT)
232 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000233 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000234 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000235 AC_DEFINE(SETEUID_BREAKS_SETUID)
236 AC_DEFINE(BROKEN_SETREUID)
237 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000238 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000239 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100240 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100241*-*-linux*)
242 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100243 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000244 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100245 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000246 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000247 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000248 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100249 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000250 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000251 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000252 AC_DEFINE(BROKEN_CMSG_TYPE)
253 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000254 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100255 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000256mips-sony-bsd|mips-sony-newsos4)
257 AC_DEFINE(HAVE_NEWS4)
258 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000259 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100260*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000261 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800262 if test "x$withval" != "xno" ; then
263 need_dash_r=1
264 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100265 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100266*-*-freebsd*)
267 check_for_libcrypt_later=1
268 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000269*-*-bsdi*)
270 AC_DEFINE(SETEUID_BREAKS_SETUID)
271 AC_DEFINE(BROKEN_SETREUID)
272 AC_DEFINE(BROKEN_SETREGID)
273 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000274*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000275 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100276 conf_utmp_location=/etc/utmp
277 conf_wtmp_location=/usr/adm/wtmp
278 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000279 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000280 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000281 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100282 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000283 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100284*-*-solaris*)
Tim Ricead4a1882004-02-29 15:53:37 -0800285 if test "x$withval" != "xno" ; then
286 need_dash_r=1
287 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100288 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000289 AC_DEFINE(LOGIN_NEEDS_UTMPX)
290 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000291 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000292 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000293 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
294 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000295 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000296 # hardwire lastlog location (can't detect it on some versions)
297 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000298 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
299 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
300 if test "$sol2ver" -ge 8; then
301 AC_MSG_RESULT(yes)
302 AC_DEFINE(DISABLE_UTMP)
303 AC_DEFINE(DISABLE_WTMP)
304 else
305 AC_MSG_RESULT(no)
306 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100307 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000308*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000309 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000310 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100311 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000312 conf_utmp_location=/etc/utmp
313 conf_wtmp_location=/var/adm/wtmp
314 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000315 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000316 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000317*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700318 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000319 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000320 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000321 AC_DEFINE(SETEUID_BREAKS_SETUID)
322 AC_DEFINE(BROKEN_SETREUID)
323 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000324 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000325*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700326 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000327 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100328 IPADDR_IN_DISPLAY=yes
329 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000330 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000331 AC_DEFINE(SETEUID_BREAKS_SETUID)
332 AC_DEFINE(BROKEN_SETREUID)
333 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000334 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000335 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700336 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
337 # Attention: always take care to bind libsocket and libnsl before libc,
338 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000339 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100340*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100341 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700342 AC_DEFINE(SETEUID_BREAKS_SETUID)
343 AC_DEFINE(BROKEN_SETREUID)
344 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100345 ;;
346*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100347 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700348 AC_DEFINE(SETEUID_BREAKS_SETUID)
349 AC_DEFINE(BROKEN_SETREUID)
350 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100351 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100352*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100353 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100354*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800355 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Ricee8c898a2004-02-23 21:47:04 -0800356 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100357 RANLIB=true
358 no_dev_ptmx=1
359 AC_DEFINE(BROKEN_SYS_TERMIO_H)
360 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000361 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000362 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100363 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700364 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100365 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700366 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700367 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100368 ;;
369*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800370 if test -z "$GCC"; then
371 CFLAGS="$CFLAGS -belf"
372 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100373 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000374 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100375 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000376 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000377 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700378 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700379 AC_DEFINE(SETEUID_BREAKS_SETUID)
380 AC_DEFINE(BROKEN_SETREUID)
381 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700382 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100383 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700384 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000385 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000386*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100387 AC_DEFINE(NO_SSH_LASTLOG)
388 AC_DEFINE(SETEUID_BREAKS_SETUID)
389 AC_DEFINE(BROKEN_SETREUID)
390 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000391 AC_DEFINE(USE_PIPES)
392 AC_DEFINE(DISABLE_FD_PASSING)
393 LDFLAGS="$LDFLAGS"
394 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
395 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000396 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000397*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100398 AC_DEFINE(SETEUID_BREAKS_SETUID)
399 AC_DEFINE(BROKEN_SETREUID)
400 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000401 AC_DEFINE(WITH_ABBREV_NO_TTY)
402 AC_DEFINE(USE_PIPES)
403 AC_DEFINE(DISABLE_FD_PASSING)
404 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100405 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000406 MANTYPE=cat
407 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000408*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100409 AC_DEFINE(SETEUID_BREAKS_SETUID)
410 AC_DEFINE(BROKEN_SETREUID)
411 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000412 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700413 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700414 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000415 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
416 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
417 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700418 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000419*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000420 AC_MSG_CHECKING(for Digital Unix SIA)
421 no_osfsia=""
422 AC_ARG_WITH(osfsia,
423 [ --with-osfsia Enable Digital Unix SIA],
424 [
425 if test "x$withval" = "xno" ; then
426 AC_MSG_RESULT(disabled)
427 no_osfsia=1
428 fi
429 ],
430 )
431 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000432 if test -f /etc/sia/matrix.conf; then
433 AC_MSG_RESULT(yes)
434 AC_DEFINE(HAVE_OSF_SIA)
435 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000436 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000437 LIBS="$LIBS -lsecurity -ldb -lm -laud"
438 else
439 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100440 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000441 fi
442 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000443 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700444 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000445 AC_DEFINE(BROKEN_SETREUID)
446 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000447 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000448
449*-*-nto-qnx)
450 AC_DEFINE(USE_PIPES)
451 AC_DEFINE(NO_X11_UNIX_SOCKETS)
452 AC_DEFINE(MISSING_NFDBITS)
453 AC_DEFINE(MISSING_HOWMANY)
454 AC_DEFINE(MISSING_FD_MASK)
455 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100456esac
457
Damien Millere37bfc12000-06-05 09:37:43 +1000458# Allow user to specify flags
459AC_ARG_WITH(cflags,
460 [ --with-cflags Specify additional flags to pass to compiler],
461 [
462 if test "x$withval" != "xno" ; then
463 CFLAGS="$CFLAGS $withval"
464 fi
465 ]
466)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000467AC_ARG_WITH(cppflags,
468 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
469 [
470 if test "x$withval" != "xno"; then
471 CPPFLAGS="$CPPFLAGS $withval"
472 fi
473 ]
474)
Damien Millere37bfc12000-06-05 09:37:43 +1000475AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000476 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000477 [
478 if test "x$withval" != "xno" ; then
479 LDFLAGS="$LDFLAGS $withval"
480 fi
481 ]
482)
483AC_ARG_WITH(libs,
484 [ --with-libs Specify additional libraries to link with],
485 [
486 if test "x$withval" != "xno" ; then
487 LIBS="$LIBS $withval"
488 fi
489 ]
490)
491
Darren Tucker6eb93042003-06-29 21:30:41 +1000492AC_MSG_CHECKING(compiler and flags for sanity)
493AC_TRY_RUN([
494#include <stdio.h>
495int main(){exit(0);}
496 ],
497 [ AC_MSG_RESULT(yes) ],
498 [
499 AC_MSG_RESULT(no)
500 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
501 ]
502)
503
Tim Rice4cec93f2002-02-26 08:40:48 -0800504# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000505AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000506 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800507 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100508 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000509 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000510 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
Damien Miller6c4914a2004-03-03 11:08:59 +1100511 sys/cdefs.h sys/mman.h sys/prctl.h sys/pstat.h sys/ptms.h \
512 sys/select.h sys/stat.h sys/stream.h sys/stropts.h \
513 sys/sysmacros.h sys/time.h sys/timers.h sys/un.h time.h tmpdir.h \
514 ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800515
Damien Millera22ba012000-03-02 23:09:20 +1100516# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700517AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
518AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000519
Damien Millerdf288022001-02-18 13:07:07 +1100520dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700521if test "x$with_tcp_wrappers" != "xno" ; then
522 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
523 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
524 fi
525fi
Damien Millerdf288022001-02-18 13:07:07 +1100526
Tim Rice1e1ef642003-09-11 22:19:31 -0700527dnl IRIX and Solaris 2.5.1 have dirname() in libgen
528AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
529 AC_CHECK_LIB(gen, dirname,[
530 AC_CACHE_CHECK([for broken dirname],
531 ac_cv_have_broken_dirname, [
532 save_LIBS="$LIBS"
533 LIBS="$LIBS -lgen"
534 AC_TRY_RUN(
535 [
536#include <libgen.h>
537#include <string.h>
538
539int main(int argc, char **argv) {
540 char *s, buf[32];
541
542 strncpy(buf,"/etc", 32);
543 s = dirname(buf);
544 if (!s || strncmp(s, "/", 32) != 0) {
545 exit(1);
546 } else {
547 exit(0);
548 }
549}
550 ],
551 [ ac_cv_have_broken_dirname="no" ],
552 [ ac_cv_have_broken_dirname="yes" ]
553 )
554 LIBS="$save_LIBS"
555 ])
556 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
557 LIBS="$LIBS -lgen"
558 AC_DEFINE(HAVE_DIRNAME)
559 AC_CHECK_HEADERS(libgen.h)
560 fi
561 ])
562])
563
564AC_CHECK_FUNC(getspnam, ,
565 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
566AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
567
Tim Rice13aae5e2001-10-21 17:53:58 -0700568dnl zlib is required
569AC_ARG_WITH(zlib,
570 [ --with-zlib=PATH Use zlib in PATH],
571 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000572 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100573 AC_MSG_ERROR([*** zlib is required ***])
574 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700575 if test -d "$withval/lib"; then
576 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700577 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700578 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700579 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700580 fi
581 else
582 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700583 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700584 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700585 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700586 fi
587 fi
588 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700589 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700590 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700591 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700592 fi
593 ]
594)
595
Tim Ricefcb62202004-01-23 18:35:16 -0800596AC_CHECK_LIB(z, deflate, ,
597 [
598 saved_CPPFLAGS="$CPPFLAGS"
599 saved_LDFLAGS="$LDFLAGS"
600 save_LIBS="$LIBS"
601 dnl Check default zlib install dir
602 if test -n "${need_dash_r}"; then
603 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
604 else
605 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
606 fi
607 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
608 LIBS="$LIBS -lz"
609 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
610 [
611 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
612 ]
613 )
614 ]
615)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100616AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100617
618AC_ARG_WITH(zlib-version-check,
619 [ --without-zlib-version-check Disable zlib version check],
620 [ if test "x$withval" = "xno" ; then
621 zlib_check_nonfatal=1
622 fi
623 ]
624)
625
Darren Tucker2dcd2392004-01-23 17:13:33 +1100626AC_MSG_CHECKING(for zlib 1.1.4 or greater)
627AC_TRY_RUN([
628#include <zlib.h>
629int main()
630{
631 int a, b, c, v;
632 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
633 exit(1);
634 v = a*1000000 + b*1000 + c;
635 if (v >= 1001004)
636 exit(0);
637 exit(2);
638}
639 ],
640 AC_MSG_RESULT(yes),
641 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100642 if test -z "$zlib_check_nonfatal" ; then
643 AC_MSG_ERROR([*** zlib too old - check config.log ***
644Your reported zlib version has known security problems. It's possible your
645vendor has fixed these problems without changing the version number. If you
646are sure this is the case, you can disable the check by running
647"./configure --without-zlib-version-check".
648If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
649 else
650 AC_MSG_WARN([zlib version may have security problems])
651 fi
652 ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100653)
Damien Miller6f9c3372000-10-25 10:06:04 +1100654
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000655dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100656AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000657 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
658)
Damien Millera8e06ce2003-11-21 23:48:55 +1100659AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700660 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
661 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000662)
Damien Millerab18c411999-11-11 10:40:23 +1100663
Tim Ricee589a292001-11-03 11:09:32 -0800664dnl Checks for libutil functions
665AC_CHECK_HEADERS(libutil.h)
666AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
667AC_CHECK_FUNCS(logout updwtmp logwtmp)
668
Ben Lindstrom8697e082001-02-24 21:41:10 +0000669AC_FUNC_STRFTIME
670
Damien Miller3c027682001-03-14 11:39:45 +1100671# Check for ALTDIRFUNC glob() extension
672AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
673AC_EGREP_CPP(FOUNDIT,
674 [
675 #include <glob.h>
676 #ifdef GLOB_ALTDIRFUNC
677 FOUNDIT
678 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100679 ],
Damien Miller3c027682001-03-14 11:39:45 +1100680 [
681 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
682 AC_MSG_RESULT(yes)
683 ],
684 [
685 AC_MSG_RESULT(no)
686 ]
687)
Damien Millerab18c411999-11-11 10:40:23 +1100688
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000689# Check for g.gl_matchc glob() extension
690AC_MSG_CHECKING(for gl_matchc field in glob_t)
691AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100692 [
693 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000694 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100695 ],
696 [
697 AC_DEFINE(GLOB_HAS_GL_MATCHC)
698 AC_MSG_RESULT(yes)
699 ],
700 [
701 AC_MSG_RESULT(no)
702 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000703)
704
Damien Miller18bb4732001-03-28 14:35:30 +1000705AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
706AC_TRY_RUN(
707 [
708#include <sys/types.h>
709#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700710int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000711 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100712 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000713 [
714 AC_MSG_RESULT(no)
715 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
716 ]
717)
718
Damien Millerc547bf12001-02-16 10:18:12 +1100719# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100720SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100721AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700722 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100723 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100724 [
725 if test "x$withval" != "xno" ; then
726
727 if test "x$withval" != "xyes" ; then
728 CPPFLAGS="$CPPFLAGS -I${withval}/include"
729 LDFLAGS="$LDFLAGS -L${withval}/lib"
730 fi
731
732 AC_DEFINE(SKEY)
733 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100734 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100735
Tim Rice4cec93f2002-02-26 08:40:48 -0800736 AC_MSG_CHECKING([for s/key support])
737 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100738 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800739#include <stdio.h>
740#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700741int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800742 ],
743 [AC_MSG_RESULT(yes)],
744 [
745 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100746 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
747 ])
748 fi
749 ]
750)
751
752# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700753TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100754AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700755 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100756 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100757 [
758 if test "x$withval" != "xno" ; then
759 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700760 saved_LDFLAGS="$LDFLAGS"
761 saved_CPPFLAGS="$CPPFLAGS"
762 if test -n "${withval}" -a "${withval}" != "yes"; then
763 if test -d "${withval}/lib"; then
764 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700765 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700766 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700767 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700768 fi
769 else
770 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700771 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700772 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700773 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700774 fi
775 fi
776 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700777 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700778 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700779 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700780 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700781 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800782 LIBWRAP="-lwrap"
783 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100784 AC_MSG_CHECKING(for libwrap)
785 AC_TRY_LINK(
786 [
787#include <tcpd.h>
788 int deny_severity = 0, allow_severity = 0;
789 ],
790 [hosts_access(0);],
791 [
792 AC_MSG_RESULT(yes)
793 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800794 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700795 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100796 ],
797 [
798 AC_MSG_ERROR([*** libwrap missing])
799 ]
800 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800801 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100802 fi
803 ]
804)
805
Damien Millerfe1f1432003-02-24 15:45:42 +1100806dnl Checks for library functions. Please keep in alphabetical order
807AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000808 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000809 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000810 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000811 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100812 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000813 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100814 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000815 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100816 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000817 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000818 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100819 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100820)
Tim Rice13aae5e2001-10-21 17:53:58 -0700821
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000822# IRIX has a const char return value for gai_strerror()
823AC_CHECK_FUNCS(gai_strerror,[
824 AC_DEFINE(HAVE_GAI_STRERROR)
825 AC_TRY_COMPILE([
826#include <sys/types.h>
827#include <sys/socket.h>
828#include <netdb.h>
829
830const char *gai_strerror(int);],[
831char *str;
832
833str = gai_strerror(0);],[
834 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
835 [Define if gai_strerror() returns const char *])])])
836
Damien Millercd6853c2003-01-28 11:33:42 +1100837AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
838
Darren Tuckerf1159b52003-07-07 19:44:01 +1000839dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000840AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000841AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000842
Darren Tuckerb2427c82003-09-10 15:22:44 +1000843dnl tcsendbreak might be a macro
844AC_CHECK_DECL(tcsendbreak,
845 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100846 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000847 [#include <termios.h>]
848)
849
Darren Tucker2a6b0292003-12-31 14:59:17 +1100850AC_CHECK_FUNCS(setresuid, [
851 dnl Some platorms have setresuid that isn't implemented, test for this
852 AC_MSG_CHECKING(if setresuid seems to work)
853 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100854#include <stdlib.h>
855#include <errno.h>
856int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100857 ],
858 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100859 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100860 AC_MSG_RESULT(not implemented)]
861 )
862])
Darren Tuckere937be32003-12-17 18:53:26 +1100863
Darren Tucker2a6b0292003-12-31 14:59:17 +1100864AC_CHECK_FUNCS(setresgid, [
865 dnl Some platorms have setresgid that isn't implemented, test for this
866 AC_MSG_CHECKING(if setresgid seems to work)
867 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100868#include <stdlib.h>
869#include <errno.h>
870int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100871 ],
872 [AC_MSG_RESULT(yes)],
873 [AC_DEFINE(BROKEN_SETRESGID)
874 AC_MSG_RESULT(not implemented)]
875 )
876])
Darren Tuckere937be32003-12-17 18:53:26 +1100877
Damien Millerad833b32000-08-23 10:46:23 +1000878dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000879AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000880dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000881AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000882AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000883dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000884AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000885AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100886
Damien Millera8e06ce2003-11-21 23:48:55 +1100887AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100888 [AC_DEFINE(HAVE_DAEMON)],
889 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
890)
891
Damien Millera8e06ce2003-11-21 23:48:55 +1100892AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100893 [AC_DEFINE(HAVE_GETPAGESIZE)],
894 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
895)
896
Damien Millercb170cb2000-07-01 16:52:55 +1000897# Check for broken snprintf
898if test "x$ac_cv_func_snprintf" = "xyes" ; then
899 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
900 AC_TRY_RUN(
901 [
902#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700903int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000904 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100905 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000906 [
907 AC_MSG_RESULT(no)
908 AC_DEFINE(BROKEN_SNPRINTF)
909 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
910 ]
911 )
912fi
913
Damien Millere8328192003-01-07 15:18:32 +1100914dnl see whether mkstemp() requires XXXXXX
915if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
916AC_MSG_CHECKING([for (overly) strict mkstemp])
917AC_TRY_RUN(
918 [
919#include <stdlib.h>
920main() { char template[]="conftest.mkstemp-test";
921if (mkstemp(template) == -1)
922 exit(1);
923unlink(template); exit(0);
924}
925 ],
926 [
927 AC_MSG_RESULT(no)
928 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100929 [
Damien Millere8328192003-01-07 15:18:32 +1100930 AC_MSG_RESULT(yes)
931 AC_DEFINE(HAVE_STRICT_MKSTEMP)
932 ],
933 [
934 AC_MSG_RESULT(yes)
935 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100936 ]
Damien Millere8328192003-01-07 15:18:32 +1100937)
938fi
939
Darren Tucker70a3d552003-08-21 17:58:29 +1000940dnl make sure that openpty does not reacquire controlling terminal
941if test ! -z "$check_for_openpty_ctty_bug"; then
942 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
943 AC_TRY_RUN(
944 [
945#include <stdio.h>
946#include <sys/fcntl.h>
947#include <sys/types.h>
948#include <sys/wait.h>
949
950int
951main()
952{
953 pid_t pid;
954 int fd, ptyfd, ttyfd, status;
955
956 pid = fork();
957 if (pid < 0) { /* failed */
958 exit(1);
959 } else if (pid > 0) { /* parent */
960 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100961 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000962 exit(WEXITSTATUS(status));
963 else
964 exit(2);
965 } else { /* child */
966 close(0); close(1); close(2);
967 setsid();
968 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
969 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
970 if (fd >= 0)
971 exit(3); /* Acquired ctty: broken */
972 else
973 exit(0); /* Did not acquire ctty: OK */
974 }
975}
976 ],
977 [
978 AC_MSG_RESULT(yes)
979 ],
980 [
981 AC_MSG_RESULT(no)
982 AC_DEFINE(SSHD_ACQUIRES_CTTY)
983 ]
984 )
985fi
986
Damien Miller606f8802000-09-16 15:39:56 +1100987AC_FUNC_GETPGRP
988
Damien Millera64b57a2001-01-17 10:44:13 +1100989# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000990PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100991AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100992 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100993 [
Damien Millera64b57a2001-01-17 10:44:13 +1100994 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100995 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
996 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100997 AC_MSG_ERROR([PAM headers not found])
998 fi
999
1000 AC_CHECK_LIB(dl, dlopen, , )
1001 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1002 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001003 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001004
Damien Millera64b57a2001-01-17 10:44:13 +11001005 PAM_MSG="yes"
1006
1007 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001008 if test $ac_cv_lib_dl_dlopen = yes; then
1009 LIBPAM="-lpam -ldl"
1010 else
1011 LIBPAM="-lpam"
1012 fi
1013 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001014 fi
1015 ]
1016)
Damien Millera22ba012000-03-02 23:09:20 +11001017
Damien Millera64b57a2001-01-17 10:44:13 +11001018# Check for older PAM
1019if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001020 # Check PAM strerror arguments (old PAM)
1021 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1022 AC_TRY_COMPILE(
1023 [
Damien Miller81171112000-04-23 11:14:01 +10001024#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001025#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001026#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001027#elif defined (HAVE_PAM_PAM_APPL_H)
1028#include <pam/pam_appl.h>
1029#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001030 ],
1031 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001032 [AC_MSG_RESULT(no)],
1033 [
1034 AC_DEFINE(HAVE_OLD_PAM)
1035 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001036 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001037 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001038 )
Damien Millera22ba012000-03-02 23:09:20 +11001039fi
1040
Tim Riceaef73712002-05-11 13:17:42 -07001041# Search for OpenSSL
1042saved_CPPFLAGS="$CPPFLAGS"
1043saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001044AC_ARG_WITH(ssl-dir,
1045 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1046 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001047 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001048 if test -d "$withval/lib"; then
1049 if test -n "${need_dash_r}"; then
1050 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1051 else
1052 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1053 fi
1054 else
1055 if test -n "${need_dash_r}"; then
1056 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1057 else
1058 LDFLAGS="-L${withval} ${LDFLAGS}"
1059 fi
1060 fi
1061 if test -d "$withval/include"; then
1062 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1063 else
1064 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1065 fi
Damien Millera22ba012000-03-02 23:09:20 +11001066 fi
1067 ]
1068)
Tim Rice3d5352e2004-02-12 09:27:21 -08001069LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001070AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001071 [
Tim Riceaef73712002-05-11 13:17:42 -07001072 dnl Check default openssl install dir
1073 if test -n "${need_dash_r}"; then
1074 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001075 else
Tim Riceaef73712002-05-11 13:17:42 -07001076 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001077 fi
Tim Riceaef73712002-05-11 13:17:42 -07001078 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1079 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1080 [
1081 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1082 ]
1083 )
1084 ]
1085)
1086
Tim Riced730b782002-08-13 18:52:10 -07001087# Determine OpenSSL header version
1088AC_MSG_CHECKING([OpenSSL header version])
1089AC_TRY_RUN(
1090 [
1091#include <stdio.h>
1092#include <string.h>
1093#include <openssl/opensslv.h>
1094#define DATA "conftest.sslincver"
1095int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001096 FILE *fd;
1097 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001098
Damien Millera8e06ce2003-11-21 23:48:55 +11001099 fd = fopen(DATA,"w");
1100 if(fd == NULL)
1101 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001102
1103 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1104 exit(1);
1105
1106 exit(0);
1107}
1108 ],
1109 [
1110 ssl_header_ver=`cat conftest.sslincver`
1111 AC_MSG_RESULT($ssl_header_ver)
1112 ],
1113 [
1114 AC_MSG_RESULT(not found)
1115 AC_MSG_ERROR(OpenSSL version header not found.)
1116 ]
1117)
1118
1119# Determine OpenSSL library version
1120AC_MSG_CHECKING([OpenSSL library version])
1121AC_TRY_RUN(
1122 [
1123#include <stdio.h>
1124#include <string.h>
1125#include <openssl/opensslv.h>
1126#include <openssl/crypto.h>
1127#define DATA "conftest.ssllibver"
1128int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001129 FILE *fd;
1130 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001131
Damien Millera8e06ce2003-11-21 23:48:55 +11001132 fd = fopen(DATA,"w");
1133 if(fd == NULL)
1134 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001135
1136 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1137 exit(1);
1138
1139 exit(0);
1140}
1141 ],
1142 [
1143 ssl_library_ver=`cat conftest.ssllibver`
1144 AC_MSG_RESULT($ssl_library_ver)
1145 ],
1146 [
1147 AC_MSG_RESULT(not found)
1148 AC_MSG_ERROR(OpenSSL library not found.)
1149 ]
1150)
Damien Millera22ba012000-03-02 23:09:20 +11001151
Damien Millerec932372002-01-22 22:16:03 +11001152# Sanity check OpenSSL headers
1153AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1154AC_TRY_RUN(
1155 [
1156#include <string.h>
1157#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001158int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001159 ],
1160 [
1161 AC_MSG_RESULT(yes)
1162 ],
1163 [
1164 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001165 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1166Check config.log for details.
1167Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001168 ]
1169)
1170
Tim Rice3d5352e2004-02-12 09:27:21 -08001171# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1172# because the system crypt() is more featureful.
1173if test "x$check_for_libcrypt_before" = "x1"; then
1174 AC_CHECK_LIB(crypt, crypt)
1175fi
1176
Damien Millera8e06ce2003-11-21 23:48:55 +11001177# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001178# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001179if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001180 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001181fi
1182
Damien Miller6c21c512002-01-22 21:57:53 +11001183
1184### Configure cryptographic random number support
1185
1186# Check wheter OpenSSL seeds itself
1187AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1188AC_TRY_RUN(
1189 [
1190#include <string.h>
1191#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001192int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001193 ],
1194 [
1195 OPENSSL_SEEDS_ITSELF=yes
1196 AC_MSG_RESULT(yes)
1197 ],
1198 [
1199 AC_MSG_RESULT(no)
1200 # Default to use of the rand helper if OpenSSL doesn't
1201 # seed itself
1202 USE_RAND_HELPER=yes
1203 ]
1204)
1205
1206
1207# Do we want to force the use of the rand helper?
1208AC_ARG_WITH(rand-helper,
1209 [ --with-rand-helper Use subprocess to gather strong randomness ],
1210 [
1211 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001212 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001213 # the previous test showed it to be unseeded.
1214 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1215 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1216 OPENSSL_SEEDS_ITSELF=yes
1217 USE_RAND_HELPER=""
1218 fi
1219 else
1220 USE_RAND_HELPER=yes
1221 fi
1222 ],
1223)
1224
1225# Which randomness source do we use?
1226if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1227 # OpenSSL only
1228 AC_DEFINE(OPENSSL_PRNG_ONLY)
1229 RAND_MSG="OpenSSL internal ONLY"
1230 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001231elif test ! -z "$USE_RAND_HELPER" ; then
1232 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001233 RAND_MSG="ssh-rand-helper"
1234 INSTALL_SSH_RAND_HELPER="yes"
1235fi
1236AC_SUBST(INSTALL_SSH_RAND_HELPER)
1237
1238### Configuration of ssh-rand-helper
1239
1240# PRNGD TCP socket
1241AC_ARG_WITH(prngd-port,
1242 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1243 [
Damien Millere996d722002-01-23 11:20:59 +11001244 case "$withval" in
1245 no)
1246 withval=""
1247 ;;
1248 [[0-9]]*)
1249 ;;
1250 *)
1251 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1252 ;;
1253 esac
1254 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001255 PRNGD_PORT="$withval"
1256 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1257 fi
1258 ]
1259)
1260
1261# PRNGD Unix domain socket
1262AC_ARG_WITH(prngd-socket,
1263 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1264 [
Damien Millere996d722002-01-23 11:20:59 +11001265 case "$withval" in
1266 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001267 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001268 ;;
1269 no)
1270 withval=""
1271 ;;
1272 /*)
1273 ;;
1274 *)
1275 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1276 ;;
1277 esac
1278
1279 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001280 if test ! -z "$PRNGD_PORT" ; then
1281 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1282 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001283 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001284 AC_MSG_WARN(Entropy socket is not readable)
1285 fi
1286 PRNGD_SOCKET="$withval"
1287 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1288 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001289 ],
1290 [
1291 # Check for existing socket only if we don't have a random device already
1292 if test "$USE_RAND_HELPER" = yes ; then
1293 AC_MSG_CHECKING(for PRNGD/EGD socket)
1294 # Insert other locations here
1295 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1296 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1297 PRNGD_SOCKET="$sock"
1298 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1299 break;
1300 fi
1301 done
1302 if test ! -z "$PRNGD_SOCKET" ; then
1303 AC_MSG_RESULT($PRNGD_SOCKET)
1304 else
1305 AC_MSG_RESULT(not found)
1306 fi
1307 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001308 ]
1309)
1310
1311# Change default command timeout for hashing entropy source
1312entropy_timeout=200
1313AC_ARG_WITH(entropy-timeout,
1314 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1315 [
1316 if test "x$withval" != "xno" ; then
1317 entropy_timeout=$withval
1318 fi
1319 ]
1320)
Damien Miller6c21c512002-01-22 21:57:53 +11001321AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1322
Damien Millerd3f6ad22002-06-25 10:24:47 +10001323SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001324AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001325 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001326 [
1327 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001328 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001329 fi
1330 ]
1331)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001332AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1333AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001334
Tim Rice88f2ab52002-03-17 12:17:34 -08001335# We do this little dance with the search path to insure
1336# that programs that we select for use by installed programs
1337# (which may be run by the super-user) come from trusted
1338# locations before they come from the user's private area.
1339# This should help avoid accidentally configuring some
1340# random version of a program in someone's personal bin.
1341
1342OPATH=$PATH
1343PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001344test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001345test -d /sbin && PATH=$PATH:/sbin
1346test -d /usr/sbin && PATH=$PATH:/usr/sbin
1347PATH=$PATH:/etc:$OPATH
1348
Damien Millera8e06ce2003-11-21 23:48:55 +11001349# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001350OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1351OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1352OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1353OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1354OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1355OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1356OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1357OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1358OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1359OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1360OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1361OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1362OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1363OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1364OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1365OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001366# restore PATH
1367PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001368
1369# Where does ssh-rand-helper get its randomness from?
1370INSTALL_SSH_PRNG_CMDS=""
1371if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1372 if test ! -z "$PRNGD_PORT" ; then
1373 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1374 elif test ! -z "$PRNGD_SOCKET" ; then
1375 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1376 else
1377 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1378 RAND_HELPER_CMDHASH=yes
1379 INSTALL_SSH_PRNG_CMDS="yes"
1380 fi
1381fi
1382AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1383
1384
Ben Lindstromb5628642000-10-18 00:02:25 +00001385# Cheap hack to ensure NEWS-OS libraries are arranged right.
1386if test ! -z "$SONY" ; then
1387 LIBS="$LIBS -liberty";
1388fi
1389
Damien Millera22ba012000-03-02 23:09:20 +11001390# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001391AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001392AC_CHECK_SIZEOF(short int, 2)
1393AC_CHECK_SIZEOF(int, 4)
1394AC_CHECK_SIZEOF(long int, 4)
1395AC_CHECK_SIZEOF(long long int, 8)
1396
Damien Millerfa2bb692002-04-23 23:22:25 +10001397# Sanity check long long for some platforms (AIX)
1398if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1399 ac_cv_sizeof_long_long_int=0
1400fi
1401
Damien Millera22ba012000-03-02 23:09:20 +11001402# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001403AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1404 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001405 [ #include <sys/types.h> ],
1406 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001407 [ ac_cv_have_u_int="yes" ],
1408 [ ac_cv_have_u_int="no" ]
1409 )
1410])
1411if test "x$ac_cv_have_u_int" = "xyes" ; then
1412 AC_DEFINE(HAVE_U_INT)
1413 have_u_int=1
1414fi
1415
Damien Miller61e50f12000-05-08 20:49:37 +10001416AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1417 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001418 [ #include <sys/types.h> ],
1419 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001420 [ ac_cv_have_intxx_t="yes" ],
1421 [ ac_cv_have_intxx_t="no" ]
1422 )
1423])
1424if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1425 AC_DEFINE(HAVE_INTXX_T)
1426 have_intxx_t=1
1427fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001428
1429if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001430 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001431then
1432 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1433 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001434 [ #include <stdint.h> ],
1435 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001436 [
1437 AC_DEFINE(HAVE_INTXX_T)
1438 AC_MSG_RESULT(yes)
1439 ],
1440 [ AC_MSG_RESULT(no) ]
1441 )
1442fi
1443
Damien Miller578783e2000-09-23 14:12:24 +11001444AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1445 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001446 [
1447#include <sys/types.h>
1448#ifdef HAVE_STDINT_H
1449# include <stdint.h>
1450#endif
1451#include <sys/socket.h>
1452#ifdef HAVE_SYS_BITYPES_H
1453# include <sys/bitypes.h>
1454#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001455 ],
1456 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001457 [ ac_cv_have_int64_t="yes" ],
1458 [ ac_cv_have_int64_t="no" ]
1459 )
1460])
1461if test "x$ac_cv_have_int64_t" = "xyes" ; then
1462 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001463fi
1464
Damien Miller61e50f12000-05-08 20:49:37 +10001465AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1466 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001467 [ #include <sys/types.h> ],
1468 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001469 [ ac_cv_have_u_intxx_t="yes" ],
1470 [ ac_cv_have_u_intxx_t="no" ]
1471 )
1472])
1473if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1474 AC_DEFINE(HAVE_U_INTXX_T)
1475 have_u_intxx_t=1
1476fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001477
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001478if test -z "$have_u_intxx_t" ; then
1479 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1480 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001481 [ #include <sys/socket.h> ],
1482 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001483 [
1484 AC_DEFINE(HAVE_U_INTXX_T)
1485 AC_MSG_RESULT(yes)
1486 ],
1487 [ AC_MSG_RESULT(no) ]
1488 )
1489fi
1490
Damien Miller578783e2000-09-23 14:12:24 +11001491AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1492 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001493 [ #include <sys/types.h> ],
1494 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001495 [ ac_cv_have_u_int64_t="yes" ],
1496 [ ac_cv_have_u_int64_t="no" ]
1497 )
1498])
1499if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1500 AC_DEFINE(HAVE_U_INT64_T)
1501 have_u_int64_t=1
1502fi
1503
Tim Rice4cec93f2002-02-26 08:40:48 -08001504if test -z "$have_u_int64_t" ; then
1505 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1506 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001507 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001508 [ u_int64_t a; a = 1],
1509 [
1510 AC_DEFINE(HAVE_U_INT64_T)
1511 AC_MSG_RESULT(yes)
1512 ],
1513 [ AC_MSG_RESULT(no) ]
1514 )
1515fi
1516
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001517if test -z "$have_u_intxx_t" ; then
1518 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1519 AC_TRY_COMPILE(
1520 [
1521#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001522 ],
1523 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001524 [ ac_cv_have_uintxx_t="yes" ],
1525 [ ac_cv_have_uintxx_t="no" ]
1526 )
1527 ])
1528 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1529 AC_DEFINE(HAVE_UINTXX_T)
1530 fi
1531fi
1532
1533if test -z "$have_uintxx_t" ; then
1534 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1535 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001536 [ #include <stdint.h> ],
1537 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001538 [
1539 AC_DEFINE(HAVE_UINTXX_T)
1540 AC_MSG_RESULT(yes)
1541 ],
1542 [ AC_MSG_RESULT(no) ]
1543 )
1544fi
1545
Damien Milleredb82922000-06-20 13:25:52 +10001546if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001547 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001548then
1549 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1550 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001551 [
1552#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001553 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001554 [
Damien Miller70494d12000-04-03 15:57:06 +10001555 int8_t a; int16_t b; int32_t c;
1556 u_int8_t e; u_int16_t f; u_int32_t g;
1557 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001558 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001559 [
1560 AC_DEFINE(HAVE_U_INTXX_T)
1561 AC_DEFINE(HAVE_INTXX_T)
1562 AC_MSG_RESULT(yes)
1563 ],
1564 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001565 )
Damien Millerb29ea912000-01-15 14:12:03 +11001566fi
1567
Damien Miller58be7382001-09-15 21:31:54 +10001568
1569AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1570 AC_TRY_COMPILE(
1571 [
1572#include <sys/types.h>
1573 ],
1574 [ u_char foo; foo = 125; ],
1575 [ ac_cv_have_u_char="yes" ],
1576 [ ac_cv_have_u_char="no" ]
1577 )
1578])
1579if test "x$ac_cv_have_u_char" = "xyes" ; then
1580 AC_DEFINE(HAVE_U_CHAR)
1581fi
1582
Tim Rice13aae5e2001-10-21 17:53:58 -07001583TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001584
Tim Rice200a5c02002-02-26 22:12:34 -08001585AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001586
Damien Miller61e50f12000-05-08 20:49:37 +10001587AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1588 AC_TRY_COMPILE(
1589 [
1590#include <sys/types.h>
1591 ],
1592 [ size_t foo; foo = 1235; ],
1593 [ ac_cv_have_size_t="yes" ],
1594 [ ac_cv_have_size_t="no" ]
1595 )
1596])
1597if test "x$ac_cv_have_size_t" = "xyes" ; then
1598 AC_DEFINE(HAVE_SIZE_T)
1599fi
Damien Miller95058511999-12-29 10:36:45 +11001600
Damien Miller615f9392000-05-17 22:53:33 +10001601AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1602 AC_TRY_COMPILE(
1603 [
1604#include <sys/types.h>
1605 ],
1606 [ ssize_t foo; foo = 1235; ],
1607 [ ac_cv_have_ssize_t="yes" ],
1608 [ ac_cv_have_ssize_t="no" ]
1609 )
1610])
1611if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1612 AC_DEFINE(HAVE_SSIZE_T)
1613fi
1614
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001615AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1616 AC_TRY_COMPILE(
1617 [
1618#include <time.h>
1619 ],
1620 [ clock_t foo; foo = 1235; ],
1621 [ ac_cv_have_clock_t="yes" ],
1622 [ ac_cv_have_clock_t="no" ]
1623 )
1624])
1625if test "x$ac_cv_have_clock_t" = "xyes" ; then
1626 AC_DEFINE(HAVE_CLOCK_T)
1627fi
1628
Damien Millerb54b40e2000-06-23 08:23:34 +10001629AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1630 AC_TRY_COMPILE(
1631 [
1632#include <sys/types.h>
1633#include <sys/socket.h>
1634 ],
1635 [ sa_family_t foo; foo = 1235; ],
1636 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001637 [ AC_TRY_COMPILE(
1638 [
1639#include <sys/types.h>
1640#include <sys/socket.h>
1641#include <netinet/in.h>
1642 ],
1643 [ sa_family_t foo; foo = 1235; ],
1644 [ ac_cv_have_sa_family_t="yes" ],
1645
Damien Millerb54b40e2000-06-23 08:23:34 +10001646 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001647 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001648 )
1649])
1650if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1651 AC_DEFINE(HAVE_SA_FAMILY_T)
1652fi
1653
Damien Miller0f91b4e2000-06-18 15:43:25 +10001654AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1655 AC_TRY_COMPILE(
1656 [
1657#include <sys/types.h>
1658 ],
1659 [ pid_t foo; foo = 1235; ],
1660 [ ac_cv_have_pid_t="yes" ],
1661 [ ac_cv_have_pid_t="no" ]
1662 )
1663])
1664if test "x$ac_cv_have_pid_t" = "xyes" ; then
1665 AC_DEFINE(HAVE_PID_T)
1666fi
1667
1668AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1669 AC_TRY_COMPILE(
1670 [
1671#include <sys/types.h>
1672 ],
1673 [ mode_t foo; foo = 1235; ],
1674 [ ac_cv_have_mode_t="yes" ],
1675 [ ac_cv_have_mode_t="no" ]
1676 )
1677])
1678if test "x$ac_cv_have_mode_t" = "xyes" ; then
1679 AC_DEFINE(HAVE_MODE_T)
1680fi
1681
Damien Miller61e50f12000-05-08 20:49:37 +10001682
1683AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1684 AC_TRY_COMPILE(
1685 [
Damien Miller81171112000-04-23 11:14:01 +10001686#include <sys/types.h>
1687#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001688 ],
1689 [ struct sockaddr_storage s; ],
1690 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1691 [ ac_cv_have_struct_sockaddr_storage="no" ]
1692 )
1693])
1694if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1695 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1696fi
Damien Miller34132e52000-01-14 15:45:46 +11001697
Damien Miller61e50f12000-05-08 20:49:37 +10001698AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1699 AC_TRY_COMPILE(
1700 [
Damien Miller7b22d652000-06-18 14:07:04 +10001701#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001702#include <netinet/in.h>
1703 ],
1704 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1705 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1706 [ ac_cv_have_struct_sockaddr_in6="no" ]
1707 )
1708])
1709if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1710 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1711fi
Damien Miller34132e52000-01-14 15:45:46 +11001712
Damien Miller61e50f12000-05-08 20:49:37 +10001713AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1714 AC_TRY_COMPILE(
1715 [
Damien Miller7b22d652000-06-18 14:07:04 +10001716#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001717#include <netinet/in.h>
1718 ],
1719 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1720 [ ac_cv_have_struct_in6_addr="yes" ],
1721 [ ac_cv_have_struct_in6_addr="no" ]
1722 )
1723])
1724if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1725 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1726fi
Damien Miller34132e52000-01-14 15:45:46 +11001727
Damien Miller61e50f12000-05-08 20:49:37 +10001728AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1729 AC_TRY_COMPILE(
1730 [
Damien Miller81171112000-04-23 11:14:01 +10001731#include <sys/types.h>
1732#include <sys/socket.h>
1733#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001734 ],
1735 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1736 [ ac_cv_have_struct_addrinfo="yes" ],
1737 [ ac_cv_have_struct_addrinfo="no" ]
1738 )
1739])
1740if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1741 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1742fi
1743
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001744AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1745 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001746 [ #include <sys/time.h> ],
1747 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001748 [ ac_cv_have_struct_timeval="yes" ],
1749 [ ac_cv_have_struct_timeval="no" ]
1750 )
1751])
1752if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1753 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1754 have_struct_timeval=1
1755fi
1756
Tim Rice4e4dc562003-03-18 10:21:40 -08001757AC_CHECK_TYPES(struct timespec)
1758
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001759# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001760if test "x$ac_cv_have_int64_t" = "xno" -a \
1761 "x$ac_cv_sizeof_long_int" != "x8" -a \
1762 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001763 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1764 echo "an alternative compiler (I.E., GCC) before continuing."
1765 echo ""
1766 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001767else
1768dnl test snprintf (broken on SCO w/gcc)
1769 AC_TRY_RUN(
1770 [
1771#include <stdio.h>
1772#include <string.h>
1773#ifdef HAVE_SNPRINTF
1774main()
1775{
1776 char buf[50];
1777 char expected_out[50];
1778 int mazsize = 50 ;
1779#if (SIZEOF_LONG_INT == 8)
1780 long int num = 0x7fffffffffffffff;
1781#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001782 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001783#endif
1784 strcpy(expected_out, "9223372036854775807");
1785 snprintf(buf, mazsize, "%lld", num);
1786 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001787 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001788 exit(0);
1789}
1790#else
1791main() { exit(0); }
1792#endif
1793 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1794 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001795fi
1796
Damien Miller78315eb2000-09-29 23:01:36 +11001797dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001798OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1799OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1800OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1801OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1802OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001803OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001804OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1805OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001806OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001807OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1808OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1809OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1810OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001811OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1812OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1813OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1814OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001815
1816AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001817
Damien Miller61e50f12000-05-08 20:49:37 +10001818AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1819 ac_cv_have_ss_family_in_struct_ss, [
1820 AC_TRY_COMPILE(
1821 [
Damien Miller81171112000-04-23 11:14:01 +10001822#include <sys/types.h>
1823#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001824 ],
1825 [ struct sockaddr_storage s; s.ss_family = 1; ],
1826 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1827 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1828 )
1829])
1830if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1831 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1832fi
1833
Damien Miller61e50f12000-05-08 20:49:37 +10001834AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1835 ac_cv_have___ss_family_in_struct_ss, [
1836 AC_TRY_COMPILE(
1837 [
Damien Miller81171112000-04-23 11:14:01 +10001838#include <sys/types.h>
1839#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001840 ],
1841 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1842 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1843 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1844 )
1845])
1846if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1847 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1848fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001849
Damien Millerad833b32000-08-23 10:46:23 +10001850AC_CACHE_CHECK([for pw_class field in struct passwd],
1851 ac_cv_have_pw_class_in_struct_passwd, [
1852 AC_TRY_COMPILE(
1853 [
Damien Millerad833b32000-08-23 10:46:23 +10001854#include <pwd.h>
1855 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001856 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001857 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1858 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1859 )
1860])
1861if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1862 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1863fi
1864
Kevin Steves82456952001-06-22 21:14:18 +00001865AC_CACHE_CHECK([for pw_expire field in struct passwd],
1866 ac_cv_have_pw_expire_in_struct_passwd, [
1867 AC_TRY_COMPILE(
1868 [
1869#include <pwd.h>
1870 ],
1871 [ struct passwd p; p.pw_expire = 0; ],
1872 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1873 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1874 )
1875])
1876if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1877 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1878fi
1879
1880AC_CACHE_CHECK([for pw_change field in struct passwd],
1881 ac_cv_have_pw_change_in_struct_passwd, [
1882 AC_TRY_COMPILE(
1883 [
1884#include <pwd.h>
1885 ],
1886 [ struct passwd p; p.pw_change = 0; ],
1887 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1888 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1889 )
1890])
1891if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1892 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1893fi
Damien Miller61e50f12000-05-08 20:49:37 +10001894
Tim Rice28bbb0c2002-05-27 17:37:32 -07001895dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001896AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1897 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001898 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001899 [
Tim Riceae49fe62002-04-12 10:26:21 -07001900#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001901#include <sys/socket.h>
1902#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001903int main() {
1904#ifdef msg_accrights
1905exit(1);
1906#endif
1907struct msghdr m;
1908m.msg_accrights = 0;
1909exit(0);
1910}
Kevin Steves939c9db2002-03-22 17:23:25 +00001911 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001912 [ ac_cv_have_accrights_in_msghdr="yes" ],
1913 [ ac_cv_have_accrights_in_msghdr="no" ]
1914 )
1915])
1916if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1917 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1918fi
1919
Kevin Stevesa44e0352002-04-07 16:18:03 +00001920AC_CACHE_CHECK([for msg_control field in struct msghdr],
1921 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001922 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001923 [
Tim Riceae49fe62002-04-12 10:26:21 -07001924#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001925#include <sys/socket.h>
1926#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001927int main() {
1928#ifdef msg_control
1929exit(1);
1930#endif
1931struct msghdr m;
1932m.msg_control = 0;
1933exit(0);
1934}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001935 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001936 [ ac_cv_have_control_in_msghdr="yes" ],
1937 [ ac_cv_have_control_in_msghdr="no" ]
1938 )
1939])
1940if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1941 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1942fi
1943
Damien Miller61e50f12000-05-08 20:49:37 +10001944AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001945 AC_TRY_LINK([],
1946 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001947 [ ac_cv_libc_defines___progname="yes" ],
1948 [ ac_cv_libc_defines___progname="no" ]
1949 )
1950])
1951if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1952 AC_DEFINE(HAVE___PROGNAME)
1953fi
1954
Kevin Steves4846f4a2002-03-22 18:19:53 +00001955AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1956 AC_TRY_LINK([
1957#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001958],
1959 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001960 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1961 [ ac_cv_cc_implements___FUNCTION__="no" ]
1962 )
1963])
1964if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1965 AC_DEFINE(HAVE___FUNCTION__)
1966fi
1967
1968AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1969 AC_TRY_LINK([
1970#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001971],
1972 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001973 [ ac_cv_cc_implements___func__="yes" ],
1974 [ ac_cv_cc_implements___func__="no" ]
1975 )
1976])
1977if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1978 AC_DEFINE(HAVE___func__)
1979fi
1980
Damien Miller4f8e6692001-07-14 13:22:53 +10001981AC_CACHE_CHECK([whether getopt has optreset support],
1982 ac_cv_have_getopt_optreset, [
1983 AC_TRY_LINK(
1984 [
1985#include <getopt.h>
1986 ],
1987 [ extern int optreset; optreset = 0; ],
1988 [ ac_cv_have_getopt_optreset="yes" ],
1989 [ ac_cv_have_getopt_optreset="no" ]
1990 )
1991])
1992if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1993 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1994fi
Damien Millera22ba012000-03-02 23:09:20 +11001995
Damien Millerecbb26d2000-07-15 14:59:14 +10001996AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001997 AC_TRY_LINK([],
1998 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001999 [ ac_cv_libc_defines_sys_errlist="yes" ],
2000 [ ac_cv_libc_defines_sys_errlist="no" ]
2001 )
2002])
2003if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2004 AC_DEFINE(HAVE_SYS_ERRLIST)
2005fi
2006
2007
Damien Miller11fa2cc2000-08-16 10:35:58 +10002008AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002009 AC_TRY_LINK([],
2010 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002011 [ ac_cv_libc_defines_sys_nerr="yes" ],
2012 [ ac_cv_libc_defines_sys_nerr="no" ]
2013 )
2014])
2015if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2016 AC_DEFINE(HAVE_SYS_NERR)
2017fi
2018
Damien Millera8e06ce2003-11-21 23:48:55 +11002019SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002020# Check whether user wants sectok support
2021AC_ARG_WITH(sectok,
2022 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002023 [
2024 if test "x$withval" != "xno" ; then
2025 if test "x$withval" != "xyes" ; then
2026 CPPFLAGS="$CPPFLAGS -I${withval}"
2027 LDFLAGS="$LDFLAGS -L${withval}"
2028 if test ! -z "$need_dash_r" ; then
2029 LDFLAGS="$LDFLAGS -R${withval}"
2030 fi
2031 if test ! -z "$blibpath" ; then
2032 blibpath="$blibpath:${withval}"
2033 fi
2034 fi
2035 AC_CHECK_HEADERS(sectok.h)
2036 if test "$ac_cv_header_sectok_h" != yes; then
2037 AC_MSG_ERROR(Can't find sectok.h)
2038 fi
2039 AC_CHECK_LIB(sectok, sectok_open)
2040 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2041 AC_MSG_ERROR(Can't find libsectok)
2042 fi
2043 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002044 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002045 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002046 fi
2047 ]
2048)
2049
2050# Check whether user wants OpenSC support
2051AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002052 AC_HELP_STRING([--with-opensc=PFX],
2053 [Enable smartcard support using OpenSC]),
2054 opensc_config_prefix="$withval", opensc_config_prefix="")
2055if test x$opensc_config_prefix != x ; then
2056 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2057 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2058 if test "$OPENSC_CONFIG" != "no"; then
2059 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2060 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2061 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2062 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2063 AC_DEFINE(SMARTCARD)
2064 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002065 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002066 fi
2067fi
Damien Miller85de5802001-09-18 14:01:11 +10002068
Darren Tucker5f88d342003-10-15 16:57:57 +10002069# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002070AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002071 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002072 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002073 # Needed by our getrrsetbyname()
2074 AC_SEARCH_LIBS(res_query, resolv)
2075 AC_SEARCH_LIBS(dn_expand, resolv)
2076 AC_CHECK_FUNCS(_getshort _getlong)
2077 AC_CHECK_MEMBER(HEADER.ad,
2078 [AC_DEFINE(HAVE_HEADER_AD)],,
2079 [#include <arpa/nameser.h>])
2080 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002081
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002082# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002083KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002084AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002085 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002086 [ if test "x$withval" != "xno" ; then
2087 if test "x$withval" = "xyes" ; then
2088 KRB5ROOT="/usr/local"
2089 else
2090 KRB5ROOT=${withval}
2091 fi
2092
2093 AC_DEFINE(KRB5)
2094 KRB5_MSG="yes"
2095
2096 AC_MSG_CHECKING(for krb5-config)
2097 if test -x $KRB5ROOT/bin/krb5-config ; then
2098 KRB5CONF=$KRB5ROOT/bin/krb5-config
2099 AC_MSG_RESULT($KRB5CONF)
2100
2101 AC_MSG_CHECKING(for gssapi support)
2102 if $KRB5CONF | grep gssapi >/dev/null ; then
2103 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002104 AC_DEFINE(GSSAPI)
2105 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002106 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002107 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002108 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002109 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002110 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2111 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002112 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002113 AC_MSG_CHECKING(whether we are using Heimdal)
2114 AC_TRY_COMPILE([ #include <krb5.h> ],
2115 [ char *tmp = heimdal_version; ],
2116 [ AC_MSG_RESULT(yes)
2117 AC_DEFINE(HEIMDAL) ],
2118 AC_MSG_RESULT(no)
2119 )
2120 else
2121 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002122 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002123 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002124 AC_MSG_CHECKING(whether we are using Heimdal)
2125 AC_TRY_COMPILE([ #include <krb5.h> ],
2126 [ char *tmp = heimdal_version; ],
2127 [ AC_MSG_RESULT(yes)
2128 AC_DEFINE(HEIMDAL)
2129 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2130 ],
2131 [ AC_MSG_RESULT(no)
2132 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2133 ]
2134 )
Damien Miller200d0a72003-06-30 19:21:36 +10002135 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002136
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002137 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2138 [ AC_DEFINE(GSSAPI)
2139 K5LIBS="-lgssapi $K5LIBS" ],
2140 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2141 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002142 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002143 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2144 $K5LIBS)
2145 ],
2146 $K5LIBS)
2147
2148 AC_CHECK_HEADER(gssapi.h, ,
2149 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002150 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002151 AC_CHECK_HEADERS(gssapi.h, ,
2152 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002153 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002154 ]
2155 )
2156
2157 oldCPP="$CPPFLAGS"
2158 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2159 AC_CHECK_HEADER(gssapi_krb5.h, ,
2160 [ CPPFLAGS="$oldCPP" ])
2161
Damien Millera8e06ce2003-11-21 23:48:55 +11002162 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002163 if test ! -z "$need_dash_r" ; then
2164 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2165 fi
2166 if test ! -z "$blibpath" ; then
2167 blibpath="$blibpath:${KRB5ROOT}/lib"
2168 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002169 fi
2170
2171 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2172 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2173 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2174
2175 LIBS="$LIBS $K5LIBS"
2176 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
2177 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002178)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002179
Damien Millera22ba012000-03-02 23:09:20 +11002180# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002181
Damien Millerf58c6722002-05-13 13:15:42 +10002182PRIVSEP_PATH=/var/empty
2183AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002184 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002185 [
2186 if test "x$withval" != "$no" ; then
2187 PRIVSEP_PATH=$withval
2188 fi
2189 ]
2190)
2191AC_SUBST(PRIVSEP_PATH)
2192
Damien Millera22ba012000-03-02 23:09:20 +11002193AC_ARG_WITH(xauth,
2194 [ --with-xauth=PATH Specify path to xauth program ],
2195 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002196 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002197 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002198 fi
2199 ],
2200 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002201 TestPath="$PATH"
2202 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2203 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2204 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2205 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2206 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002207 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002208 xauth_path="/usr/openwin/bin/xauth"
2209 fi
2210 ]
2211)
2212
Damien Miller7d901272003-01-13 16:55:22 +11002213STRIP_OPT=-s
2214AC_ARG_ENABLE(strip,
2215 [ --disable-strip Disable calling strip(1) on install],
2216 [
2217 if test "x$enableval" = "xno" ; then
2218 STRIP_OPT=
2219 fi
2220 ]
2221)
2222AC_SUBST(STRIP_OPT)
2223
Damien Millera19cf472000-11-29 13:28:50 +11002224if test -z "$xauth_path" ; then
2225 XAUTH_PATH="undefined"
2226 AC_SUBST(XAUTH_PATH)
2227else
Damien Millera22ba012000-03-02 23:09:20 +11002228 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002229 XAUTH_PATH=$xauth_path
2230 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002231fi
Damien Millera22ba012000-03-02 23:09:20 +11002232
2233# Check for mail directory (last resort if we cannot get it from headers)
2234if test ! -z "$MAIL" ; then
2235 maildir=`dirname $MAIL`
2236 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2237fi
2238
Damien Millera22ba012000-03-02 23:09:20 +11002239if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002240 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002241 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002242 [
2243 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2244 have_dev_ptmx=1
2245 ]
2246 )
2247 fi
Damien Millera22ba012000-03-02 23:09:20 +11002248fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002249AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002250 [
2251 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2252 have_dev_ptc=1
2253 ]
2254)
2255
Damien Millera22ba012000-03-02 23:09:20 +11002256# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002257AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002258 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002259 [
Damien Miller897741e2001-04-16 10:41:46 +10002260 case "$withval" in
2261 man|cat|doc)
2262 MANTYPE=$withval
2263 ;;
2264 *)
2265 AC_MSG_ERROR(invalid man type: $withval)
2266 ;;
2267 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002268 ]
2269)
Ben Lindstrombc709922001-04-18 18:04:21 +00002270if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002271 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2272 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002273 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2274 MANTYPE=doc
2275 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2276 MANTYPE=man
2277 else
2278 MANTYPE=cat
2279 fi
2280fi
Damien Miller670a4b82000-01-22 13:53:11 +11002281AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002282if test "$MANTYPE" = "doc"; then
2283 mansubdir=man;
2284else
2285 mansubdir=$MANTYPE;
2286fi
2287AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002288
Damien Millera22ba012000-03-02 23:09:20 +11002289# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002290MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002291AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002292 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002293 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002294 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002295 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002296 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002297 fi
2298 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002299)
2300
Damien Millera22ba012000-03-02 23:09:20 +11002301# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002302AC_ARG_WITH(shadow,
2303 [ --without-shadow Disable shadow password support],
2304 [
2305 if test "x$withval" = "xno" ; then
2306 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002307 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002308 fi
2309 ]
2310)
2311
Damien Miller1f335fb2000-06-26 11:31:33 +10002312if test -z "$disable_shadow" ; then
2313 AC_MSG_CHECKING([if the systems has expire shadow information])
2314 AC_TRY_COMPILE(
2315 [
2316#include <sys/types.h>
2317#include <shadow.h>
2318 struct spwd sp;
2319 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2320 [ sp_expire_available=yes ], []
2321 )
2322
2323 if test "x$sp_expire_available" = "xyes" ; then
2324 AC_MSG_RESULT(yes)
2325 AC_DEFINE(HAS_SHADOW_EXPIRE)
2326 else
2327 AC_MSG_RESULT(no)
2328 fi
2329fi
2330
Damien Millera22ba012000-03-02 23:09:20 +11002331# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002332if test ! -z "$IPADDR_IN_DISPLAY" ; then
2333 DISPLAY_HACK_MSG="yes"
2334 AC_DEFINE(IPADDR_IN_DISPLAY)
2335else
Damien Millera8e06ce2003-11-21 23:48:55 +11002336 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002337 AC_ARG_WITH(ipaddr-display,
2338 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2339 [
2340 if test "x$withval" != "xno" ; then
2341 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002342 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002343 fi
2344 ]
2345 )
2346fi
Damien Miller76112de1999-12-21 11:18:08 +11002347
Darren Tuckere1a790d2003-09-16 11:52:19 +10002348# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002349AC_ARG_ENABLE(etc-default-login,
2350 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2351[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002352AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2353
2354if test "x$external_path_file" = "x/etc/default/login"; then
2355 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2356fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002357])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002358
Tim Rice43a1c132002-04-17 21:19:14 -07002359dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2360if test $ac_cv_func_login_getcapbool = "yes" -a \
2361 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002362 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002363fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002364
Damien Millera22ba012000-03-02 23:09:20 +11002365# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002366SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002367AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002368 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002369 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002370 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002371 AC_MSG_WARN([
2372--with-default-path=PATH has no effect on this system.
2373Edit /etc/login.conf instead.])
2374 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002375 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002376 AC_MSG_WARN([
2377--with-default-path=PATH will only be used if PATH is not defined in
2378$external_path_file .])
2379 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002380 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002381 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002382 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002383 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002384 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2385 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002386 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002387 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002388 AC_MSG_WARN([
2389If PATH is defined in $external_path_file, ensure the path to scp is included,
2390otherwise scp will not work.])
2391 fi
2392 AC_TRY_RUN(
2393 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002394/* find out what STDPATH is */
2395#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002396#ifdef HAVE_PATHS_H
2397# include <paths.h>
2398#endif
2399#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002400# ifdef _PATH_USERPATH /* Irix */
2401# define _PATH_STDPATH _PATH_USERPATH
2402# else
2403# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2404# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002405#endif
2406#include <sys/types.h>
2407#include <sys/stat.h>
2408#include <fcntl.h>
2409#define DATA "conftest.stdpath"
2410
2411main()
2412{
2413 FILE *fd;
2414 int rc;
2415
2416 fd = fopen(DATA,"w");
2417 if(fd == NULL)
2418 exit(1);
2419
2420 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2421 exit(1);
2422
2423 exit(0);
2424}
2425 ], [ user_path=`cat conftest.stdpath` ],
2426 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2427 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2428 )
2429# make sure $bindir is in USER_PATH so scp will work
2430 t_bindir=`eval echo ${bindir}`
2431 case $t_bindir in
2432 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2433 esac
2434 case $t_bindir in
2435 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2436 esac
2437 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2438 if test $? -ne 0 ; then
2439 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2440 if test $? -ne 0 ; then
2441 user_path=$user_path:$t_bindir
2442 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2443 fi
2444 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002445 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002446)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002447if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002448 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2449 AC_SUBST(user_path)
2450fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002451
Damien Millera18bbd32002-05-13 10:48:57 +10002452# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002453AC_ARG_WITH(superuser-path,
2454 [ --with-superuser-path= Specify different path for super-user],
2455 [
2456 if test "x$withval" != "xno" ; then
2457 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2458 superuser_path=$withval
2459 fi
2460 ]
2461)
2462
2463
Damien Miller61e50f12000-05-08 20:49:37 +10002464AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002465IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002466AC_ARG_WITH(4in6,
2467 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2468 [
2469 if test "x$withval" != "xno" ; then
2470 AC_MSG_RESULT(yes)
2471 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002472 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002473 else
2474 AC_MSG_RESULT(no)
2475 fi
2476 ],[
2477 if test "x$inet6_default_4in6" = "xyes"; then
2478 AC_MSG_RESULT([yes (default)])
2479 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002480 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002481 else
2482 AC_MSG_RESULT([no (default)])
2483 fi
2484 ]
2485)
2486
Damien Miller60396b02001-02-18 17:01:00 +11002487# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002488BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002489AC_ARG_WITH(bsd-auth,
2490 [ --with-bsd-auth Enable BSD auth support],
2491 [
2492 if test "x$withval" != "xno" ; then
2493 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002494 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002495 fi
2496 ]
2497)
2498
Damien Millera22ba012000-03-02 23:09:20 +11002499# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002500piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002501# make sure the directory exists
2502if test ! -d $piddir ; then
2503 piddir=`eval echo ${sysconfdir}`
2504 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002505 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002506 esac
2507fi
2508
Tim Rice88f2ab52002-03-17 12:17:34 -08002509AC_ARG_WITH(pid-dir,
2510 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2511 [
2512 if test "x$withval" != "xno" ; then
2513 piddir=$withval
2514 if test ! -d $piddir ; then
2515 AC_MSG_WARN([** no $piddir directory on this system **])
2516 fi
2517 fi
2518 ]
2519)
2520
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002521AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002522AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002523
andre2ff7b5d2000-06-03 14:57:40 +00002524dnl allow user to disable some login recording features
2525AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002526 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002527 [
2528 if test "x$enableval" = "xno" ; then
2529 AC_DEFINE(DISABLE_LASTLOG)
2530 fi
2531 ]
andre2ff7b5d2000-06-03 14:57:40 +00002532)
2533AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002534 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002535 [
2536 if test "x$enableval" = "xno" ; then
2537 AC_DEFINE(DISABLE_UTMP)
2538 fi
2539 ]
andre2ff7b5d2000-06-03 14:57:40 +00002540)
2541AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002542 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002543 [
2544 if test "x$enableval" = "xno" ; then
2545 AC_DEFINE(DISABLE_UTMPX)
2546 fi
2547 ]
andre2ff7b5d2000-06-03 14:57:40 +00002548)
2549AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002550 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002551 [
2552 if test "x$enableval" = "xno" ; then
2553 AC_DEFINE(DISABLE_WTMP)
2554 fi
2555 ]
andre2ff7b5d2000-06-03 14:57:40 +00002556)
2557AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002558 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002559 [
2560 if test "x$enableval" = "xno" ; then
2561 AC_DEFINE(DISABLE_WTMPX)
2562 fi
2563 ]
andre2ff7b5d2000-06-03 14:57:40 +00002564)
2565AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002566 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002567 [
2568 if test "x$enableval" = "xno" ; then
2569 AC_DEFINE(DISABLE_LOGIN)
2570 fi
2571 ]
andre2ff7b5d2000-06-03 14:57:40 +00002572)
2573AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002574 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002575 [
2576 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002577 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002578 fi
2579 ]
andre2ff7b5d2000-06-03 14:57:40 +00002580)
2581AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002582 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002583 [
2584 if test "x$enableval" = "xno" ; then
2585 AC_DEFINE(DISABLE_PUTUTXLINE)
2586 fi
2587 ]
andre2ff7b5d2000-06-03 14:57:40 +00002588)
2589AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002590 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002591 [
2592 if test "x$withval" = "xno" ; then
2593 AC_DEFINE(DISABLE_LASTLOG)
2594 else
2595 conf_lastlog_location=$withval
2596 fi
2597 ]
2598)
andre2ff7b5d2000-06-03 14:57:40 +00002599
2600dnl lastlog, [uw]tmpx? detection
2601dnl NOTE: set the paths in the platform section to avoid the
2602dnl need for command-line parameters
2603dnl lastlog and [uw]tmp are subject to a file search if all else fails
2604
2605dnl lastlog detection
2606dnl NOTE: the code itself will detect if lastlog is a directory
2607AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2608AC_TRY_COMPILE([
2609#include <sys/types.h>
2610#include <utmp.h>
2611#ifdef HAVE_LASTLOG_H
2612# include <lastlog.h>
2613#endif
Damien Miller2994e082000-06-04 15:51:47 +10002614#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002615# include <paths.h>
2616#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002617#ifdef HAVE_LOGIN_H
2618# include <login.h>
2619#endif
andre2ff7b5d2000-06-03 14:57:40 +00002620 ],
2621 [ char *lastlog = LASTLOG_FILE; ],
2622 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002623 [
2624 AC_MSG_RESULT(no)
2625 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2626 AC_TRY_COMPILE([
2627#include <sys/types.h>
2628#include <utmp.h>
2629#ifdef HAVE_LASTLOG_H
2630# include <lastlog.h>
2631#endif
2632#ifdef HAVE_PATHS_H
2633# include <paths.h>
2634#endif
2635 ],
2636 [ char *lastlog = _PATH_LASTLOG; ],
2637 [ AC_MSG_RESULT(yes) ],
2638 [
andree441aa32000-06-12 22:34:38 +00002639 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002640 system_lastlog_path=no
2641 ])
2642 ]
andre2ff7b5d2000-06-03 14:57:40 +00002643)
Damien Miller2994e082000-06-04 15:51:47 +10002644
andre2ff7b5d2000-06-03 14:57:40 +00002645if test -z "$conf_lastlog_location"; then
2646 if test x"$system_lastlog_path" = x"no" ; then
2647 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002648 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002649 conf_lastlog_location=$f
2650 fi
2651 done
2652 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002653 AC_MSG_WARN([** Cannot find lastlog **])
2654 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002655 fi
2656 fi
2657fi
2658
2659if test -n "$conf_lastlog_location"; then
2660 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2661fi
2662
2663dnl utmp detection
2664AC_MSG_CHECKING([if your system defines UTMP_FILE])
2665AC_TRY_COMPILE([
2666#include <sys/types.h>
2667#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002668#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002669# include <paths.h>
2670#endif
2671 ],
2672 [ char *utmp = UTMP_FILE; ],
2673 [ AC_MSG_RESULT(yes) ],
2674 [ AC_MSG_RESULT(no)
2675 system_utmp_path=no ]
2676)
2677if test -z "$conf_utmp_location"; then
2678 if test x"$system_utmp_path" = x"no" ; then
2679 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2680 if test -f $f ; then
2681 conf_utmp_location=$f
2682 fi
2683 done
2684 if test -z "$conf_utmp_location"; then
2685 AC_DEFINE(DISABLE_UTMP)
2686 fi
2687 fi
2688fi
2689if test -n "$conf_utmp_location"; then
2690 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2691fi
2692
2693dnl wtmp detection
2694AC_MSG_CHECKING([if your system defines WTMP_FILE])
2695AC_TRY_COMPILE([
2696#include <sys/types.h>
2697#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002698#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002699# include <paths.h>
2700#endif
2701 ],
2702 [ char *wtmp = WTMP_FILE; ],
2703 [ AC_MSG_RESULT(yes) ],
2704 [ AC_MSG_RESULT(no)
2705 system_wtmp_path=no ]
2706)
2707if test -z "$conf_wtmp_location"; then
2708 if test x"$system_wtmp_path" = x"no" ; then
2709 for f in /usr/adm/wtmp /var/log/wtmp; do
2710 if test -f $f ; then
2711 conf_wtmp_location=$f
2712 fi
2713 done
2714 if test -z "$conf_wtmp_location"; then
2715 AC_DEFINE(DISABLE_WTMP)
2716 fi
2717 fi
2718fi
2719if test -n "$conf_wtmp_location"; then
2720 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2721fi
2722
2723
2724dnl utmpx detection - I don't know any system so perverse as to require
2725dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2726dnl there, though.
2727AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2728AC_TRY_COMPILE([
2729#include <sys/types.h>
2730#include <utmp.h>
2731#ifdef HAVE_UTMPX_H
2732#include <utmpx.h>
2733#endif
Damien Miller2994e082000-06-04 15:51:47 +10002734#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002735# include <paths.h>
2736#endif
2737 ],
2738 [ char *utmpx = UTMPX_FILE; ],
2739 [ AC_MSG_RESULT(yes) ],
2740 [ AC_MSG_RESULT(no)
2741 system_utmpx_path=no ]
2742)
2743if test -z "$conf_utmpx_location"; then
2744 if test x"$system_utmpx_path" = x"no" ; then
2745 AC_DEFINE(DISABLE_UTMPX)
2746 fi
2747else
2748 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2749fi
2750
2751dnl wtmpx detection
2752AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2753AC_TRY_COMPILE([
2754#include <sys/types.h>
2755#include <utmp.h>
2756#ifdef HAVE_UTMPX_H
2757#include <utmpx.h>
2758#endif
Damien Miller2994e082000-06-04 15:51:47 +10002759#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002760# include <paths.h>
2761#endif
2762 ],
2763 [ char *wtmpx = WTMPX_FILE; ],
2764 [ AC_MSG_RESULT(yes) ],
2765 [ AC_MSG_RESULT(no)
2766 system_wtmpx_path=no ]
2767)
2768if test -z "$conf_wtmpx_location"; then
2769 if test x"$system_wtmpx_path" = x"no" ; then
2770 AC_DEFINE(DISABLE_WTMPX)
2771 fi
2772else
2773 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2774fi
2775
Damien Miller4018c192000-04-30 09:30:44 +10002776
Damien Miller29ea30d2000-03-17 10:54:15 +11002777if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002778 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2779 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002780fi
2781
Tim Rice4cec93f2002-02-26 08:40:48 -08002782dnl remove pam and dl because they are in $LIBPAM
2783if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002784 LIBS=`echo $LIBS | sed 's/-lpam //'`
2785fi
2786if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2787 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002788fi
2789
Damien Millerbac2d8a2000-09-05 16:13:06 +11002790AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002791AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2792AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002793
Damien Miller7b22d652000-06-18 14:07:04 +10002794# Print summary of options
2795
Damien Miller7b22d652000-06-18 14:07:04 +10002796# Someone please show me a better way :)
2797A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2798B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2799C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2800D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002801E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002802F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002803G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002804H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2805I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2806J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002807
2808echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002809echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002810echo " User binaries: $B"
2811echo " System binaries: $C"
2812echo " Configuration files: $D"
2813echo " Askpass program: $E"
2814echo " Manual pages: $F"
2815echo " PID file: $G"
2816echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002817if test "x$external_path_file" = "x/etc/login.conf" ; then
2818echo " At runtime, sshd will use the path defined in $external_path_file"
2819echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002820else
Damien Millerf58c6722002-05-13 13:15:42 +10002821echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002822 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002823echo " (If PATH is set in $external_path_file it will be used instead. If"
2824echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2825 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002826fi
Damien Millera18bbd32002-05-13 10:48:57 +10002827if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002828echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002829fi
Damien Millerf58c6722002-05-13 13:15:42 +10002830echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002831echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002832echo " KerberosV support: $KRB5_MSG"
2833echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002834echo " S/KEY support: $SKEY_MSG"
2835echo " TCP Wrappers support: $TCPW_MSG"
2836echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002837echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002838echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2839echo " BSD Auth support: $BSD_AUTH_MSG"
2840echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002841if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002842echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002843fi
2844
Damien Miller7b22d652000-06-18 14:07:04 +10002845echo ""
2846
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002847echo " Host: ${host}"
2848echo " Compiler: ${CC}"
2849echo " Compiler flags: ${CFLAGS}"
2850echo "Preprocessor flags: ${CPPFLAGS}"
2851echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002852echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002853
2854echo ""
2855
Damien Miller82cf0ce2000-12-20 13:34:48 +11002856if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002857 echo "PAM is enabled. You may need to install a PAM control file "
2858 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002859 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002860 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002861 echo ""
2862fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002863
Damien Miller6c21c512002-01-22 21:57:53 +11002864if test ! -z "$RAND_HELPER_CMDHASH" ; then
2865 echo "WARNING: you are using the builtin random number collection "
2866 echo "service. Please read WARNING.RNG and request that your OS "
2867 echo "vendor includes kernel-based random number collection in "
2868 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002869 echo ""
2870fi
Damien Miller60396b02001-02-18 17:01:00 +11002871