blob: c037ee7c83cdb73156ea88b6551e4863b23b6199 [file] [log] [blame]
Darren Tuckerdcc736b2004-01-30 14:20:59 +11001# $Id: configure.ac,v 1.190 2004/01/30 03:20:59 dtucker Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100012AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110013AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100014AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110015AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000016AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070017AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080018AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110019AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100020AC_PATH_PROG(ENT, ent)
21AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110022AC_PATH_PROG(TEST_MINUS_S_SH, bash)
23AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
24AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070025AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110026
Damien Millere8bb4502001-09-25 16:39:35 +100027# System features
28AC_SYS_LARGEFILE
29
Damien Miller3f62aba2000-11-29 11:56:35 +110030if test -z "$AR" ; then
31 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32fi
33
Damien Millerad833b32000-08-23 10:46:23 +100034# Use LOGIN_PROGRAM from environment if possible
35if test ! -z "$LOGIN_PROGRAM" ; then
36 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37else
38 # Search for login
39 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
40 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
41 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
42 fi
43fi
44
Damien Miller166bd442000-03-16 10:48:25 +110045if test -z "$LD" ; then
46 LD=$CC
47fi
48AC_SUBST(LD)
49
Damien Miller166bd442000-03-16 10:48:25 +110050AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110051if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100052 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110053fi
54
Tim Rice88368a32003-12-08 12:35:59 -080055AC_ARG_WITH(rpath,
56 [ --without-rpath Disable auto-added -R linker paths],
57 [
58 if test "x$withval" = "xno" ; then
59 need_dash_r=""
60 fi
61 if test "x$withval" = "xyes" ; then
62 need_dash_r=1
63 fi
64 ]
65)
66
Damien Millera22ba012000-03-02 23:09:20 +110067# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110068case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110069*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110070 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +100071 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -080072 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110073 fi
Damien Millereab4bae2003-04-29 23:22:40 +100074 saved_LDFLAGS="$LDFLAGS"
75 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
76 if (test -z "$blibflags"); then
77 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
78 AC_TRY_LINK([], [], [blibflags=$tryflags])
79 fi
80 done
81 if (test -z "$blibflags"); then
82 AC_MSG_RESULT(not found)
83 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
84 else
85 AC_MSG_RESULT($blibflags)
86 fi
87 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100088 dnl Check for authenticate. Might be in libs.a on older AIXes
89 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070090 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100091 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070092 LIBS="$LIBS -ls"
93 ])
94 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +100095 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
96 AC_CHECK_DECL(loginfailed,
97 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
98 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +100099 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000100 [(void)loginfailed("user","host","tty",0);],
101 [AC_MSG_RESULT(yes)
102 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000103 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000104 )],
105 [],
106 [#include <usersec.h>]
107 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000108 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +1100109 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000110 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000111 AC_DEFINE(SETEUID_BREAKS_SETUID)
112 AC_DEFINE(BROKEN_SETREUID)
113 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000114 dnl AIX handles lastlog as part of its login message
115 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000116 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000117 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100118 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100119*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100120 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800121 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100122 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000123 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100124 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100125 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000126 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000127 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700128 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000129 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100130 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000131*-*-dgux*)
132 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100133 AC_DEFINE(SETEUID_BREAKS_SETUID)
134 AC_DEFINE(BROKEN_SETREUID)
135 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000136 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000137*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000138 AC_MSG_CHECKING(if we have working getaddrinfo)
139 AC_TRY_RUN([#include <mach-o/dyld.h>
140main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
141 exit(0);
142 else
143 exit(1);
144}], [AC_MSG_RESULT(working)],
145 [AC_MSG_RESULT(buggy)
146 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700147 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000148 AC_DEFINE(SETEUID_BREAKS_SETUID)
149 AC_DEFINE(BROKEN_SETREUID)
150 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100151 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000152 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000153*-*-hpux10.26)
154 if test -z "$GCC"; then
155 CFLAGS="$CFLAGS -Ae"
156 fi
157 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
158 IPADDR_IN_DISPLAY=yes
159 AC_DEFINE(HAVE_SECUREWARE)
160 AC_DEFINE(USE_PIPES)
161 AC_DEFINE(LOGIN_NO_ENDOPT)
162 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000163 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000164 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000165 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700166 LIBS="$LIBS -lsec -lsecpw"
167 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000168 disable_ptmx_check=yes
169 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100170*-*-hpux10*)
171 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000172 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100173 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000174 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100175 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000176 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000177 AC_DEFINE(LOGIN_NO_ENDOPT)
178 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100179 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000180 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000181 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700182 LIBS="$LIBS -lsec"
183 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100184 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000185*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000186 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100187 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100188 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100189 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000190 AC_DEFINE(LOGIN_NO_ENDOPT)
191 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100192 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000193 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000194 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700195 LIBS="$LIBS -lsec"
196 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000197 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100198*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100199 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000200 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000201 AC_DEFINE(SETEUID_BREAKS_SETUID)
202 AC_DEFINE(BROKEN_SETREUID)
203 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000204 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000205 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100206 ;;
207*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100208 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000209 AC_DEFINE(WITH_IRIX_ARRAY)
210 AC_DEFINE(WITH_IRIX_PROJECT)
211 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000212 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000213 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000214 AC_DEFINE(SETEUID_BREAKS_SETUID)
215 AC_DEFINE(BROKEN_SETREUID)
216 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000217 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000218 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100219 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100220*-*-linux*)
221 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100222 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000223 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100224 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000225 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000226 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000227 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100228 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000229 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000230 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000231 AC_DEFINE(BROKEN_CMSG_TYPE)
232 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000233 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100234 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000235mips-sony-bsd|mips-sony-newsos4)
236 AC_DEFINE(HAVE_NEWS4)
237 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000238 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100239*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000240 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800241 if test "x$withval" != "xno" ; then
242 need_dash_r=1
243 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100244 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100245*-*-freebsd*)
246 check_for_libcrypt_later=1
247 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000248*-*-bsdi*)
249 AC_DEFINE(SETEUID_BREAKS_SETUID)
250 AC_DEFINE(BROKEN_SETREUID)
251 AC_DEFINE(BROKEN_SETREGID)
252 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000253*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000254 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100255 conf_utmp_location=/etc/utmp
256 conf_wtmp_location=/usr/adm/wtmp
257 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000258 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000259 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000260 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100261 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000262 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100263*-*-solaris*)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100264 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000265 AC_DEFINE(LOGIN_NEEDS_UTMPX)
266 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000267 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000268 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000269 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
270 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000271 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000272 # hardwire lastlog location (can't detect it on some versions)
273 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000274 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
275 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
276 if test "$sol2ver" -ge 8; then
277 AC_MSG_RESULT(yes)
278 AC_DEFINE(DISABLE_UTMP)
279 AC_DEFINE(DISABLE_WTMP)
280 else
281 AC_MSG_RESULT(no)
282 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100283 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000284*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000285 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000286 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100287 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000288 conf_utmp_location=/etc/utmp
289 conf_wtmp_location=/var/adm/wtmp
290 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000291 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000292 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000293*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700294 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000295 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000296 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000297 AC_DEFINE(SETEUID_BREAKS_SETUID)
298 AC_DEFINE(BROKEN_SETREUID)
299 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000300 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000301*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700302 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000303 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100304 IPADDR_IN_DISPLAY=yes
305 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000306 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000307 AC_DEFINE(SETEUID_BREAKS_SETUID)
308 AC_DEFINE(BROKEN_SETREUID)
309 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000310 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000311 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700312 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
313 # Attention: always take care to bind libsocket and libnsl before libc,
314 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000315 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100316*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100317 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700318 AC_DEFINE(SETEUID_BREAKS_SETUID)
319 AC_DEFINE(BROKEN_SETREUID)
320 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100321 ;;
322*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100323 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700324 AC_DEFINE(SETEUID_BREAKS_SETUID)
325 AC_DEFINE(BROKEN_SETREUID)
326 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100327 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100328*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100329 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100330*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800331 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Rice13aae5e2001-10-21 17:53:58 -0700332 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100333 RANLIB=true
334 no_dev_ptmx=1
335 AC_DEFINE(BROKEN_SYS_TERMIO_H)
336 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000337 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000338 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100339 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700340 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100341 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700342 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700343 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100344 ;;
345*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800346 if test -z "$GCC"; then
347 CFLAGS="$CFLAGS -belf"
348 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100349 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000350 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100351 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000352 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000353 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700354 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700355 AC_DEFINE(SETEUID_BREAKS_SETUID)
356 AC_DEFINE(BROKEN_SETREUID)
357 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700358 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100359 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700360 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000361 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000362*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000363 AC_DEFINE(USE_PIPES)
364 AC_DEFINE(DISABLE_FD_PASSING)
365 LDFLAGS="$LDFLAGS"
366 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
367 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000368 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000369*-*-unicosmp*)
370 AC_DEFINE(WITH_ABBREV_NO_TTY)
371 AC_DEFINE(USE_PIPES)
372 AC_DEFINE(DISABLE_FD_PASSING)
373 LDFLAGS="$LDFLAGS"
374 LIBS="$LIBS -lgen -lacid"
375 MANTYPE=cat
376 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000377*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000378 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700379 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700380 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000381 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
382 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
383 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700384 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000385*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000386 AC_MSG_CHECKING(for Digital Unix SIA)
387 no_osfsia=""
388 AC_ARG_WITH(osfsia,
389 [ --with-osfsia Enable Digital Unix SIA],
390 [
391 if test "x$withval" = "xno" ; then
392 AC_MSG_RESULT(disabled)
393 no_osfsia=1
394 fi
395 ],
396 )
397 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000398 if test -f /etc/sia/matrix.conf; then
399 AC_MSG_RESULT(yes)
400 AC_DEFINE(HAVE_OSF_SIA)
401 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000402 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000403 LIBS="$LIBS -lsecurity -ldb -lm -laud"
404 else
405 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100406 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000407 fi
408 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000409 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700410 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000411 AC_DEFINE(BROKEN_SETREUID)
412 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000413 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000414
415*-*-nto-qnx)
416 AC_DEFINE(USE_PIPES)
417 AC_DEFINE(NO_X11_UNIX_SOCKETS)
418 AC_DEFINE(MISSING_NFDBITS)
419 AC_DEFINE(MISSING_HOWMANY)
420 AC_DEFINE(MISSING_FD_MASK)
421 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100422esac
423
Damien Millere37bfc12000-06-05 09:37:43 +1000424# Allow user to specify flags
425AC_ARG_WITH(cflags,
426 [ --with-cflags Specify additional flags to pass to compiler],
427 [
428 if test "x$withval" != "xno" ; then
429 CFLAGS="$CFLAGS $withval"
430 fi
431 ]
432)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000433AC_ARG_WITH(cppflags,
434 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
435 [
436 if test "x$withval" != "xno"; then
437 CPPFLAGS="$CPPFLAGS $withval"
438 fi
439 ]
440)
Damien Millere37bfc12000-06-05 09:37:43 +1000441AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000442 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000443 [
444 if test "x$withval" != "xno" ; then
445 LDFLAGS="$LDFLAGS $withval"
446 fi
447 ]
448)
449AC_ARG_WITH(libs,
450 [ --with-libs Specify additional libraries to link with],
451 [
452 if test "x$withval" != "xno" ; then
453 LIBS="$LIBS $withval"
454 fi
455 ]
456)
457
Darren Tucker6eb93042003-06-29 21:30:41 +1000458AC_MSG_CHECKING(compiler and flags for sanity)
459AC_TRY_RUN([
460#include <stdio.h>
461int main(){exit(0);}
462 ],
463 [ AC_MSG_RESULT(yes) ],
464 [
465 AC_MSG_RESULT(no)
466 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
467 ]
468)
469
Tim Rice4cec93f2002-02-26 08:40:48 -0800470# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000471AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000472 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800473 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100474 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000475 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000476 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
Tim Rice2597bfd2004-01-26 19:03:39 -0800477 sys/cdefs.h sys/mman.h sys/pstat.h sys/ptms.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000478 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700479 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Damien Miller5c3a5582003-09-23 22:12:38 +1000480 util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800481
Damien Millera22ba012000-03-02 23:09:20 +1100482# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700483AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
484AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000485
Damien Millerdf288022001-02-18 13:07:07 +1100486dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700487if test "x$with_tcp_wrappers" != "xno" ; then
488 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
489 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
490 fi
491fi
Damien Millerdf288022001-02-18 13:07:07 +1100492
Tim Rice1e1ef642003-09-11 22:19:31 -0700493dnl IRIX and Solaris 2.5.1 have dirname() in libgen
494AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
495 AC_CHECK_LIB(gen, dirname,[
496 AC_CACHE_CHECK([for broken dirname],
497 ac_cv_have_broken_dirname, [
498 save_LIBS="$LIBS"
499 LIBS="$LIBS -lgen"
500 AC_TRY_RUN(
501 [
502#include <libgen.h>
503#include <string.h>
504
505int main(int argc, char **argv) {
506 char *s, buf[32];
507
508 strncpy(buf,"/etc", 32);
509 s = dirname(buf);
510 if (!s || strncmp(s, "/", 32) != 0) {
511 exit(1);
512 } else {
513 exit(0);
514 }
515}
516 ],
517 [ ac_cv_have_broken_dirname="no" ],
518 [ ac_cv_have_broken_dirname="yes" ]
519 )
520 LIBS="$save_LIBS"
521 ])
522 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
523 LIBS="$LIBS -lgen"
524 AC_DEFINE(HAVE_DIRNAME)
525 AC_CHECK_HEADERS(libgen.h)
526 fi
527 ])
528])
529
530AC_CHECK_FUNC(getspnam, ,
531 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
532AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
533
Tim Rice13aae5e2001-10-21 17:53:58 -0700534dnl zlib is required
535AC_ARG_WITH(zlib,
536 [ --with-zlib=PATH Use zlib in PATH],
537 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000538 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100539 AC_MSG_ERROR([*** zlib is required ***])
540 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700541 if test -d "$withval/lib"; then
542 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700543 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700544 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700545 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700546 fi
547 else
548 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700549 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700550 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700551 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700552 fi
553 fi
554 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700555 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700556 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700557 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700558 fi
559 ]
560)
561
Tim Ricefcb62202004-01-23 18:35:16 -0800562AC_CHECK_LIB(z, deflate, ,
563 [
564 saved_CPPFLAGS="$CPPFLAGS"
565 saved_LDFLAGS="$LDFLAGS"
566 save_LIBS="$LIBS"
567 dnl Check default zlib install dir
568 if test -n "${need_dash_r}"; then
569 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
570 else
571 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
572 fi
573 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
574 LIBS="$LIBS -lz"
575 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
576 [
577 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
578 ]
579 )
580 ]
581)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100582AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100583
584AC_ARG_WITH(zlib-version-check,
585 [ --without-zlib-version-check Disable zlib version check],
586 [ if test "x$withval" = "xno" ; then
587 zlib_check_nonfatal=1
588 fi
589 ]
590)
591
Darren Tucker2dcd2392004-01-23 17:13:33 +1100592AC_MSG_CHECKING(for zlib 1.1.4 or greater)
593AC_TRY_RUN([
594#include <zlib.h>
595int main()
596{
597 int a, b, c, v;
598 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
599 exit(1);
600 v = a*1000000 + b*1000 + c;
601 if (v >= 1001004)
602 exit(0);
603 exit(2);
604}
605 ],
606 AC_MSG_RESULT(yes),
607 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100608 if test -z "$zlib_check_nonfatal" ; then
609 AC_MSG_ERROR([*** zlib too old - check config.log ***
610Your reported zlib version has known security problems. It's possible your
611vendor has fixed these problems without changing the version number. If you
612are sure this is the case, you can disable the check by running
613"./configure --without-zlib-version-check".
614If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
615 else
616 AC_MSG_WARN([zlib version may have security problems])
617 fi
618 ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100619)
Damien Miller6f9c3372000-10-25 10:06:04 +1100620
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000621dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100622AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000623 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
624)
Damien Millera8e06ce2003-11-21 23:48:55 +1100625AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700626 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
627 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000628)
Damien Millerab18c411999-11-11 10:40:23 +1100629
Tim Ricee589a292001-11-03 11:09:32 -0800630dnl Checks for libutil functions
631AC_CHECK_HEADERS(libutil.h)
632AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
633AC_CHECK_FUNCS(logout updwtmp logwtmp)
634
Ben Lindstrom8697e082001-02-24 21:41:10 +0000635AC_FUNC_STRFTIME
636
Damien Miller3c027682001-03-14 11:39:45 +1100637# Check for ALTDIRFUNC glob() extension
638AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
639AC_EGREP_CPP(FOUNDIT,
640 [
641 #include <glob.h>
642 #ifdef GLOB_ALTDIRFUNC
643 FOUNDIT
644 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100645 ],
Damien Miller3c027682001-03-14 11:39:45 +1100646 [
647 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
648 AC_MSG_RESULT(yes)
649 ],
650 [
651 AC_MSG_RESULT(no)
652 ]
653)
Damien Millerab18c411999-11-11 10:40:23 +1100654
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000655# Check for g.gl_matchc glob() extension
656AC_MSG_CHECKING(for gl_matchc field in glob_t)
657AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100658 [
659 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000660 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100661 ],
662 [
663 AC_DEFINE(GLOB_HAS_GL_MATCHC)
664 AC_MSG_RESULT(yes)
665 ],
666 [
667 AC_MSG_RESULT(no)
668 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000669)
670
Damien Miller18bb4732001-03-28 14:35:30 +1000671AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
672AC_TRY_RUN(
673 [
674#include <sys/types.h>
675#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700676int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000677 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100678 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000679 [
680 AC_MSG_RESULT(no)
681 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
682 ]
683)
684
Damien Millerc547bf12001-02-16 10:18:12 +1100685# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100686SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100687AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700688 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100689 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100690 [
691 if test "x$withval" != "xno" ; then
692
693 if test "x$withval" != "xyes" ; then
694 CPPFLAGS="$CPPFLAGS -I${withval}/include"
695 LDFLAGS="$LDFLAGS -L${withval}/lib"
696 fi
697
698 AC_DEFINE(SKEY)
699 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100700 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100701
Tim Rice4cec93f2002-02-26 08:40:48 -0800702 AC_MSG_CHECKING([for s/key support])
703 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100704 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800705#include <stdio.h>
706#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700707int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800708 ],
709 [AC_MSG_RESULT(yes)],
710 [
711 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100712 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
713 ])
714 fi
715 ]
716)
717
718# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700719TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100720AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700721 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100722 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100723 [
724 if test "x$withval" != "xno" ; then
725 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700726 saved_LDFLAGS="$LDFLAGS"
727 saved_CPPFLAGS="$CPPFLAGS"
728 if test -n "${withval}" -a "${withval}" != "yes"; then
729 if test -d "${withval}/lib"; then
730 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700731 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700732 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700733 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700734 fi
735 else
736 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700737 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700738 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700739 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700740 fi
741 fi
742 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700743 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700744 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700745 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700746 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700747 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800748 LIBWRAP="-lwrap"
749 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100750 AC_MSG_CHECKING(for libwrap)
751 AC_TRY_LINK(
752 [
753#include <tcpd.h>
754 int deny_severity = 0, allow_severity = 0;
755 ],
756 [hosts_access(0);],
757 [
758 AC_MSG_RESULT(yes)
759 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800760 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700761 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100762 ],
763 [
764 AC_MSG_ERROR([*** libwrap missing])
765 ]
766 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800767 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100768 fi
769 ]
770)
771
Damien Millerfe1f1432003-02-24 15:45:42 +1100772dnl Checks for library functions. Please keep in alphabetical order
773AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000774 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000775 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000776 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000777 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100778 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000779 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
780 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
781 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100782 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000783 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000784 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000785 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100786)
Tim Rice13aae5e2001-10-21 17:53:58 -0700787
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000788# IRIX has a const char return value for gai_strerror()
789AC_CHECK_FUNCS(gai_strerror,[
790 AC_DEFINE(HAVE_GAI_STRERROR)
791 AC_TRY_COMPILE([
792#include <sys/types.h>
793#include <sys/socket.h>
794#include <netdb.h>
795
796const char *gai_strerror(int);],[
797char *str;
798
799str = gai_strerror(0);],[
800 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
801 [Define if gai_strerror() returns const char *])])])
802
Damien Millercd6853c2003-01-28 11:33:42 +1100803AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
804
Darren Tuckerf1159b52003-07-07 19:44:01 +1000805dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000806AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000807AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000808
Darren Tuckerb2427c82003-09-10 15:22:44 +1000809dnl tcsendbreak might be a macro
810AC_CHECK_DECL(tcsendbreak,
811 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100812 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000813 [#include <termios.h>]
814)
815
Darren Tucker2a6b0292003-12-31 14:59:17 +1100816AC_CHECK_FUNCS(setresuid, [
817 dnl Some platorms have setresuid that isn't implemented, test for this
818 AC_MSG_CHECKING(if setresuid seems to work)
819 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100820#include <stdlib.h>
821#include <errno.h>
822int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100823 ],
824 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100825 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100826 AC_MSG_RESULT(not implemented)]
827 )
828])
Darren Tuckere937be32003-12-17 18:53:26 +1100829
Darren Tucker2a6b0292003-12-31 14:59:17 +1100830AC_CHECK_FUNCS(setresgid, [
831 dnl Some platorms have setresgid that isn't implemented, test for this
832 AC_MSG_CHECKING(if setresgid seems to work)
833 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100834#include <stdlib.h>
835#include <errno.h>
836int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100837 ],
838 [AC_MSG_RESULT(yes)],
839 [AC_DEFINE(BROKEN_SETRESGID)
840 AC_MSG_RESULT(not implemented)]
841 )
842])
Darren Tuckere937be32003-12-17 18:53:26 +1100843
Damien Millerad833b32000-08-23 10:46:23 +1000844dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000845AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000846dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000847AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000848AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000849dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000850AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000851AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100852
Damien Millera8e06ce2003-11-21 23:48:55 +1100853AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100854 [AC_DEFINE(HAVE_DAEMON)],
855 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
856)
857
Damien Millera8e06ce2003-11-21 23:48:55 +1100858AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100859 [AC_DEFINE(HAVE_GETPAGESIZE)],
860 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
861)
862
Damien Millercb170cb2000-07-01 16:52:55 +1000863# Check for broken snprintf
864if test "x$ac_cv_func_snprintf" = "xyes" ; then
865 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
866 AC_TRY_RUN(
867 [
868#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700869int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000870 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100871 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000872 [
873 AC_MSG_RESULT(no)
874 AC_DEFINE(BROKEN_SNPRINTF)
875 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
876 ]
877 )
878fi
879
Damien Millere8328192003-01-07 15:18:32 +1100880dnl see whether mkstemp() requires XXXXXX
881if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
882AC_MSG_CHECKING([for (overly) strict mkstemp])
883AC_TRY_RUN(
884 [
885#include <stdlib.h>
886main() { char template[]="conftest.mkstemp-test";
887if (mkstemp(template) == -1)
888 exit(1);
889unlink(template); exit(0);
890}
891 ],
892 [
893 AC_MSG_RESULT(no)
894 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100895 [
Damien Millere8328192003-01-07 15:18:32 +1100896 AC_MSG_RESULT(yes)
897 AC_DEFINE(HAVE_STRICT_MKSTEMP)
898 ],
899 [
900 AC_MSG_RESULT(yes)
901 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100902 ]
Damien Millere8328192003-01-07 15:18:32 +1100903)
904fi
905
Darren Tucker70a3d552003-08-21 17:58:29 +1000906dnl make sure that openpty does not reacquire controlling terminal
907if test ! -z "$check_for_openpty_ctty_bug"; then
908 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
909 AC_TRY_RUN(
910 [
911#include <stdio.h>
912#include <sys/fcntl.h>
913#include <sys/types.h>
914#include <sys/wait.h>
915
916int
917main()
918{
919 pid_t pid;
920 int fd, ptyfd, ttyfd, status;
921
922 pid = fork();
923 if (pid < 0) { /* failed */
924 exit(1);
925 } else if (pid > 0) { /* parent */
926 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100927 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000928 exit(WEXITSTATUS(status));
929 else
930 exit(2);
931 } else { /* child */
932 close(0); close(1); close(2);
933 setsid();
934 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
935 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
936 if (fd >= 0)
937 exit(3); /* Acquired ctty: broken */
938 else
939 exit(0); /* Did not acquire ctty: OK */
940 }
941}
942 ],
943 [
944 AC_MSG_RESULT(yes)
945 ],
946 [
947 AC_MSG_RESULT(no)
948 AC_DEFINE(SSHD_ACQUIRES_CTTY)
949 ]
950 )
951fi
952
Damien Miller606f8802000-09-16 15:39:56 +1100953AC_FUNC_GETPGRP
954
Damien Millera64b57a2001-01-17 10:44:13 +1100955# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000956PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100957AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100958 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100959 [
Damien Millera64b57a2001-01-17 10:44:13 +1100960 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100961 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
962 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100963 AC_MSG_ERROR([PAM headers not found])
964 fi
965
966 AC_CHECK_LIB(dl, dlopen, , )
967 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
968 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000969 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100970
Damien Millera64b57a2001-01-17 10:44:13 +1100971 PAM_MSG="yes"
972
973 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800974 if test $ac_cv_lib_dl_dlopen = yes; then
975 LIBPAM="-lpam -ldl"
976 else
977 LIBPAM="-lpam"
978 fi
979 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100980 fi
981 ]
982)
Damien Millera22ba012000-03-02 23:09:20 +1100983
Damien Millera64b57a2001-01-17 10:44:13 +1100984# Check for older PAM
985if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100986 # Check PAM strerror arguments (old PAM)
987 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
988 AC_TRY_COMPILE(
989 [
Damien Miller81171112000-04-23 11:14:01 +1000990#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +1100991#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +1000992#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +1100993#elif defined (HAVE_PAM_PAM_APPL_H)
994#include <pam/pam_appl.h>
995#endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100996 ],
997 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +1100998 [AC_MSG_RESULT(no)],
999 [
1000 AC_DEFINE(HAVE_OLD_PAM)
1001 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001002 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001003 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001004 )
Damien Millera22ba012000-03-02 23:09:20 +11001005fi
1006
Damien Millerfc93d4b2002-09-04 23:26:29 +10001007# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1008# because the system crypt() is more featureful.
1009if test "x$check_for_libcrypt_before" = "x1"; then
1010 AC_CHECK_LIB(crypt, crypt)
1011fi
1012
Tim Riceaef73712002-05-11 13:17:42 -07001013# Search for OpenSSL
1014saved_CPPFLAGS="$CPPFLAGS"
1015saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001016AC_ARG_WITH(ssl-dir,
1017 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1018 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001019 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001020 if test -d "$withval/lib"; then
1021 if test -n "${need_dash_r}"; then
1022 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1023 else
1024 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1025 fi
1026 else
1027 if test -n "${need_dash_r}"; then
1028 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1029 else
1030 LDFLAGS="-L${withval} ${LDFLAGS}"
1031 fi
1032 fi
1033 if test -d "$withval/include"; then
1034 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1035 else
1036 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1037 fi
Damien Millera22ba012000-03-02 23:09:20 +11001038 fi
1039 ]
1040)
Tim Riceaef73712002-05-11 13:17:42 -07001041LIBS="$LIBS -lcrypto"
1042AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001043 [
Tim Riceaef73712002-05-11 13:17:42 -07001044 dnl Check default openssl install dir
1045 if test -n "${need_dash_r}"; then
1046 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001047 else
Tim Riceaef73712002-05-11 13:17:42 -07001048 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001049 fi
Tim Riceaef73712002-05-11 13:17:42 -07001050 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1051 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1052 [
1053 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1054 ]
1055 )
1056 ]
1057)
1058
Tim Riced730b782002-08-13 18:52:10 -07001059# Determine OpenSSL header version
1060AC_MSG_CHECKING([OpenSSL header version])
1061AC_TRY_RUN(
1062 [
1063#include <stdio.h>
1064#include <string.h>
1065#include <openssl/opensslv.h>
1066#define DATA "conftest.sslincver"
1067int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001068 FILE *fd;
1069 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001070
Damien Millera8e06ce2003-11-21 23:48:55 +11001071 fd = fopen(DATA,"w");
1072 if(fd == NULL)
1073 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001074
1075 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1076 exit(1);
1077
1078 exit(0);
1079}
1080 ],
1081 [
1082 ssl_header_ver=`cat conftest.sslincver`
1083 AC_MSG_RESULT($ssl_header_ver)
1084 ],
1085 [
1086 AC_MSG_RESULT(not found)
1087 AC_MSG_ERROR(OpenSSL version header not found.)
1088 ]
1089)
1090
1091# Determine OpenSSL library version
1092AC_MSG_CHECKING([OpenSSL library version])
1093AC_TRY_RUN(
1094 [
1095#include <stdio.h>
1096#include <string.h>
1097#include <openssl/opensslv.h>
1098#include <openssl/crypto.h>
1099#define DATA "conftest.ssllibver"
1100int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001101 FILE *fd;
1102 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001103
Damien Millera8e06ce2003-11-21 23:48:55 +11001104 fd = fopen(DATA,"w");
1105 if(fd == NULL)
1106 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001107
1108 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1109 exit(1);
1110
1111 exit(0);
1112}
1113 ],
1114 [
1115 ssl_library_ver=`cat conftest.ssllibver`
1116 AC_MSG_RESULT($ssl_library_ver)
1117 ],
1118 [
1119 AC_MSG_RESULT(not found)
1120 AC_MSG_ERROR(OpenSSL library not found.)
1121 ]
1122)
Damien Millera22ba012000-03-02 23:09:20 +11001123
Damien Millerec932372002-01-22 22:16:03 +11001124# Sanity check OpenSSL headers
1125AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1126AC_TRY_RUN(
1127 [
1128#include <string.h>
1129#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001130int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001131 ],
1132 [
1133 AC_MSG_RESULT(yes)
1134 ],
1135 [
1136 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001137 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1138Check config.log for details.
1139Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001140 ]
1141)
1142
Damien Millera8e06ce2003-11-21 23:48:55 +11001143# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001144# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001145if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001146 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001147fi
1148
Damien Miller6c21c512002-01-22 21:57:53 +11001149
1150### Configure cryptographic random number support
1151
1152# Check wheter OpenSSL seeds itself
1153AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1154AC_TRY_RUN(
1155 [
1156#include <string.h>
1157#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001158int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001159 ],
1160 [
1161 OPENSSL_SEEDS_ITSELF=yes
1162 AC_MSG_RESULT(yes)
1163 ],
1164 [
1165 AC_MSG_RESULT(no)
1166 # Default to use of the rand helper if OpenSSL doesn't
1167 # seed itself
1168 USE_RAND_HELPER=yes
1169 ]
1170)
1171
1172
1173# Do we want to force the use of the rand helper?
1174AC_ARG_WITH(rand-helper,
1175 [ --with-rand-helper Use subprocess to gather strong randomness ],
1176 [
1177 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001178 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001179 # the previous test showed it to be unseeded.
1180 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1181 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1182 OPENSSL_SEEDS_ITSELF=yes
1183 USE_RAND_HELPER=""
1184 fi
1185 else
1186 USE_RAND_HELPER=yes
1187 fi
1188 ],
1189)
1190
1191# Which randomness source do we use?
1192if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1193 # OpenSSL only
1194 AC_DEFINE(OPENSSL_PRNG_ONLY)
1195 RAND_MSG="OpenSSL internal ONLY"
1196 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001197elif test ! -z "$USE_RAND_HELPER" ; then
1198 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001199 RAND_MSG="ssh-rand-helper"
1200 INSTALL_SSH_RAND_HELPER="yes"
1201fi
1202AC_SUBST(INSTALL_SSH_RAND_HELPER)
1203
1204### Configuration of ssh-rand-helper
1205
1206# PRNGD TCP socket
1207AC_ARG_WITH(prngd-port,
1208 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1209 [
Damien Millere996d722002-01-23 11:20:59 +11001210 case "$withval" in
1211 no)
1212 withval=""
1213 ;;
1214 [[0-9]]*)
1215 ;;
1216 *)
1217 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1218 ;;
1219 esac
1220 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001221 PRNGD_PORT="$withval"
1222 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1223 fi
1224 ]
1225)
1226
1227# PRNGD Unix domain socket
1228AC_ARG_WITH(prngd-socket,
1229 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1230 [
Damien Millere996d722002-01-23 11:20:59 +11001231 case "$withval" in
1232 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001233 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001234 ;;
1235 no)
1236 withval=""
1237 ;;
1238 /*)
1239 ;;
1240 *)
1241 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1242 ;;
1243 esac
1244
1245 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001246 if test ! -z "$PRNGD_PORT" ; then
1247 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1248 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001249 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001250 AC_MSG_WARN(Entropy socket is not readable)
1251 fi
1252 PRNGD_SOCKET="$withval"
1253 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1254 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001255 ],
1256 [
1257 # Check for existing socket only if we don't have a random device already
1258 if test "$USE_RAND_HELPER" = yes ; then
1259 AC_MSG_CHECKING(for PRNGD/EGD socket)
1260 # Insert other locations here
1261 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1262 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1263 PRNGD_SOCKET="$sock"
1264 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1265 break;
1266 fi
1267 done
1268 if test ! -z "$PRNGD_SOCKET" ; then
1269 AC_MSG_RESULT($PRNGD_SOCKET)
1270 else
1271 AC_MSG_RESULT(not found)
1272 fi
1273 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001274 ]
1275)
1276
1277# Change default command timeout for hashing entropy source
1278entropy_timeout=200
1279AC_ARG_WITH(entropy-timeout,
1280 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1281 [
1282 if test "x$withval" != "xno" ; then
1283 entropy_timeout=$withval
1284 fi
1285 ]
1286)
Damien Miller6c21c512002-01-22 21:57:53 +11001287AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1288
Damien Millerd3f6ad22002-06-25 10:24:47 +10001289SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001290AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001291 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001292 [
1293 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001294 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001295 fi
1296 ]
1297)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001298AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1299AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001300
Tim Rice88f2ab52002-03-17 12:17:34 -08001301# We do this little dance with the search path to insure
1302# that programs that we select for use by installed programs
1303# (which may be run by the super-user) come from trusted
1304# locations before they come from the user's private area.
1305# This should help avoid accidentally configuring some
1306# random version of a program in someone's personal bin.
1307
1308OPATH=$PATH
1309PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001310test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001311test -d /sbin && PATH=$PATH:/sbin
1312test -d /usr/sbin && PATH=$PATH:/usr/sbin
1313PATH=$PATH:/etc:$OPATH
1314
Damien Millera8e06ce2003-11-21 23:48:55 +11001315# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001316OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1317OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1318OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1319OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1320OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1321OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1322OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1323OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1324OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1325OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1326OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1327OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1328OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1329OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1330OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1331OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001332# restore PATH
1333PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001334
1335# Where does ssh-rand-helper get its randomness from?
1336INSTALL_SSH_PRNG_CMDS=""
1337if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1338 if test ! -z "$PRNGD_PORT" ; then
1339 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1340 elif test ! -z "$PRNGD_SOCKET" ; then
1341 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1342 else
1343 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1344 RAND_HELPER_CMDHASH=yes
1345 INSTALL_SSH_PRNG_CMDS="yes"
1346 fi
1347fi
1348AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1349
1350
Ben Lindstromb5628642000-10-18 00:02:25 +00001351# Cheap hack to ensure NEWS-OS libraries are arranged right.
1352if test ! -z "$SONY" ; then
1353 LIBS="$LIBS -liberty";
1354fi
1355
Damien Millera22ba012000-03-02 23:09:20 +11001356# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001357AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001358AC_CHECK_SIZEOF(short int, 2)
1359AC_CHECK_SIZEOF(int, 4)
1360AC_CHECK_SIZEOF(long int, 4)
1361AC_CHECK_SIZEOF(long long int, 8)
1362
Damien Millerfa2bb692002-04-23 23:22:25 +10001363# Sanity check long long for some platforms (AIX)
1364if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1365 ac_cv_sizeof_long_long_int=0
1366fi
1367
Damien Millera22ba012000-03-02 23:09:20 +11001368# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001369AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1370 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001371 [ #include <sys/types.h> ],
1372 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001373 [ ac_cv_have_u_int="yes" ],
1374 [ ac_cv_have_u_int="no" ]
1375 )
1376])
1377if test "x$ac_cv_have_u_int" = "xyes" ; then
1378 AC_DEFINE(HAVE_U_INT)
1379 have_u_int=1
1380fi
1381
Damien Miller61e50f12000-05-08 20:49:37 +10001382AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1383 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001384 [ #include <sys/types.h> ],
1385 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001386 [ ac_cv_have_intxx_t="yes" ],
1387 [ ac_cv_have_intxx_t="no" ]
1388 )
1389])
1390if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1391 AC_DEFINE(HAVE_INTXX_T)
1392 have_intxx_t=1
1393fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001394
1395if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001396 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001397then
1398 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1399 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001400 [ #include <stdint.h> ],
1401 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001402 [
1403 AC_DEFINE(HAVE_INTXX_T)
1404 AC_MSG_RESULT(yes)
1405 ],
1406 [ AC_MSG_RESULT(no) ]
1407 )
1408fi
1409
Damien Miller578783e2000-09-23 14:12:24 +11001410AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1411 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001412 [
1413#include <sys/types.h>
1414#ifdef HAVE_STDINT_H
1415# include <stdint.h>
1416#endif
1417#include <sys/socket.h>
1418#ifdef HAVE_SYS_BITYPES_H
1419# include <sys/bitypes.h>
1420#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001421 ],
1422 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001423 [ ac_cv_have_int64_t="yes" ],
1424 [ ac_cv_have_int64_t="no" ]
1425 )
1426])
1427if test "x$ac_cv_have_int64_t" = "xyes" ; then
1428 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001429fi
1430
Damien Miller61e50f12000-05-08 20:49:37 +10001431AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1432 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001433 [ #include <sys/types.h> ],
1434 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001435 [ ac_cv_have_u_intxx_t="yes" ],
1436 [ ac_cv_have_u_intxx_t="no" ]
1437 )
1438])
1439if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1440 AC_DEFINE(HAVE_U_INTXX_T)
1441 have_u_intxx_t=1
1442fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001443
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001444if test -z "$have_u_intxx_t" ; then
1445 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1446 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001447 [ #include <sys/socket.h> ],
1448 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001449 [
1450 AC_DEFINE(HAVE_U_INTXX_T)
1451 AC_MSG_RESULT(yes)
1452 ],
1453 [ AC_MSG_RESULT(no) ]
1454 )
1455fi
1456
Damien Miller578783e2000-09-23 14:12:24 +11001457AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1458 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001459 [ #include <sys/types.h> ],
1460 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001461 [ ac_cv_have_u_int64_t="yes" ],
1462 [ ac_cv_have_u_int64_t="no" ]
1463 )
1464])
1465if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1466 AC_DEFINE(HAVE_U_INT64_T)
1467 have_u_int64_t=1
1468fi
1469
Tim Rice4cec93f2002-02-26 08:40:48 -08001470if test -z "$have_u_int64_t" ; then
1471 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1472 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001473 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001474 [ u_int64_t a; a = 1],
1475 [
1476 AC_DEFINE(HAVE_U_INT64_T)
1477 AC_MSG_RESULT(yes)
1478 ],
1479 [ AC_MSG_RESULT(no) ]
1480 )
1481fi
1482
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001483if test -z "$have_u_intxx_t" ; then
1484 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1485 AC_TRY_COMPILE(
1486 [
1487#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001488 ],
1489 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001490 [ ac_cv_have_uintxx_t="yes" ],
1491 [ ac_cv_have_uintxx_t="no" ]
1492 )
1493 ])
1494 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1495 AC_DEFINE(HAVE_UINTXX_T)
1496 fi
1497fi
1498
1499if test -z "$have_uintxx_t" ; then
1500 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1501 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001502 [ #include <stdint.h> ],
1503 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001504 [
1505 AC_DEFINE(HAVE_UINTXX_T)
1506 AC_MSG_RESULT(yes)
1507 ],
1508 [ AC_MSG_RESULT(no) ]
1509 )
1510fi
1511
Damien Milleredb82922000-06-20 13:25:52 +10001512if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001513 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001514then
1515 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1516 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001517 [
1518#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001519 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001520 [
Damien Miller70494d12000-04-03 15:57:06 +10001521 int8_t a; int16_t b; int32_t c;
1522 u_int8_t e; u_int16_t f; u_int32_t g;
1523 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001524 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001525 [
1526 AC_DEFINE(HAVE_U_INTXX_T)
1527 AC_DEFINE(HAVE_INTXX_T)
1528 AC_MSG_RESULT(yes)
1529 ],
1530 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001531 )
Damien Millerb29ea912000-01-15 14:12:03 +11001532fi
1533
Damien Miller58be7382001-09-15 21:31:54 +10001534
1535AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1536 AC_TRY_COMPILE(
1537 [
1538#include <sys/types.h>
1539 ],
1540 [ u_char foo; foo = 125; ],
1541 [ ac_cv_have_u_char="yes" ],
1542 [ ac_cv_have_u_char="no" ]
1543 )
1544])
1545if test "x$ac_cv_have_u_char" = "xyes" ; then
1546 AC_DEFINE(HAVE_U_CHAR)
1547fi
1548
Tim Rice13aae5e2001-10-21 17:53:58 -07001549TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001550
Tim Rice200a5c02002-02-26 22:12:34 -08001551AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001552
Damien Miller61e50f12000-05-08 20:49:37 +10001553AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1554 AC_TRY_COMPILE(
1555 [
1556#include <sys/types.h>
1557 ],
1558 [ size_t foo; foo = 1235; ],
1559 [ ac_cv_have_size_t="yes" ],
1560 [ ac_cv_have_size_t="no" ]
1561 )
1562])
1563if test "x$ac_cv_have_size_t" = "xyes" ; then
1564 AC_DEFINE(HAVE_SIZE_T)
1565fi
Damien Miller95058511999-12-29 10:36:45 +11001566
Damien Miller615f9392000-05-17 22:53:33 +10001567AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1568 AC_TRY_COMPILE(
1569 [
1570#include <sys/types.h>
1571 ],
1572 [ ssize_t foo; foo = 1235; ],
1573 [ ac_cv_have_ssize_t="yes" ],
1574 [ ac_cv_have_ssize_t="no" ]
1575 )
1576])
1577if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1578 AC_DEFINE(HAVE_SSIZE_T)
1579fi
1580
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001581AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1582 AC_TRY_COMPILE(
1583 [
1584#include <time.h>
1585 ],
1586 [ clock_t foo; foo = 1235; ],
1587 [ ac_cv_have_clock_t="yes" ],
1588 [ ac_cv_have_clock_t="no" ]
1589 )
1590])
1591if test "x$ac_cv_have_clock_t" = "xyes" ; then
1592 AC_DEFINE(HAVE_CLOCK_T)
1593fi
1594
Damien Millerb54b40e2000-06-23 08:23:34 +10001595AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1596 AC_TRY_COMPILE(
1597 [
1598#include <sys/types.h>
1599#include <sys/socket.h>
1600 ],
1601 [ sa_family_t foo; foo = 1235; ],
1602 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001603 [ AC_TRY_COMPILE(
1604 [
1605#include <sys/types.h>
1606#include <sys/socket.h>
1607#include <netinet/in.h>
1608 ],
1609 [ sa_family_t foo; foo = 1235; ],
1610 [ ac_cv_have_sa_family_t="yes" ],
1611
Damien Millerb54b40e2000-06-23 08:23:34 +10001612 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001613 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001614 )
1615])
1616if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1617 AC_DEFINE(HAVE_SA_FAMILY_T)
1618fi
1619
Damien Miller0f91b4e2000-06-18 15:43:25 +10001620AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1621 AC_TRY_COMPILE(
1622 [
1623#include <sys/types.h>
1624 ],
1625 [ pid_t foo; foo = 1235; ],
1626 [ ac_cv_have_pid_t="yes" ],
1627 [ ac_cv_have_pid_t="no" ]
1628 )
1629])
1630if test "x$ac_cv_have_pid_t" = "xyes" ; then
1631 AC_DEFINE(HAVE_PID_T)
1632fi
1633
1634AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1635 AC_TRY_COMPILE(
1636 [
1637#include <sys/types.h>
1638 ],
1639 [ mode_t foo; foo = 1235; ],
1640 [ ac_cv_have_mode_t="yes" ],
1641 [ ac_cv_have_mode_t="no" ]
1642 )
1643])
1644if test "x$ac_cv_have_mode_t" = "xyes" ; then
1645 AC_DEFINE(HAVE_MODE_T)
1646fi
1647
Damien Miller61e50f12000-05-08 20:49:37 +10001648
1649AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1650 AC_TRY_COMPILE(
1651 [
Damien Miller81171112000-04-23 11:14:01 +10001652#include <sys/types.h>
1653#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001654 ],
1655 [ struct sockaddr_storage s; ],
1656 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1657 [ ac_cv_have_struct_sockaddr_storage="no" ]
1658 )
1659])
1660if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1661 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1662fi
Damien Miller34132e52000-01-14 15:45:46 +11001663
Damien Miller61e50f12000-05-08 20:49:37 +10001664AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1665 AC_TRY_COMPILE(
1666 [
Damien Miller7b22d652000-06-18 14:07:04 +10001667#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001668#include <netinet/in.h>
1669 ],
1670 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1671 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1672 [ ac_cv_have_struct_sockaddr_in6="no" ]
1673 )
1674])
1675if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1676 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1677fi
Damien Miller34132e52000-01-14 15:45:46 +11001678
Damien Miller61e50f12000-05-08 20:49:37 +10001679AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1680 AC_TRY_COMPILE(
1681 [
Damien Miller7b22d652000-06-18 14:07:04 +10001682#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001683#include <netinet/in.h>
1684 ],
1685 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1686 [ ac_cv_have_struct_in6_addr="yes" ],
1687 [ ac_cv_have_struct_in6_addr="no" ]
1688 )
1689])
1690if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1691 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1692fi
Damien Miller34132e52000-01-14 15:45:46 +11001693
Damien Miller61e50f12000-05-08 20:49:37 +10001694AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1695 AC_TRY_COMPILE(
1696 [
Damien Miller81171112000-04-23 11:14:01 +10001697#include <sys/types.h>
1698#include <sys/socket.h>
1699#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001700 ],
1701 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1702 [ ac_cv_have_struct_addrinfo="yes" ],
1703 [ ac_cv_have_struct_addrinfo="no" ]
1704 )
1705])
1706if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1707 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1708fi
1709
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001710AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1711 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001712 [ #include <sys/time.h> ],
1713 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001714 [ ac_cv_have_struct_timeval="yes" ],
1715 [ ac_cv_have_struct_timeval="no" ]
1716 )
1717])
1718if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1719 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1720 have_struct_timeval=1
1721fi
1722
Tim Rice4e4dc562003-03-18 10:21:40 -08001723AC_CHECK_TYPES(struct timespec)
1724
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001725# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001726if test "x$ac_cv_have_int64_t" = "xno" -a \
1727 "x$ac_cv_sizeof_long_int" != "x8" -a \
1728 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001729 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1730 echo "an alternative compiler (I.E., GCC) before continuing."
1731 echo ""
1732 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001733else
1734dnl test snprintf (broken on SCO w/gcc)
1735 AC_TRY_RUN(
1736 [
1737#include <stdio.h>
1738#include <string.h>
1739#ifdef HAVE_SNPRINTF
1740main()
1741{
1742 char buf[50];
1743 char expected_out[50];
1744 int mazsize = 50 ;
1745#if (SIZEOF_LONG_INT == 8)
1746 long int num = 0x7fffffffffffffff;
1747#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001748 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001749#endif
1750 strcpy(expected_out, "9223372036854775807");
1751 snprintf(buf, mazsize, "%lld", num);
1752 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001753 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001754 exit(0);
1755}
1756#else
1757main() { exit(0); }
1758#endif
1759 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1760 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001761fi
1762
Damien Miller78315eb2000-09-29 23:01:36 +11001763dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001764OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1765OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1766OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1767OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1768OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001769OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001770OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1771OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001772OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001773OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1774OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1775OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1776OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001777OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1778OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1779OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1780OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001781
1782AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001783
Damien Miller61e50f12000-05-08 20:49:37 +10001784AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1785 ac_cv_have_ss_family_in_struct_ss, [
1786 AC_TRY_COMPILE(
1787 [
Damien Miller81171112000-04-23 11:14:01 +10001788#include <sys/types.h>
1789#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001790 ],
1791 [ struct sockaddr_storage s; s.ss_family = 1; ],
1792 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1793 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1794 )
1795])
1796if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1797 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1798fi
1799
Damien Miller61e50f12000-05-08 20:49:37 +10001800AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1801 ac_cv_have___ss_family_in_struct_ss, [
1802 AC_TRY_COMPILE(
1803 [
Damien Miller81171112000-04-23 11:14:01 +10001804#include <sys/types.h>
1805#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001806 ],
1807 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1808 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1809 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1810 )
1811])
1812if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1813 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1814fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001815
Damien Millerad833b32000-08-23 10:46:23 +10001816AC_CACHE_CHECK([for pw_class field in struct passwd],
1817 ac_cv_have_pw_class_in_struct_passwd, [
1818 AC_TRY_COMPILE(
1819 [
Damien Millerad833b32000-08-23 10:46:23 +10001820#include <pwd.h>
1821 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001822 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001823 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1824 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1825 )
1826])
1827if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1828 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1829fi
1830
Kevin Steves82456952001-06-22 21:14:18 +00001831AC_CACHE_CHECK([for pw_expire field in struct passwd],
1832 ac_cv_have_pw_expire_in_struct_passwd, [
1833 AC_TRY_COMPILE(
1834 [
1835#include <pwd.h>
1836 ],
1837 [ struct passwd p; p.pw_expire = 0; ],
1838 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1839 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1840 )
1841])
1842if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1843 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1844fi
1845
1846AC_CACHE_CHECK([for pw_change field in struct passwd],
1847 ac_cv_have_pw_change_in_struct_passwd, [
1848 AC_TRY_COMPILE(
1849 [
1850#include <pwd.h>
1851 ],
1852 [ struct passwd p; p.pw_change = 0; ],
1853 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1854 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1855 )
1856])
1857if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1858 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1859fi
Damien Miller61e50f12000-05-08 20:49:37 +10001860
Tim Rice28bbb0c2002-05-27 17:37:32 -07001861dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001862AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1863 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001864 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001865 [
Tim Riceae49fe62002-04-12 10:26:21 -07001866#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001867#include <sys/socket.h>
1868#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001869int main() {
1870#ifdef msg_accrights
1871exit(1);
1872#endif
1873struct msghdr m;
1874m.msg_accrights = 0;
1875exit(0);
1876}
Kevin Steves939c9db2002-03-22 17:23:25 +00001877 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001878 [ ac_cv_have_accrights_in_msghdr="yes" ],
1879 [ ac_cv_have_accrights_in_msghdr="no" ]
1880 )
1881])
1882if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1883 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1884fi
1885
Kevin Stevesa44e0352002-04-07 16:18:03 +00001886AC_CACHE_CHECK([for msg_control field in struct msghdr],
1887 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001888 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001889 [
Tim Riceae49fe62002-04-12 10:26:21 -07001890#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001891#include <sys/socket.h>
1892#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001893int main() {
1894#ifdef msg_control
1895exit(1);
1896#endif
1897struct msghdr m;
1898m.msg_control = 0;
1899exit(0);
1900}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001901 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001902 [ ac_cv_have_control_in_msghdr="yes" ],
1903 [ ac_cv_have_control_in_msghdr="no" ]
1904 )
1905])
1906if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1907 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1908fi
1909
Damien Miller61e50f12000-05-08 20:49:37 +10001910AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001911 AC_TRY_LINK([],
1912 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001913 [ ac_cv_libc_defines___progname="yes" ],
1914 [ ac_cv_libc_defines___progname="no" ]
1915 )
1916])
1917if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1918 AC_DEFINE(HAVE___PROGNAME)
1919fi
1920
Kevin Steves4846f4a2002-03-22 18:19:53 +00001921AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1922 AC_TRY_LINK([
1923#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001924],
1925 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001926 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1927 [ ac_cv_cc_implements___FUNCTION__="no" ]
1928 )
1929])
1930if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1931 AC_DEFINE(HAVE___FUNCTION__)
1932fi
1933
1934AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1935 AC_TRY_LINK([
1936#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001937],
1938 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001939 [ ac_cv_cc_implements___func__="yes" ],
1940 [ ac_cv_cc_implements___func__="no" ]
1941 )
1942])
1943if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1944 AC_DEFINE(HAVE___func__)
1945fi
1946
Damien Miller4f8e6692001-07-14 13:22:53 +10001947AC_CACHE_CHECK([whether getopt has optreset support],
1948 ac_cv_have_getopt_optreset, [
1949 AC_TRY_LINK(
1950 [
1951#include <getopt.h>
1952 ],
1953 [ extern int optreset; optreset = 0; ],
1954 [ ac_cv_have_getopt_optreset="yes" ],
1955 [ ac_cv_have_getopt_optreset="no" ]
1956 )
1957])
1958if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1959 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1960fi
Damien Millera22ba012000-03-02 23:09:20 +11001961
Damien Millerecbb26d2000-07-15 14:59:14 +10001962AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001963 AC_TRY_LINK([],
1964 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001965 [ ac_cv_libc_defines_sys_errlist="yes" ],
1966 [ ac_cv_libc_defines_sys_errlist="no" ]
1967 )
1968])
1969if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1970 AC_DEFINE(HAVE_SYS_ERRLIST)
1971fi
1972
1973
Damien Miller11fa2cc2000-08-16 10:35:58 +10001974AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001975 AC_TRY_LINK([],
1976 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001977 [ ac_cv_libc_defines_sys_nerr="yes" ],
1978 [ ac_cv_libc_defines_sys_nerr="no" ]
1979 )
1980])
1981if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1982 AC_DEFINE(HAVE_SYS_NERR)
1983fi
1984
Damien Millera8e06ce2003-11-21 23:48:55 +11001985SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001986# Check whether user wants sectok support
1987AC_ARG_WITH(sectok,
1988 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001989 [
1990 if test "x$withval" != "xno" ; then
1991 if test "x$withval" != "xyes" ; then
1992 CPPFLAGS="$CPPFLAGS -I${withval}"
1993 LDFLAGS="$LDFLAGS -L${withval}"
1994 if test ! -z "$need_dash_r" ; then
1995 LDFLAGS="$LDFLAGS -R${withval}"
1996 fi
1997 if test ! -z "$blibpath" ; then
1998 blibpath="$blibpath:${withval}"
1999 fi
2000 fi
2001 AC_CHECK_HEADERS(sectok.h)
2002 if test "$ac_cv_header_sectok_h" != yes; then
2003 AC_MSG_ERROR(Can't find sectok.h)
2004 fi
2005 AC_CHECK_LIB(sectok, sectok_open)
2006 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2007 AC_MSG_ERROR(Can't find libsectok)
2008 fi
2009 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002010 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002011 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002012 fi
2013 ]
2014)
2015
2016# Check whether user wants OpenSC support
2017AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002018 AC_HELP_STRING([--with-opensc=PFX],
2019 [Enable smartcard support using OpenSC]),
2020 opensc_config_prefix="$withval", opensc_config_prefix="")
2021if test x$opensc_config_prefix != x ; then
2022 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2023 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2024 if test "$OPENSC_CONFIG" != "no"; then
2025 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2026 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2027 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2028 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2029 AC_DEFINE(SMARTCARD)
2030 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002031 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002032 fi
2033fi
Damien Miller85de5802001-09-18 14:01:11 +10002034
Darren Tucker5f88d342003-10-15 16:57:57 +10002035# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002036AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002037 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002038 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002039 # Needed by our getrrsetbyname()
2040 AC_SEARCH_LIBS(res_query, resolv)
2041 AC_SEARCH_LIBS(dn_expand, resolv)
2042 AC_CHECK_FUNCS(_getshort _getlong)
2043 AC_CHECK_MEMBER(HEADER.ad,
2044 [AC_DEFINE(HAVE_HEADER_AD)],,
2045 [#include <arpa/nameser.h>])
2046 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002047
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002048# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002049KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002050AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002051 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002052 [ if test "x$withval" != "xno" ; then
2053 if test "x$withval" = "xyes" ; then
2054 KRB5ROOT="/usr/local"
2055 else
2056 KRB5ROOT=${withval}
2057 fi
2058
2059 AC_DEFINE(KRB5)
2060 KRB5_MSG="yes"
2061
2062 AC_MSG_CHECKING(for krb5-config)
2063 if test -x $KRB5ROOT/bin/krb5-config ; then
2064 KRB5CONF=$KRB5ROOT/bin/krb5-config
2065 AC_MSG_RESULT($KRB5CONF)
2066
2067 AC_MSG_CHECKING(for gssapi support)
2068 if $KRB5CONF | grep gssapi >/dev/null ; then
2069 AC_MSG_RESULT(yes)
2070 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
2071 dnl m4 quadragraphs: "sed 's/-l[^- ]*//g'"
2072 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
2073 K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002074 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002075 AC_MSG_RESULT(no)
2076 K5CFLAGS="`$KRB5CONF --cflags`"
2077 K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
2078 K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002079 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002080 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2081 LDFLAGS="$LDFLAGS $K5LDFLAGS"
2082 AC_MSG_CHECKING(whether we are using Heimdal)
2083 AC_TRY_COMPILE([ #include <krb5.h> ],
2084 [ char *tmp = heimdal_version; ],
2085 [ AC_MSG_RESULT(yes)
2086 AC_DEFINE(HEIMDAL) ],
2087 AC_MSG_RESULT(no)
2088 )
2089 else
2090 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002091 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002092 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002093 AC_MSG_CHECKING(whether we are using Heimdal)
2094 AC_TRY_COMPILE([ #include <krb5.h> ],
2095 [ char *tmp = heimdal_version; ],
2096 [ AC_MSG_RESULT(yes)
2097 AC_DEFINE(HEIMDAL)
2098 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2099 ],
2100 [ AC_MSG_RESULT(no)
2101 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2102 ]
2103 )
Damien Miller200d0a72003-06-30 19:21:36 +10002104 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002105
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002106 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2107 [ AC_DEFINE(GSSAPI)
2108 K5LIBS="-lgssapi $K5LIBS" ],
2109 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2110 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002111 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002112 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2113 $K5LIBS)
2114 ],
2115 $K5LIBS)
2116
2117 AC_CHECK_HEADER(gssapi.h, ,
2118 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002119 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002120 AC_CHECK_HEADERS(gssapi.h, ,
2121 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002122 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002123 ]
2124 )
2125
2126 oldCPP="$CPPFLAGS"
2127 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2128 AC_CHECK_HEADER(gssapi_krb5.h, ,
2129 [ CPPFLAGS="$oldCPP" ])
2130
Damien Millera8e06ce2003-11-21 23:48:55 +11002131 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002132 if test ! -z "$need_dash_r" ; then
2133 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2134 fi
2135 if test ! -z "$blibpath" ; then
2136 blibpath="$blibpath:${KRB5ROOT}/lib"
2137 fi
2138 fi ]
2139 AC_SEARCH_LIBS(k_hasafs, kafs,
Darren Tucker3c78c5e2004-01-23 22:03:10 +11002140 [ AC_DEFINE(USE_AFS)
Darren Tucker1d3ca582004-01-22 12:05:34 +11002141 K5LIBS="-lkafs $K5LIBS"
2142 ]
2143 )
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002144)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002145LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002146
Damien Millera22ba012000-03-02 23:09:20 +11002147# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002148
Damien Millerf58c6722002-05-13 13:15:42 +10002149PRIVSEP_PATH=/var/empty
2150AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002151 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002152 [
2153 if test "x$withval" != "$no" ; then
2154 PRIVSEP_PATH=$withval
2155 fi
2156 ]
2157)
2158AC_SUBST(PRIVSEP_PATH)
2159
Damien Millera22ba012000-03-02 23:09:20 +11002160AC_ARG_WITH(xauth,
2161 [ --with-xauth=PATH Specify path to xauth program ],
2162 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002163 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002164 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002165 fi
2166 ],
2167 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002168 TestPath="$PATH"
2169 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2170 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2171 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2172 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2173 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002174 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002175 xauth_path="/usr/openwin/bin/xauth"
2176 fi
2177 ]
2178)
2179
Damien Miller7d901272003-01-13 16:55:22 +11002180STRIP_OPT=-s
2181AC_ARG_ENABLE(strip,
2182 [ --disable-strip Disable calling strip(1) on install],
2183 [
2184 if test "x$enableval" = "xno" ; then
2185 STRIP_OPT=
2186 fi
2187 ]
2188)
2189AC_SUBST(STRIP_OPT)
2190
Damien Millera19cf472000-11-29 13:28:50 +11002191if test -z "$xauth_path" ; then
2192 XAUTH_PATH="undefined"
2193 AC_SUBST(XAUTH_PATH)
2194else
Damien Millera22ba012000-03-02 23:09:20 +11002195 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002196 XAUTH_PATH=$xauth_path
2197 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002198fi
Damien Millera22ba012000-03-02 23:09:20 +11002199
2200# Check for mail directory (last resort if we cannot get it from headers)
2201if test ! -z "$MAIL" ; then
2202 maildir=`dirname $MAIL`
2203 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2204fi
2205
Damien Millera22ba012000-03-02 23:09:20 +11002206if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002207 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002208 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002209 [
2210 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2211 have_dev_ptmx=1
2212 ]
2213 )
2214 fi
Damien Millera22ba012000-03-02 23:09:20 +11002215fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002216AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002217 [
2218 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2219 have_dev_ptc=1
2220 ]
2221)
2222
Damien Millera22ba012000-03-02 23:09:20 +11002223# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002224AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002225 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002226 [
Damien Miller897741e2001-04-16 10:41:46 +10002227 case "$withval" in
2228 man|cat|doc)
2229 MANTYPE=$withval
2230 ;;
2231 *)
2232 AC_MSG_ERROR(invalid man type: $withval)
2233 ;;
2234 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002235 ]
2236)
Ben Lindstrombc709922001-04-18 18:04:21 +00002237if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002238 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2239 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002240 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2241 MANTYPE=doc
2242 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2243 MANTYPE=man
2244 else
2245 MANTYPE=cat
2246 fi
2247fi
Damien Miller670a4b82000-01-22 13:53:11 +11002248AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002249if test "$MANTYPE" = "doc"; then
2250 mansubdir=man;
2251else
2252 mansubdir=$MANTYPE;
2253fi
2254AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002255
Damien Millera22ba012000-03-02 23:09:20 +11002256# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002257MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002258AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002259 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002260 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002261 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002262 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002263 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002264 fi
2265 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002266)
2267
Damien Millera22ba012000-03-02 23:09:20 +11002268# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002269AC_ARG_WITH(shadow,
2270 [ --without-shadow Disable shadow password support],
2271 [
2272 if test "x$withval" = "xno" ; then
2273 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002274 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002275 fi
2276 ]
2277)
2278
Damien Miller1f335fb2000-06-26 11:31:33 +10002279if test -z "$disable_shadow" ; then
2280 AC_MSG_CHECKING([if the systems has expire shadow information])
2281 AC_TRY_COMPILE(
2282 [
2283#include <sys/types.h>
2284#include <shadow.h>
2285 struct spwd sp;
2286 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2287 [ sp_expire_available=yes ], []
2288 )
2289
2290 if test "x$sp_expire_available" = "xyes" ; then
2291 AC_MSG_RESULT(yes)
2292 AC_DEFINE(HAS_SHADOW_EXPIRE)
2293 else
2294 AC_MSG_RESULT(no)
2295 fi
2296fi
2297
Damien Millera22ba012000-03-02 23:09:20 +11002298# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002299if test ! -z "$IPADDR_IN_DISPLAY" ; then
2300 DISPLAY_HACK_MSG="yes"
2301 AC_DEFINE(IPADDR_IN_DISPLAY)
2302else
Damien Millera8e06ce2003-11-21 23:48:55 +11002303 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002304 AC_ARG_WITH(ipaddr-display,
2305 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2306 [
2307 if test "x$withval" != "xno" ; then
2308 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002309 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002310 fi
2311 ]
2312 )
2313fi
Damien Miller76112de1999-12-21 11:18:08 +11002314
Darren Tuckere1a790d2003-09-16 11:52:19 +10002315# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002316AC_ARG_ENABLE(etc-default-login,
2317 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2318[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002319AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2320
2321if test "x$external_path_file" = "x/etc/default/login"; then
2322 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2323fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002324])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002325
Tim Rice43a1c132002-04-17 21:19:14 -07002326dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2327if test $ac_cv_func_login_getcapbool = "yes" -a \
2328 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002329 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002330fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002331
Damien Millera22ba012000-03-02 23:09:20 +11002332# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002333SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002334AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002335 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002336 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002337 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002338 AC_MSG_WARN([
2339--with-default-path=PATH has no effect on this system.
2340Edit /etc/login.conf instead.])
2341 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002342 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002343 AC_MSG_WARN([
2344--with-default-path=PATH will only be used if PATH is not defined in
2345$external_path_file .])
2346 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002347 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002348 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002349 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002350 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002351 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2352 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002353 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002354 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002355 AC_MSG_WARN([
2356If PATH is defined in $external_path_file, ensure the path to scp is included,
2357otherwise scp will not work.])
2358 fi
2359 AC_TRY_RUN(
2360 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002361/* find out what STDPATH is */
2362#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002363#ifdef HAVE_PATHS_H
2364# include <paths.h>
2365#endif
2366#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002367# ifdef _PATH_USERPATH /* Irix */
2368# define _PATH_STDPATH _PATH_USERPATH
2369# else
2370# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2371# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002372#endif
2373#include <sys/types.h>
2374#include <sys/stat.h>
2375#include <fcntl.h>
2376#define DATA "conftest.stdpath"
2377
2378main()
2379{
2380 FILE *fd;
2381 int rc;
2382
2383 fd = fopen(DATA,"w");
2384 if(fd == NULL)
2385 exit(1);
2386
2387 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2388 exit(1);
2389
2390 exit(0);
2391}
2392 ], [ user_path=`cat conftest.stdpath` ],
2393 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2394 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2395 )
2396# make sure $bindir is in USER_PATH so scp will work
2397 t_bindir=`eval echo ${bindir}`
2398 case $t_bindir in
2399 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2400 esac
2401 case $t_bindir in
2402 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2403 esac
2404 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2405 if test $? -ne 0 ; then
2406 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2407 if test $? -ne 0 ; then
2408 user_path=$user_path:$t_bindir
2409 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2410 fi
2411 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002412 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002413)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002414if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002415 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2416 AC_SUBST(user_path)
2417fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002418
Damien Millera18bbd32002-05-13 10:48:57 +10002419# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002420AC_ARG_WITH(superuser-path,
2421 [ --with-superuser-path= Specify different path for super-user],
2422 [
2423 if test "x$withval" != "xno" ; then
2424 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2425 superuser_path=$withval
2426 fi
2427 ]
2428)
2429
2430
Damien Miller61e50f12000-05-08 20:49:37 +10002431AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002432IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002433AC_ARG_WITH(4in6,
2434 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2435 [
2436 if test "x$withval" != "xno" ; then
2437 AC_MSG_RESULT(yes)
2438 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002439 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002440 else
2441 AC_MSG_RESULT(no)
2442 fi
2443 ],[
2444 if test "x$inet6_default_4in6" = "xyes"; then
2445 AC_MSG_RESULT([yes (default)])
2446 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002447 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002448 else
2449 AC_MSG_RESULT([no (default)])
2450 fi
2451 ]
2452)
2453
Damien Miller60396b02001-02-18 17:01:00 +11002454# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002455BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002456AC_ARG_WITH(bsd-auth,
2457 [ --with-bsd-auth Enable BSD auth support],
2458 [
2459 if test "x$withval" != "xno" ; then
2460 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002461 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002462 fi
2463 ]
2464)
2465
Damien Millera22ba012000-03-02 23:09:20 +11002466# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002467piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002468# make sure the directory exists
2469if test ! -d $piddir ; then
2470 piddir=`eval echo ${sysconfdir}`
2471 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002472 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002473 esac
2474fi
2475
Tim Rice88f2ab52002-03-17 12:17:34 -08002476AC_ARG_WITH(pid-dir,
2477 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2478 [
2479 if test "x$withval" != "xno" ; then
2480 piddir=$withval
2481 if test ! -d $piddir ; then
2482 AC_MSG_WARN([** no $piddir directory on this system **])
2483 fi
2484 fi
2485 ]
2486)
2487
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002488AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002489AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002490
andre2ff7b5d2000-06-03 14:57:40 +00002491dnl allow user to disable some login recording features
2492AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002493 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002494 [
2495 if test "x$enableval" = "xno" ; then
2496 AC_DEFINE(DISABLE_LASTLOG)
2497 fi
2498 ]
andre2ff7b5d2000-06-03 14:57:40 +00002499)
2500AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002501 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002502 [
2503 if test "x$enableval" = "xno" ; then
2504 AC_DEFINE(DISABLE_UTMP)
2505 fi
2506 ]
andre2ff7b5d2000-06-03 14:57:40 +00002507)
2508AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002509 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002510 [
2511 if test "x$enableval" = "xno" ; then
2512 AC_DEFINE(DISABLE_UTMPX)
2513 fi
2514 ]
andre2ff7b5d2000-06-03 14:57:40 +00002515)
2516AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002517 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002518 [
2519 if test "x$enableval" = "xno" ; then
2520 AC_DEFINE(DISABLE_WTMP)
2521 fi
2522 ]
andre2ff7b5d2000-06-03 14:57:40 +00002523)
2524AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002525 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002526 [
2527 if test "x$enableval" = "xno" ; then
2528 AC_DEFINE(DISABLE_WTMPX)
2529 fi
2530 ]
andre2ff7b5d2000-06-03 14:57:40 +00002531)
2532AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002533 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002534 [
2535 if test "x$enableval" = "xno" ; then
2536 AC_DEFINE(DISABLE_LOGIN)
2537 fi
2538 ]
andre2ff7b5d2000-06-03 14:57:40 +00002539)
2540AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002541 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002542 [
2543 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002544 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002545 fi
2546 ]
andre2ff7b5d2000-06-03 14:57:40 +00002547)
2548AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002549 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002550 [
2551 if test "x$enableval" = "xno" ; then
2552 AC_DEFINE(DISABLE_PUTUTXLINE)
2553 fi
2554 ]
andre2ff7b5d2000-06-03 14:57:40 +00002555)
2556AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002557 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002558 [
2559 if test "x$withval" = "xno" ; then
2560 AC_DEFINE(DISABLE_LASTLOG)
2561 else
2562 conf_lastlog_location=$withval
2563 fi
2564 ]
2565)
andre2ff7b5d2000-06-03 14:57:40 +00002566
2567dnl lastlog, [uw]tmpx? detection
2568dnl NOTE: set the paths in the platform section to avoid the
2569dnl need for command-line parameters
2570dnl lastlog and [uw]tmp are subject to a file search if all else fails
2571
2572dnl lastlog detection
2573dnl NOTE: the code itself will detect if lastlog is a directory
2574AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2575AC_TRY_COMPILE([
2576#include <sys/types.h>
2577#include <utmp.h>
2578#ifdef HAVE_LASTLOG_H
2579# include <lastlog.h>
2580#endif
Damien Miller2994e082000-06-04 15:51:47 +10002581#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002582# include <paths.h>
2583#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002584#ifdef HAVE_LOGIN_H
2585# include <login.h>
2586#endif
andre2ff7b5d2000-06-03 14:57:40 +00002587 ],
2588 [ char *lastlog = LASTLOG_FILE; ],
2589 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002590 [
2591 AC_MSG_RESULT(no)
2592 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2593 AC_TRY_COMPILE([
2594#include <sys/types.h>
2595#include <utmp.h>
2596#ifdef HAVE_LASTLOG_H
2597# include <lastlog.h>
2598#endif
2599#ifdef HAVE_PATHS_H
2600# include <paths.h>
2601#endif
2602 ],
2603 [ char *lastlog = _PATH_LASTLOG; ],
2604 [ AC_MSG_RESULT(yes) ],
2605 [
andree441aa32000-06-12 22:34:38 +00002606 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002607 system_lastlog_path=no
2608 ])
2609 ]
andre2ff7b5d2000-06-03 14:57:40 +00002610)
Damien Miller2994e082000-06-04 15:51:47 +10002611
andre2ff7b5d2000-06-03 14:57:40 +00002612if test -z "$conf_lastlog_location"; then
2613 if test x"$system_lastlog_path" = x"no" ; then
2614 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002615 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002616 conf_lastlog_location=$f
2617 fi
2618 done
2619 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002620 AC_MSG_WARN([** Cannot find lastlog **])
2621 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002622 fi
2623 fi
2624fi
2625
2626if test -n "$conf_lastlog_location"; then
2627 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2628fi
2629
2630dnl utmp detection
2631AC_MSG_CHECKING([if your system defines UTMP_FILE])
2632AC_TRY_COMPILE([
2633#include <sys/types.h>
2634#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002635#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002636# include <paths.h>
2637#endif
2638 ],
2639 [ char *utmp = UTMP_FILE; ],
2640 [ AC_MSG_RESULT(yes) ],
2641 [ AC_MSG_RESULT(no)
2642 system_utmp_path=no ]
2643)
2644if test -z "$conf_utmp_location"; then
2645 if test x"$system_utmp_path" = x"no" ; then
2646 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2647 if test -f $f ; then
2648 conf_utmp_location=$f
2649 fi
2650 done
2651 if test -z "$conf_utmp_location"; then
2652 AC_DEFINE(DISABLE_UTMP)
2653 fi
2654 fi
2655fi
2656if test -n "$conf_utmp_location"; then
2657 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2658fi
2659
2660dnl wtmp detection
2661AC_MSG_CHECKING([if your system defines WTMP_FILE])
2662AC_TRY_COMPILE([
2663#include <sys/types.h>
2664#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002665#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002666# include <paths.h>
2667#endif
2668 ],
2669 [ char *wtmp = WTMP_FILE; ],
2670 [ AC_MSG_RESULT(yes) ],
2671 [ AC_MSG_RESULT(no)
2672 system_wtmp_path=no ]
2673)
2674if test -z "$conf_wtmp_location"; then
2675 if test x"$system_wtmp_path" = x"no" ; then
2676 for f in /usr/adm/wtmp /var/log/wtmp; do
2677 if test -f $f ; then
2678 conf_wtmp_location=$f
2679 fi
2680 done
2681 if test -z "$conf_wtmp_location"; then
2682 AC_DEFINE(DISABLE_WTMP)
2683 fi
2684 fi
2685fi
2686if test -n "$conf_wtmp_location"; then
2687 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2688fi
2689
2690
2691dnl utmpx detection - I don't know any system so perverse as to require
2692dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2693dnl there, though.
2694AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2695AC_TRY_COMPILE([
2696#include <sys/types.h>
2697#include <utmp.h>
2698#ifdef HAVE_UTMPX_H
2699#include <utmpx.h>
2700#endif
Damien Miller2994e082000-06-04 15:51:47 +10002701#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002702# include <paths.h>
2703#endif
2704 ],
2705 [ char *utmpx = UTMPX_FILE; ],
2706 [ AC_MSG_RESULT(yes) ],
2707 [ AC_MSG_RESULT(no)
2708 system_utmpx_path=no ]
2709)
2710if test -z "$conf_utmpx_location"; then
2711 if test x"$system_utmpx_path" = x"no" ; then
2712 AC_DEFINE(DISABLE_UTMPX)
2713 fi
2714else
2715 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2716fi
2717
2718dnl wtmpx detection
2719AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2720AC_TRY_COMPILE([
2721#include <sys/types.h>
2722#include <utmp.h>
2723#ifdef HAVE_UTMPX_H
2724#include <utmpx.h>
2725#endif
Damien Miller2994e082000-06-04 15:51:47 +10002726#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002727# include <paths.h>
2728#endif
2729 ],
2730 [ char *wtmpx = WTMPX_FILE; ],
2731 [ AC_MSG_RESULT(yes) ],
2732 [ AC_MSG_RESULT(no)
2733 system_wtmpx_path=no ]
2734)
2735if test -z "$conf_wtmpx_location"; then
2736 if test x"$system_wtmpx_path" = x"no" ; then
2737 AC_DEFINE(DISABLE_WTMPX)
2738 fi
2739else
2740 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2741fi
2742
Damien Miller4018c192000-04-30 09:30:44 +10002743
Damien Miller29ea30d2000-03-17 10:54:15 +11002744if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002745 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2746 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002747fi
2748
Tim Rice4cec93f2002-02-26 08:40:48 -08002749dnl remove pam and dl because they are in $LIBPAM
2750if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002751 LIBS=`echo $LIBS | sed 's/-lpam //'`
2752fi
2753if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2754 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002755fi
2756
Damien Millerbac2d8a2000-09-05 16:13:06 +11002757AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002758AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2759AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002760
Damien Miller7b22d652000-06-18 14:07:04 +10002761# Print summary of options
2762
Damien Miller7b22d652000-06-18 14:07:04 +10002763# Someone please show me a better way :)
2764A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2765B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2766C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2767D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002768E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002769F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002770G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002771H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2772I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2773J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002774
2775echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002776echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002777echo " User binaries: $B"
2778echo " System binaries: $C"
2779echo " Configuration files: $D"
2780echo " Askpass program: $E"
2781echo " Manual pages: $F"
2782echo " PID file: $G"
2783echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002784if test "x$external_path_file" = "x/etc/login.conf" ; then
2785echo " At runtime, sshd will use the path defined in $external_path_file"
2786echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002787else
Damien Millerf58c6722002-05-13 13:15:42 +10002788echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002789 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002790echo " (If PATH is set in $external_path_file it will be used instead. If"
2791echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2792 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002793fi
Damien Millera18bbd32002-05-13 10:48:57 +10002794if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002795echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002796fi
Damien Millerf58c6722002-05-13 13:15:42 +10002797echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002798echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002799echo " KerberosV support: $KRB5_MSG"
2800echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002801echo " S/KEY support: $SKEY_MSG"
2802echo " TCP Wrappers support: $TCPW_MSG"
2803echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002804echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002805echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2806echo " BSD Auth support: $BSD_AUTH_MSG"
2807echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002808if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002809echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002810fi
2811
Damien Miller7b22d652000-06-18 14:07:04 +10002812echo ""
2813
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002814echo " Host: ${host}"
2815echo " Compiler: ${CC}"
2816echo " Compiler flags: ${CFLAGS}"
2817echo "Preprocessor flags: ${CPPFLAGS}"
2818echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002819echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002820
2821echo ""
2822
Damien Miller82cf0ce2000-12-20 13:34:48 +11002823if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002824 echo "PAM is enabled. You may need to install a PAM control file "
2825 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002826 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002827 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002828 echo ""
2829fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002830
Damien Miller6c21c512002-01-22 21:57:53 +11002831if test ! -z "$RAND_HELPER_CMDHASH" ; then
2832 echo "WARNING: you are using the builtin random number collection "
2833 echo "service. Please read WARNING.RNG and request that your OS "
2834 echo "vendor includes kernel-based random number collection in "
2835 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002836 echo ""
2837fi
Damien Miller60396b02001-02-18 17:01:00 +11002838