blob: 97ef89a1653c259f471f031bd216c1848e734b08 [file] [log] [blame]
Darren Tucker2df33432004-01-30 14:34:21 +11001# $Id: configure.ac,v 1.191 2004/01/30 03:34:22 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*)
Darren Tucker2df33432004-01-30 14:34:21 +1100363 AC_DEFINE(NO_SSH_LASTLOG)
364 AC_DEFINE(SETEUID_BREAKS_SETUID)
365 AC_DEFINE(BROKEN_SETREUID)
366 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000367 AC_DEFINE(USE_PIPES)
368 AC_DEFINE(DISABLE_FD_PASSING)
369 LDFLAGS="$LDFLAGS"
370 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
371 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000372 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000373*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100374 AC_DEFINE(SETEUID_BREAKS_SETUID)
375 AC_DEFINE(BROKEN_SETREUID)
376 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000377 AC_DEFINE(WITH_ABBREV_NO_TTY)
378 AC_DEFINE(USE_PIPES)
379 AC_DEFINE(DISABLE_FD_PASSING)
380 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100381 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000382 MANTYPE=cat
383 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000384*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100385 AC_DEFINE(SETEUID_BREAKS_SETUID)
386 AC_DEFINE(BROKEN_SETREUID)
387 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000388 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700389 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700390 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000391 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
392 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
393 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700394 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000395*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000396 AC_MSG_CHECKING(for Digital Unix SIA)
397 no_osfsia=""
398 AC_ARG_WITH(osfsia,
399 [ --with-osfsia Enable Digital Unix SIA],
400 [
401 if test "x$withval" = "xno" ; then
402 AC_MSG_RESULT(disabled)
403 no_osfsia=1
404 fi
405 ],
406 )
407 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000408 if test -f /etc/sia/matrix.conf; then
409 AC_MSG_RESULT(yes)
410 AC_DEFINE(HAVE_OSF_SIA)
411 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000412 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000413 LIBS="$LIBS -lsecurity -ldb -lm -laud"
414 else
415 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100416 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000417 fi
418 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000419 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700420 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000421 AC_DEFINE(BROKEN_SETREUID)
422 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000423 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000424
425*-*-nto-qnx)
426 AC_DEFINE(USE_PIPES)
427 AC_DEFINE(NO_X11_UNIX_SOCKETS)
428 AC_DEFINE(MISSING_NFDBITS)
429 AC_DEFINE(MISSING_HOWMANY)
430 AC_DEFINE(MISSING_FD_MASK)
431 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100432esac
433
Damien Millere37bfc12000-06-05 09:37:43 +1000434# Allow user to specify flags
435AC_ARG_WITH(cflags,
436 [ --with-cflags Specify additional flags to pass to compiler],
437 [
438 if test "x$withval" != "xno" ; then
439 CFLAGS="$CFLAGS $withval"
440 fi
441 ]
442)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000443AC_ARG_WITH(cppflags,
444 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
445 [
446 if test "x$withval" != "xno"; then
447 CPPFLAGS="$CPPFLAGS $withval"
448 fi
449 ]
450)
Damien Millere37bfc12000-06-05 09:37:43 +1000451AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000452 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000453 [
454 if test "x$withval" != "xno" ; then
455 LDFLAGS="$LDFLAGS $withval"
456 fi
457 ]
458)
459AC_ARG_WITH(libs,
460 [ --with-libs Specify additional libraries to link with],
461 [
462 if test "x$withval" != "xno" ; then
463 LIBS="$LIBS $withval"
464 fi
465 ]
466)
467
Darren Tucker6eb93042003-06-29 21:30:41 +1000468AC_MSG_CHECKING(compiler and flags for sanity)
469AC_TRY_RUN([
470#include <stdio.h>
471int main(){exit(0);}
472 ],
473 [ AC_MSG_RESULT(yes) ],
474 [
475 AC_MSG_RESULT(no)
476 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
477 ]
478)
479
Tim Rice4cec93f2002-02-26 08:40:48 -0800480# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000481AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000482 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800483 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100484 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000485 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000486 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
Tim Rice2597bfd2004-01-26 19:03:39 -0800487 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 +0000488 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700489 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Damien Miller5c3a5582003-09-23 22:12:38 +1000490 util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800491
Damien Millera22ba012000-03-02 23:09:20 +1100492# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700493AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
494AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000495
Damien Millerdf288022001-02-18 13:07:07 +1100496dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700497if test "x$with_tcp_wrappers" != "xno" ; then
498 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
499 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
500 fi
501fi
Damien Millerdf288022001-02-18 13:07:07 +1100502
Tim Rice1e1ef642003-09-11 22:19:31 -0700503dnl IRIX and Solaris 2.5.1 have dirname() in libgen
504AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
505 AC_CHECK_LIB(gen, dirname,[
506 AC_CACHE_CHECK([for broken dirname],
507 ac_cv_have_broken_dirname, [
508 save_LIBS="$LIBS"
509 LIBS="$LIBS -lgen"
510 AC_TRY_RUN(
511 [
512#include <libgen.h>
513#include <string.h>
514
515int main(int argc, char **argv) {
516 char *s, buf[32];
517
518 strncpy(buf,"/etc", 32);
519 s = dirname(buf);
520 if (!s || strncmp(s, "/", 32) != 0) {
521 exit(1);
522 } else {
523 exit(0);
524 }
525}
526 ],
527 [ ac_cv_have_broken_dirname="no" ],
528 [ ac_cv_have_broken_dirname="yes" ]
529 )
530 LIBS="$save_LIBS"
531 ])
532 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
533 LIBS="$LIBS -lgen"
534 AC_DEFINE(HAVE_DIRNAME)
535 AC_CHECK_HEADERS(libgen.h)
536 fi
537 ])
538])
539
540AC_CHECK_FUNC(getspnam, ,
541 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
542AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
543
Tim Rice13aae5e2001-10-21 17:53:58 -0700544dnl zlib is required
545AC_ARG_WITH(zlib,
546 [ --with-zlib=PATH Use zlib in PATH],
547 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000548 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100549 AC_MSG_ERROR([*** zlib is required ***])
550 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700551 if test -d "$withval/lib"; then
552 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700553 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700554 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700555 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700556 fi
557 else
558 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700559 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700560 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700561 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700562 fi
563 fi
564 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700565 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700566 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700567 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700568 fi
569 ]
570)
571
Tim Ricefcb62202004-01-23 18:35:16 -0800572AC_CHECK_LIB(z, deflate, ,
573 [
574 saved_CPPFLAGS="$CPPFLAGS"
575 saved_LDFLAGS="$LDFLAGS"
576 save_LIBS="$LIBS"
577 dnl Check default zlib install dir
578 if test -n "${need_dash_r}"; then
579 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
580 else
581 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
582 fi
583 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
584 LIBS="$LIBS -lz"
585 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
586 [
587 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
588 ]
589 )
590 ]
591)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100592AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100593
594AC_ARG_WITH(zlib-version-check,
595 [ --without-zlib-version-check Disable zlib version check],
596 [ if test "x$withval" = "xno" ; then
597 zlib_check_nonfatal=1
598 fi
599 ]
600)
601
Darren Tucker2dcd2392004-01-23 17:13:33 +1100602AC_MSG_CHECKING(for zlib 1.1.4 or greater)
603AC_TRY_RUN([
604#include <zlib.h>
605int main()
606{
607 int a, b, c, v;
608 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
609 exit(1);
610 v = a*1000000 + b*1000 + c;
611 if (v >= 1001004)
612 exit(0);
613 exit(2);
614}
615 ],
616 AC_MSG_RESULT(yes),
617 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100618 if test -z "$zlib_check_nonfatal" ; then
619 AC_MSG_ERROR([*** zlib too old - check config.log ***
620Your reported zlib version has known security problems. It's possible your
621vendor has fixed these problems without changing the version number. If you
622are sure this is the case, you can disable the check by running
623"./configure --without-zlib-version-check".
624If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
625 else
626 AC_MSG_WARN([zlib version may have security problems])
627 fi
628 ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100629)
Damien Miller6f9c3372000-10-25 10:06:04 +1100630
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000631dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100632AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000633 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
634)
Damien Millera8e06ce2003-11-21 23:48:55 +1100635AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700636 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
637 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000638)
Damien Millerab18c411999-11-11 10:40:23 +1100639
Tim Ricee589a292001-11-03 11:09:32 -0800640dnl Checks for libutil functions
641AC_CHECK_HEADERS(libutil.h)
642AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
643AC_CHECK_FUNCS(logout updwtmp logwtmp)
644
Ben Lindstrom8697e082001-02-24 21:41:10 +0000645AC_FUNC_STRFTIME
646
Damien Miller3c027682001-03-14 11:39:45 +1100647# Check for ALTDIRFUNC glob() extension
648AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
649AC_EGREP_CPP(FOUNDIT,
650 [
651 #include <glob.h>
652 #ifdef GLOB_ALTDIRFUNC
653 FOUNDIT
654 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100655 ],
Damien Miller3c027682001-03-14 11:39:45 +1100656 [
657 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
658 AC_MSG_RESULT(yes)
659 ],
660 [
661 AC_MSG_RESULT(no)
662 ]
663)
Damien Millerab18c411999-11-11 10:40:23 +1100664
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000665# Check for g.gl_matchc glob() extension
666AC_MSG_CHECKING(for gl_matchc field in glob_t)
667AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100668 [
669 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000670 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100671 ],
672 [
673 AC_DEFINE(GLOB_HAS_GL_MATCHC)
674 AC_MSG_RESULT(yes)
675 ],
676 [
677 AC_MSG_RESULT(no)
678 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000679)
680
Damien Miller18bb4732001-03-28 14:35:30 +1000681AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
682AC_TRY_RUN(
683 [
684#include <sys/types.h>
685#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700686int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000687 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100688 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000689 [
690 AC_MSG_RESULT(no)
691 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
692 ]
693)
694
Damien Millerc547bf12001-02-16 10:18:12 +1100695# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100696SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100697AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700698 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100699 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100700 [
701 if test "x$withval" != "xno" ; then
702
703 if test "x$withval" != "xyes" ; then
704 CPPFLAGS="$CPPFLAGS -I${withval}/include"
705 LDFLAGS="$LDFLAGS -L${withval}/lib"
706 fi
707
708 AC_DEFINE(SKEY)
709 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100710 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100711
Tim Rice4cec93f2002-02-26 08:40:48 -0800712 AC_MSG_CHECKING([for s/key support])
713 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100714 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800715#include <stdio.h>
716#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700717int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800718 ],
719 [AC_MSG_RESULT(yes)],
720 [
721 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100722 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
723 ])
724 fi
725 ]
726)
727
728# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700729TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100730AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700731 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100732 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100733 [
734 if test "x$withval" != "xno" ; then
735 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700736 saved_LDFLAGS="$LDFLAGS"
737 saved_CPPFLAGS="$CPPFLAGS"
738 if test -n "${withval}" -a "${withval}" != "yes"; then
739 if test -d "${withval}/lib"; then
740 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700741 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700742 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700743 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700744 fi
745 else
746 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700747 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700748 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700749 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700750 fi
751 fi
752 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700753 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700754 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700755 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700756 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700757 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800758 LIBWRAP="-lwrap"
759 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100760 AC_MSG_CHECKING(for libwrap)
761 AC_TRY_LINK(
762 [
763#include <tcpd.h>
764 int deny_severity = 0, allow_severity = 0;
765 ],
766 [hosts_access(0);],
767 [
768 AC_MSG_RESULT(yes)
769 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800770 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700771 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100772 ],
773 [
774 AC_MSG_ERROR([*** libwrap missing])
775 ]
776 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800777 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100778 fi
779 ]
780)
781
Damien Millerfe1f1432003-02-24 15:45:42 +1100782dnl Checks for library functions. Please keep in alphabetical order
783AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000784 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000785 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000786 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000787 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100788 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000789 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
790 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
791 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100792 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000793 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000794 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000795 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100796)
Tim Rice13aae5e2001-10-21 17:53:58 -0700797
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000798# IRIX has a const char return value for gai_strerror()
799AC_CHECK_FUNCS(gai_strerror,[
800 AC_DEFINE(HAVE_GAI_STRERROR)
801 AC_TRY_COMPILE([
802#include <sys/types.h>
803#include <sys/socket.h>
804#include <netdb.h>
805
806const char *gai_strerror(int);],[
807char *str;
808
809str = gai_strerror(0);],[
810 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
811 [Define if gai_strerror() returns const char *])])])
812
Damien Millercd6853c2003-01-28 11:33:42 +1100813AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
814
Darren Tuckerf1159b52003-07-07 19:44:01 +1000815dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000816AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000817AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000818
Darren Tuckerb2427c82003-09-10 15:22:44 +1000819dnl tcsendbreak might be a macro
820AC_CHECK_DECL(tcsendbreak,
821 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100822 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000823 [#include <termios.h>]
824)
825
Darren Tucker2a6b0292003-12-31 14:59:17 +1100826AC_CHECK_FUNCS(setresuid, [
827 dnl Some platorms have setresuid that isn't implemented, test for this
828 AC_MSG_CHECKING(if setresuid seems to work)
829 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100830#include <stdlib.h>
831#include <errno.h>
832int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100833 ],
834 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100835 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100836 AC_MSG_RESULT(not implemented)]
837 )
838])
Darren Tuckere937be32003-12-17 18:53:26 +1100839
Darren Tucker2a6b0292003-12-31 14:59:17 +1100840AC_CHECK_FUNCS(setresgid, [
841 dnl Some platorms have setresgid that isn't implemented, test for this
842 AC_MSG_CHECKING(if setresgid seems to work)
843 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100844#include <stdlib.h>
845#include <errno.h>
846int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100847 ],
848 [AC_MSG_RESULT(yes)],
849 [AC_DEFINE(BROKEN_SETRESGID)
850 AC_MSG_RESULT(not implemented)]
851 )
852])
Darren Tuckere937be32003-12-17 18:53:26 +1100853
Damien Millerad833b32000-08-23 10:46:23 +1000854dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000855AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000856dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000857AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000858AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000859dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000860AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000861AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100862
Damien Millera8e06ce2003-11-21 23:48:55 +1100863AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100864 [AC_DEFINE(HAVE_DAEMON)],
865 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
866)
867
Damien Millera8e06ce2003-11-21 23:48:55 +1100868AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100869 [AC_DEFINE(HAVE_GETPAGESIZE)],
870 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
871)
872
Damien Millercb170cb2000-07-01 16:52:55 +1000873# Check for broken snprintf
874if test "x$ac_cv_func_snprintf" = "xyes" ; then
875 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
876 AC_TRY_RUN(
877 [
878#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700879int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000880 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100881 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000882 [
883 AC_MSG_RESULT(no)
884 AC_DEFINE(BROKEN_SNPRINTF)
885 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
886 ]
887 )
888fi
889
Damien Millere8328192003-01-07 15:18:32 +1100890dnl see whether mkstemp() requires XXXXXX
891if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
892AC_MSG_CHECKING([for (overly) strict mkstemp])
893AC_TRY_RUN(
894 [
895#include <stdlib.h>
896main() { char template[]="conftest.mkstemp-test";
897if (mkstemp(template) == -1)
898 exit(1);
899unlink(template); exit(0);
900}
901 ],
902 [
903 AC_MSG_RESULT(no)
904 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100905 [
Damien Millere8328192003-01-07 15:18:32 +1100906 AC_MSG_RESULT(yes)
907 AC_DEFINE(HAVE_STRICT_MKSTEMP)
908 ],
909 [
910 AC_MSG_RESULT(yes)
911 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100912 ]
Damien Millere8328192003-01-07 15:18:32 +1100913)
914fi
915
Darren Tucker70a3d552003-08-21 17:58:29 +1000916dnl make sure that openpty does not reacquire controlling terminal
917if test ! -z "$check_for_openpty_ctty_bug"; then
918 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
919 AC_TRY_RUN(
920 [
921#include <stdio.h>
922#include <sys/fcntl.h>
923#include <sys/types.h>
924#include <sys/wait.h>
925
926int
927main()
928{
929 pid_t pid;
930 int fd, ptyfd, ttyfd, status;
931
932 pid = fork();
933 if (pid < 0) { /* failed */
934 exit(1);
935 } else if (pid > 0) { /* parent */
936 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100937 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000938 exit(WEXITSTATUS(status));
939 else
940 exit(2);
941 } else { /* child */
942 close(0); close(1); close(2);
943 setsid();
944 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
945 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
946 if (fd >= 0)
947 exit(3); /* Acquired ctty: broken */
948 else
949 exit(0); /* Did not acquire ctty: OK */
950 }
951}
952 ],
953 [
954 AC_MSG_RESULT(yes)
955 ],
956 [
957 AC_MSG_RESULT(no)
958 AC_DEFINE(SSHD_ACQUIRES_CTTY)
959 ]
960 )
961fi
962
Damien Miller606f8802000-09-16 15:39:56 +1100963AC_FUNC_GETPGRP
964
Damien Millera64b57a2001-01-17 10:44:13 +1100965# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000966PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100967AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100968 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100969 [
Damien Millera64b57a2001-01-17 10:44:13 +1100970 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100971 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
972 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100973 AC_MSG_ERROR([PAM headers not found])
974 fi
975
976 AC_CHECK_LIB(dl, dlopen, , )
977 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
978 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000979 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100980
Damien Millera64b57a2001-01-17 10:44:13 +1100981 PAM_MSG="yes"
982
983 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800984 if test $ac_cv_lib_dl_dlopen = yes; then
985 LIBPAM="-lpam -ldl"
986 else
987 LIBPAM="-lpam"
988 fi
989 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100990 fi
991 ]
992)
Damien Millera22ba012000-03-02 23:09:20 +1100993
Damien Millera64b57a2001-01-17 10:44:13 +1100994# Check for older PAM
995if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100996 # Check PAM strerror arguments (old PAM)
997 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
998 AC_TRY_COMPILE(
999 [
Damien Miller81171112000-04-23 11:14:01 +10001000#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001001#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001002#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001003#elif defined (HAVE_PAM_PAM_APPL_H)
1004#include <pam/pam_appl.h>
1005#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001006 ],
1007 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001008 [AC_MSG_RESULT(no)],
1009 [
1010 AC_DEFINE(HAVE_OLD_PAM)
1011 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001012 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001013 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001014 )
Damien Millera22ba012000-03-02 23:09:20 +11001015fi
1016
Damien Millerfc93d4b2002-09-04 23:26:29 +10001017# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1018# because the system crypt() is more featureful.
1019if test "x$check_for_libcrypt_before" = "x1"; then
1020 AC_CHECK_LIB(crypt, crypt)
1021fi
1022
Tim Riceaef73712002-05-11 13:17:42 -07001023# Search for OpenSSL
1024saved_CPPFLAGS="$CPPFLAGS"
1025saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001026AC_ARG_WITH(ssl-dir,
1027 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1028 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001029 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001030 if test -d "$withval/lib"; then
1031 if test -n "${need_dash_r}"; then
1032 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1033 else
1034 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1035 fi
1036 else
1037 if test -n "${need_dash_r}"; then
1038 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1039 else
1040 LDFLAGS="-L${withval} ${LDFLAGS}"
1041 fi
1042 fi
1043 if test -d "$withval/include"; then
1044 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1045 else
1046 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1047 fi
Damien Millera22ba012000-03-02 23:09:20 +11001048 fi
1049 ]
1050)
Tim Riceaef73712002-05-11 13:17:42 -07001051LIBS="$LIBS -lcrypto"
1052AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001053 [
Tim Riceaef73712002-05-11 13:17:42 -07001054 dnl Check default openssl install dir
1055 if test -n "${need_dash_r}"; then
1056 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001057 else
Tim Riceaef73712002-05-11 13:17:42 -07001058 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001059 fi
Tim Riceaef73712002-05-11 13:17:42 -07001060 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1061 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1062 [
1063 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1064 ]
1065 )
1066 ]
1067)
1068
Tim Riced730b782002-08-13 18:52:10 -07001069# Determine OpenSSL header version
1070AC_MSG_CHECKING([OpenSSL header version])
1071AC_TRY_RUN(
1072 [
1073#include <stdio.h>
1074#include <string.h>
1075#include <openssl/opensslv.h>
1076#define DATA "conftest.sslincver"
1077int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001078 FILE *fd;
1079 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001080
Damien Millera8e06ce2003-11-21 23:48:55 +11001081 fd = fopen(DATA,"w");
1082 if(fd == NULL)
1083 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001084
1085 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1086 exit(1);
1087
1088 exit(0);
1089}
1090 ],
1091 [
1092 ssl_header_ver=`cat conftest.sslincver`
1093 AC_MSG_RESULT($ssl_header_ver)
1094 ],
1095 [
1096 AC_MSG_RESULT(not found)
1097 AC_MSG_ERROR(OpenSSL version header not found.)
1098 ]
1099)
1100
1101# Determine OpenSSL library version
1102AC_MSG_CHECKING([OpenSSL library version])
1103AC_TRY_RUN(
1104 [
1105#include <stdio.h>
1106#include <string.h>
1107#include <openssl/opensslv.h>
1108#include <openssl/crypto.h>
1109#define DATA "conftest.ssllibver"
1110int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001111 FILE *fd;
1112 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001113
Damien Millera8e06ce2003-11-21 23:48:55 +11001114 fd = fopen(DATA,"w");
1115 if(fd == NULL)
1116 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001117
1118 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1119 exit(1);
1120
1121 exit(0);
1122}
1123 ],
1124 [
1125 ssl_library_ver=`cat conftest.ssllibver`
1126 AC_MSG_RESULT($ssl_library_ver)
1127 ],
1128 [
1129 AC_MSG_RESULT(not found)
1130 AC_MSG_ERROR(OpenSSL library not found.)
1131 ]
1132)
Damien Millera22ba012000-03-02 23:09:20 +11001133
Damien Millerec932372002-01-22 22:16:03 +11001134# Sanity check OpenSSL headers
1135AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1136AC_TRY_RUN(
1137 [
1138#include <string.h>
1139#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001140int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001141 ],
1142 [
1143 AC_MSG_RESULT(yes)
1144 ],
1145 [
1146 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001147 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1148Check config.log for details.
1149Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001150 ]
1151)
1152
Damien Millera8e06ce2003-11-21 23:48:55 +11001153# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001154# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001155if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001156 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001157fi
1158
Damien Miller6c21c512002-01-22 21:57:53 +11001159
1160### Configure cryptographic random number support
1161
1162# Check wheter OpenSSL seeds itself
1163AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1164AC_TRY_RUN(
1165 [
1166#include <string.h>
1167#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001168int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001169 ],
1170 [
1171 OPENSSL_SEEDS_ITSELF=yes
1172 AC_MSG_RESULT(yes)
1173 ],
1174 [
1175 AC_MSG_RESULT(no)
1176 # Default to use of the rand helper if OpenSSL doesn't
1177 # seed itself
1178 USE_RAND_HELPER=yes
1179 ]
1180)
1181
1182
1183# Do we want to force the use of the rand helper?
1184AC_ARG_WITH(rand-helper,
1185 [ --with-rand-helper Use subprocess to gather strong randomness ],
1186 [
1187 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001188 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001189 # the previous test showed it to be unseeded.
1190 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1191 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1192 OPENSSL_SEEDS_ITSELF=yes
1193 USE_RAND_HELPER=""
1194 fi
1195 else
1196 USE_RAND_HELPER=yes
1197 fi
1198 ],
1199)
1200
1201# Which randomness source do we use?
1202if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1203 # OpenSSL only
1204 AC_DEFINE(OPENSSL_PRNG_ONLY)
1205 RAND_MSG="OpenSSL internal ONLY"
1206 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001207elif test ! -z "$USE_RAND_HELPER" ; then
1208 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001209 RAND_MSG="ssh-rand-helper"
1210 INSTALL_SSH_RAND_HELPER="yes"
1211fi
1212AC_SUBST(INSTALL_SSH_RAND_HELPER)
1213
1214### Configuration of ssh-rand-helper
1215
1216# PRNGD TCP socket
1217AC_ARG_WITH(prngd-port,
1218 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1219 [
Damien Millere996d722002-01-23 11:20:59 +11001220 case "$withval" in
1221 no)
1222 withval=""
1223 ;;
1224 [[0-9]]*)
1225 ;;
1226 *)
1227 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1228 ;;
1229 esac
1230 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001231 PRNGD_PORT="$withval"
1232 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1233 fi
1234 ]
1235)
1236
1237# PRNGD Unix domain socket
1238AC_ARG_WITH(prngd-socket,
1239 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1240 [
Damien Millere996d722002-01-23 11:20:59 +11001241 case "$withval" in
1242 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001243 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001244 ;;
1245 no)
1246 withval=""
1247 ;;
1248 /*)
1249 ;;
1250 *)
1251 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1252 ;;
1253 esac
1254
1255 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001256 if test ! -z "$PRNGD_PORT" ; then
1257 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1258 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001259 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001260 AC_MSG_WARN(Entropy socket is not readable)
1261 fi
1262 PRNGD_SOCKET="$withval"
1263 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1264 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001265 ],
1266 [
1267 # Check for existing socket only if we don't have a random device already
1268 if test "$USE_RAND_HELPER" = yes ; then
1269 AC_MSG_CHECKING(for PRNGD/EGD socket)
1270 # Insert other locations here
1271 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1272 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1273 PRNGD_SOCKET="$sock"
1274 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1275 break;
1276 fi
1277 done
1278 if test ! -z "$PRNGD_SOCKET" ; then
1279 AC_MSG_RESULT($PRNGD_SOCKET)
1280 else
1281 AC_MSG_RESULT(not found)
1282 fi
1283 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001284 ]
1285)
1286
1287# Change default command timeout for hashing entropy source
1288entropy_timeout=200
1289AC_ARG_WITH(entropy-timeout,
1290 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1291 [
1292 if test "x$withval" != "xno" ; then
1293 entropy_timeout=$withval
1294 fi
1295 ]
1296)
Damien Miller6c21c512002-01-22 21:57:53 +11001297AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1298
Damien Millerd3f6ad22002-06-25 10:24:47 +10001299SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001300AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001301 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001302 [
1303 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001304 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001305 fi
1306 ]
1307)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001308AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1309AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001310
Tim Rice88f2ab52002-03-17 12:17:34 -08001311# We do this little dance with the search path to insure
1312# that programs that we select for use by installed programs
1313# (which may be run by the super-user) come from trusted
1314# locations before they come from the user's private area.
1315# This should help avoid accidentally configuring some
1316# random version of a program in someone's personal bin.
1317
1318OPATH=$PATH
1319PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001320test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001321test -d /sbin && PATH=$PATH:/sbin
1322test -d /usr/sbin && PATH=$PATH:/usr/sbin
1323PATH=$PATH:/etc:$OPATH
1324
Damien Millera8e06ce2003-11-21 23:48:55 +11001325# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001326OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1327OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1328OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1329OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1330OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1331OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1332OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1333OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1334OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1335OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1336OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1337OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1338OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1339OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1340OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1341OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001342# restore PATH
1343PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001344
1345# Where does ssh-rand-helper get its randomness from?
1346INSTALL_SSH_PRNG_CMDS=""
1347if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1348 if test ! -z "$PRNGD_PORT" ; then
1349 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1350 elif test ! -z "$PRNGD_SOCKET" ; then
1351 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1352 else
1353 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1354 RAND_HELPER_CMDHASH=yes
1355 INSTALL_SSH_PRNG_CMDS="yes"
1356 fi
1357fi
1358AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1359
1360
Ben Lindstromb5628642000-10-18 00:02:25 +00001361# Cheap hack to ensure NEWS-OS libraries are arranged right.
1362if test ! -z "$SONY" ; then
1363 LIBS="$LIBS -liberty";
1364fi
1365
Damien Millera22ba012000-03-02 23:09:20 +11001366# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001367AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001368AC_CHECK_SIZEOF(short int, 2)
1369AC_CHECK_SIZEOF(int, 4)
1370AC_CHECK_SIZEOF(long int, 4)
1371AC_CHECK_SIZEOF(long long int, 8)
1372
Damien Millerfa2bb692002-04-23 23:22:25 +10001373# Sanity check long long for some platforms (AIX)
1374if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1375 ac_cv_sizeof_long_long_int=0
1376fi
1377
Damien Millera22ba012000-03-02 23:09:20 +11001378# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001379AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1380 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001381 [ #include <sys/types.h> ],
1382 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001383 [ ac_cv_have_u_int="yes" ],
1384 [ ac_cv_have_u_int="no" ]
1385 )
1386])
1387if test "x$ac_cv_have_u_int" = "xyes" ; then
1388 AC_DEFINE(HAVE_U_INT)
1389 have_u_int=1
1390fi
1391
Damien Miller61e50f12000-05-08 20:49:37 +10001392AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1393 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001394 [ #include <sys/types.h> ],
1395 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001396 [ ac_cv_have_intxx_t="yes" ],
1397 [ ac_cv_have_intxx_t="no" ]
1398 )
1399])
1400if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1401 AC_DEFINE(HAVE_INTXX_T)
1402 have_intxx_t=1
1403fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001404
1405if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001406 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001407then
1408 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1409 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001410 [ #include <stdint.h> ],
1411 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001412 [
1413 AC_DEFINE(HAVE_INTXX_T)
1414 AC_MSG_RESULT(yes)
1415 ],
1416 [ AC_MSG_RESULT(no) ]
1417 )
1418fi
1419
Damien Miller578783e2000-09-23 14:12:24 +11001420AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1421 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001422 [
1423#include <sys/types.h>
1424#ifdef HAVE_STDINT_H
1425# include <stdint.h>
1426#endif
1427#include <sys/socket.h>
1428#ifdef HAVE_SYS_BITYPES_H
1429# include <sys/bitypes.h>
1430#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001431 ],
1432 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001433 [ ac_cv_have_int64_t="yes" ],
1434 [ ac_cv_have_int64_t="no" ]
1435 )
1436])
1437if test "x$ac_cv_have_int64_t" = "xyes" ; then
1438 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001439fi
1440
Damien Miller61e50f12000-05-08 20:49:37 +10001441AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1442 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001443 [ #include <sys/types.h> ],
1444 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001445 [ ac_cv_have_u_intxx_t="yes" ],
1446 [ ac_cv_have_u_intxx_t="no" ]
1447 )
1448])
1449if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1450 AC_DEFINE(HAVE_U_INTXX_T)
1451 have_u_intxx_t=1
1452fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001453
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001454if test -z "$have_u_intxx_t" ; then
1455 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1456 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001457 [ #include <sys/socket.h> ],
1458 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001459 [
1460 AC_DEFINE(HAVE_U_INTXX_T)
1461 AC_MSG_RESULT(yes)
1462 ],
1463 [ AC_MSG_RESULT(no) ]
1464 )
1465fi
1466
Damien Miller578783e2000-09-23 14:12:24 +11001467AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1468 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001469 [ #include <sys/types.h> ],
1470 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001471 [ ac_cv_have_u_int64_t="yes" ],
1472 [ ac_cv_have_u_int64_t="no" ]
1473 )
1474])
1475if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1476 AC_DEFINE(HAVE_U_INT64_T)
1477 have_u_int64_t=1
1478fi
1479
Tim Rice4cec93f2002-02-26 08:40:48 -08001480if test -z "$have_u_int64_t" ; then
1481 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1482 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001483 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001484 [ u_int64_t a; a = 1],
1485 [
1486 AC_DEFINE(HAVE_U_INT64_T)
1487 AC_MSG_RESULT(yes)
1488 ],
1489 [ AC_MSG_RESULT(no) ]
1490 )
1491fi
1492
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001493if test -z "$have_u_intxx_t" ; then
1494 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1495 AC_TRY_COMPILE(
1496 [
1497#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001498 ],
1499 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001500 [ ac_cv_have_uintxx_t="yes" ],
1501 [ ac_cv_have_uintxx_t="no" ]
1502 )
1503 ])
1504 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1505 AC_DEFINE(HAVE_UINTXX_T)
1506 fi
1507fi
1508
1509if test -z "$have_uintxx_t" ; then
1510 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1511 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001512 [ #include <stdint.h> ],
1513 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001514 [
1515 AC_DEFINE(HAVE_UINTXX_T)
1516 AC_MSG_RESULT(yes)
1517 ],
1518 [ AC_MSG_RESULT(no) ]
1519 )
1520fi
1521
Damien Milleredb82922000-06-20 13:25:52 +10001522if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001523 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001524then
1525 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1526 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001527 [
1528#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001529 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001530 [
Damien Miller70494d12000-04-03 15:57:06 +10001531 int8_t a; int16_t b; int32_t c;
1532 u_int8_t e; u_int16_t f; u_int32_t g;
1533 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001534 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001535 [
1536 AC_DEFINE(HAVE_U_INTXX_T)
1537 AC_DEFINE(HAVE_INTXX_T)
1538 AC_MSG_RESULT(yes)
1539 ],
1540 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001541 )
Damien Millerb29ea912000-01-15 14:12:03 +11001542fi
1543
Damien Miller58be7382001-09-15 21:31:54 +10001544
1545AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1546 AC_TRY_COMPILE(
1547 [
1548#include <sys/types.h>
1549 ],
1550 [ u_char foo; foo = 125; ],
1551 [ ac_cv_have_u_char="yes" ],
1552 [ ac_cv_have_u_char="no" ]
1553 )
1554])
1555if test "x$ac_cv_have_u_char" = "xyes" ; then
1556 AC_DEFINE(HAVE_U_CHAR)
1557fi
1558
Tim Rice13aae5e2001-10-21 17:53:58 -07001559TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001560
Tim Rice200a5c02002-02-26 22:12:34 -08001561AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001562
Damien Miller61e50f12000-05-08 20:49:37 +10001563AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1564 AC_TRY_COMPILE(
1565 [
1566#include <sys/types.h>
1567 ],
1568 [ size_t foo; foo = 1235; ],
1569 [ ac_cv_have_size_t="yes" ],
1570 [ ac_cv_have_size_t="no" ]
1571 )
1572])
1573if test "x$ac_cv_have_size_t" = "xyes" ; then
1574 AC_DEFINE(HAVE_SIZE_T)
1575fi
Damien Miller95058511999-12-29 10:36:45 +11001576
Damien Miller615f9392000-05-17 22:53:33 +10001577AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1578 AC_TRY_COMPILE(
1579 [
1580#include <sys/types.h>
1581 ],
1582 [ ssize_t foo; foo = 1235; ],
1583 [ ac_cv_have_ssize_t="yes" ],
1584 [ ac_cv_have_ssize_t="no" ]
1585 )
1586])
1587if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1588 AC_DEFINE(HAVE_SSIZE_T)
1589fi
1590
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001591AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1592 AC_TRY_COMPILE(
1593 [
1594#include <time.h>
1595 ],
1596 [ clock_t foo; foo = 1235; ],
1597 [ ac_cv_have_clock_t="yes" ],
1598 [ ac_cv_have_clock_t="no" ]
1599 )
1600])
1601if test "x$ac_cv_have_clock_t" = "xyes" ; then
1602 AC_DEFINE(HAVE_CLOCK_T)
1603fi
1604
Damien Millerb54b40e2000-06-23 08:23:34 +10001605AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1606 AC_TRY_COMPILE(
1607 [
1608#include <sys/types.h>
1609#include <sys/socket.h>
1610 ],
1611 [ sa_family_t foo; foo = 1235; ],
1612 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001613 [ AC_TRY_COMPILE(
1614 [
1615#include <sys/types.h>
1616#include <sys/socket.h>
1617#include <netinet/in.h>
1618 ],
1619 [ sa_family_t foo; foo = 1235; ],
1620 [ ac_cv_have_sa_family_t="yes" ],
1621
Damien Millerb54b40e2000-06-23 08:23:34 +10001622 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001623 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001624 )
1625])
1626if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1627 AC_DEFINE(HAVE_SA_FAMILY_T)
1628fi
1629
Damien Miller0f91b4e2000-06-18 15:43:25 +10001630AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1631 AC_TRY_COMPILE(
1632 [
1633#include <sys/types.h>
1634 ],
1635 [ pid_t foo; foo = 1235; ],
1636 [ ac_cv_have_pid_t="yes" ],
1637 [ ac_cv_have_pid_t="no" ]
1638 )
1639])
1640if test "x$ac_cv_have_pid_t" = "xyes" ; then
1641 AC_DEFINE(HAVE_PID_T)
1642fi
1643
1644AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1645 AC_TRY_COMPILE(
1646 [
1647#include <sys/types.h>
1648 ],
1649 [ mode_t foo; foo = 1235; ],
1650 [ ac_cv_have_mode_t="yes" ],
1651 [ ac_cv_have_mode_t="no" ]
1652 )
1653])
1654if test "x$ac_cv_have_mode_t" = "xyes" ; then
1655 AC_DEFINE(HAVE_MODE_T)
1656fi
1657
Damien Miller61e50f12000-05-08 20:49:37 +10001658
1659AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1660 AC_TRY_COMPILE(
1661 [
Damien Miller81171112000-04-23 11:14:01 +10001662#include <sys/types.h>
1663#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001664 ],
1665 [ struct sockaddr_storage s; ],
1666 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1667 [ ac_cv_have_struct_sockaddr_storage="no" ]
1668 )
1669])
1670if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1671 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1672fi
Damien Miller34132e52000-01-14 15:45:46 +11001673
Damien Miller61e50f12000-05-08 20:49:37 +10001674AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1675 AC_TRY_COMPILE(
1676 [
Damien Miller7b22d652000-06-18 14:07:04 +10001677#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001678#include <netinet/in.h>
1679 ],
1680 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1681 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1682 [ ac_cv_have_struct_sockaddr_in6="no" ]
1683 )
1684])
1685if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1686 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1687fi
Damien Miller34132e52000-01-14 15:45:46 +11001688
Damien Miller61e50f12000-05-08 20:49:37 +10001689AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1690 AC_TRY_COMPILE(
1691 [
Damien Miller7b22d652000-06-18 14:07:04 +10001692#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001693#include <netinet/in.h>
1694 ],
1695 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1696 [ ac_cv_have_struct_in6_addr="yes" ],
1697 [ ac_cv_have_struct_in6_addr="no" ]
1698 )
1699])
1700if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1701 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1702fi
Damien Miller34132e52000-01-14 15:45:46 +11001703
Damien Miller61e50f12000-05-08 20:49:37 +10001704AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1705 AC_TRY_COMPILE(
1706 [
Damien Miller81171112000-04-23 11:14:01 +10001707#include <sys/types.h>
1708#include <sys/socket.h>
1709#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001710 ],
1711 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1712 [ ac_cv_have_struct_addrinfo="yes" ],
1713 [ ac_cv_have_struct_addrinfo="no" ]
1714 )
1715])
1716if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1717 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1718fi
1719
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001720AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1721 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001722 [ #include <sys/time.h> ],
1723 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001724 [ ac_cv_have_struct_timeval="yes" ],
1725 [ ac_cv_have_struct_timeval="no" ]
1726 )
1727])
1728if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1729 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1730 have_struct_timeval=1
1731fi
1732
Tim Rice4e4dc562003-03-18 10:21:40 -08001733AC_CHECK_TYPES(struct timespec)
1734
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001735# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001736if test "x$ac_cv_have_int64_t" = "xno" -a \
1737 "x$ac_cv_sizeof_long_int" != "x8" -a \
1738 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001739 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1740 echo "an alternative compiler (I.E., GCC) before continuing."
1741 echo ""
1742 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001743else
1744dnl test snprintf (broken on SCO w/gcc)
1745 AC_TRY_RUN(
1746 [
1747#include <stdio.h>
1748#include <string.h>
1749#ifdef HAVE_SNPRINTF
1750main()
1751{
1752 char buf[50];
1753 char expected_out[50];
1754 int mazsize = 50 ;
1755#if (SIZEOF_LONG_INT == 8)
1756 long int num = 0x7fffffffffffffff;
1757#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001758 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001759#endif
1760 strcpy(expected_out, "9223372036854775807");
1761 snprintf(buf, mazsize, "%lld", num);
1762 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001763 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001764 exit(0);
1765}
1766#else
1767main() { exit(0); }
1768#endif
1769 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1770 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001771fi
1772
Damien Miller78315eb2000-09-29 23:01:36 +11001773dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001774OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1775OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1776OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1777OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1778OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001779OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001780OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1781OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001782OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001783OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1784OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1785OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1786OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001787OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1788OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1789OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1790OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001791
1792AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001793
Damien Miller61e50f12000-05-08 20:49:37 +10001794AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1795 ac_cv_have_ss_family_in_struct_ss, [
1796 AC_TRY_COMPILE(
1797 [
Damien Miller81171112000-04-23 11:14:01 +10001798#include <sys/types.h>
1799#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001800 ],
1801 [ struct sockaddr_storage s; s.ss_family = 1; ],
1802 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1803 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1804 )
1805])
1806if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1807 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1808fi
1809
Damien Miller61e50f12000-05-08 20:49:37 +10001810AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1811 ac_cv_have___ss_family_in_struct_ss, [
1812 AC_TRY_COMPILE(
1813 [
Damien Miller81171112000-04-23 11:14:01 +10001814#include <sys/types.h>
1815#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001816 ],
1817 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1818 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1819 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1820 )
1821])
1822if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1823 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1824fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001825
Damien Millerad833b32000-08-23 10:46:23 +10001826AC_CACHE_CHECK([for pw_class field in struct passwd],
1827 ac_cv_have_pw_class_in_struct_passwd, [
1828 AC_TRY_COMPILE(
1829 [
Damien Millerad833b32000-08-23 10:46:23 +10001830#include <pwd.h>
1831 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001832 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001833 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1834 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1835 )
1836])
1837if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1838 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1839fi
1840
Kevin Steves82456952001-06-22 21:14:18 +00001841AC_CACHE_CHECK([for pw_expire field in struct passwd],
1842 ac_cv_have_pw_expire_in_struct_passwd, [
1843 AC_TRY_COMPILE(
1844 [
1845#include <pwd.h>
1846 ],
1847 [ struct passwd p; p.pw_expire = 0; ],
1848 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1849 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1850 )
1851])
1852if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1853 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1854fi
1855
1856AC_CACHE_CHECK([for pw_change field in struct passwd],
1857 ac_cv_have_pw_change_in_struct_passwd, [
1858 AC_TRY_COMPILE(
1859 [
1860#include <pwd.h>
1861 ],
1862 [ struct passwd p; p.pw_change = 0; ],
1863 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1864 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1865 )
1866])
1867if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1868 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1869fi
Damien Miller61e50f12000-05-08 20:49:37 +10001870
Tim Rice28bbb0c2002-05-27 17:37:32 -07001871dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001872AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1873 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001874 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001875 [
Tim Riceae49fe62002-04-12 10:26:21 -07001876#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001877#include <sys/socket.h>
1878#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001879int main() {
1880#ifdef msg_accrights
1881exit(1);
1882#endif
1883struct msghdr m;
1884m.msg_accrights = 0;
1885exit(0);
1886}
Kevin Steves939c9db2002-03-22 17:23:25 +00001887 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001888 [ ac_cv_have_accrights_in_msghdr="yes" ],
1889 [ ac_cv_have_accrights_in_msghdr="no" ]
1890 )
1891])
1892if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1893 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1894fi
1895
Kevin Stevesa44e0352002-04-07 16:18:03 +00001896AC_CACHE_CHECK([for msg_control field in struct msghdr],
1897 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001898 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001899 [
Tim Riceae49fe62002-04-12 10:26:21 -07001900#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001901#include <sys/socket.h>
1902#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001903int main() {
1904#ifdef msg_control
1905exit(1);
1906#endif
1907struct msghdr m;
1908m.msg_control = 0;
1909exit(0);
1910}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001911 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001912 [ ac_cv_have_control_in_msghdr="yes" ],
1913 [ ac_cv_have_control_in_msghdr="no" ]
1914 )
1915])
1916if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1917 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1918fi
1919
Damien Miller61e50f12000-05-08 20:49:37 +10001920AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001921 AC_TRY_LINK([],
1922 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001923 [ ac_cv_libc_defines___progname="yes" ],
1924 [ ac_cv_libc_defines___progname="no" ]
1925 )
1926])
1927if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1928 AC_DEFINE(HAVE___PROGNAME)
1929fi
1930
Kevin Steves4846f4a2002-03-22 18:19:53 +00001931AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1932 AC_TRY_LINK([
1933#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001934],
1935 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001936 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1937 [ ac_cv_cc_implements___FUNCTION__="no" ]
1938 )
1939])
1940if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1941 AC_DEFINE(HAVE___FUNCTION__)
1942fi
1943
1944AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1945 AC_TRY_LINK([
1946#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001947],
1948 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001949 [ ac_cv_cc_implements___func__="yes" ],
1950 [ ac_cv_cc_implements___func__="no" ]
1951 )
1952])
1953if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1954 AC_DEFINE(HAVE___func__)
1955fi
1956
Damien Miller4f8e6692001-07-14 13:22:53 +10001957AC_CACHE_CHECK([whether getopt has optreset support],
1958 ac_cv_have_getopt_optreset, [
1959 AC_TRY_LINK(
1960 [
1961#include <getopt.h>
1962 ],
1963 [ extern int optreset; optreset = 0; ],
1964 [ ac_cv_have_getopt_optreset="yes" ],
1965 [ ac_cv_have_getopt_optreset="no" ]
1966 )
1967])
1968if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1969 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1970fi
Damien Millera22ba012000-03-02 23:09:20 +11001971
Damien Millerecbb26d2000-07-15 14:59:14 +10001972AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001973 AC_TRY_LINK([],
1974 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001975 [ ac_cv_libc_defines_sys_errlist="yes" ],
1976 [ ac_cv_libc_defines_sys_errlist="no" ]
1977 )
1978])
1979if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1980 AC_DEFINE(HAVE_SYS_ERRLIST)
1981fi
1982
1983
Damien Miller11fa2cc2000-08-16 10:35:58 +10001984AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001985 AC_TRY_LINK([],
1986 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001987 [ ac_cv_libc_defines_sys_nerr="yes" ],
1988 [ ac_cv_libc_defines_sys_nerr="no" ]
1989 )
1990])
1991if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1992 AC_DEFINE(HAVE_SYS_NERR)
1993fi
1994
Damien Millera8e06ce2003-11-21 23:48:55 +11001995SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001996# Check whether user wants sectok support
1997AC_ARG_WITH(sectok,
1998 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001999 [
2000 if test "x$withval" != "xno" ; then
2001 if test "x$withval" != "xyes" ; then
2002 CPPFLAGS="$CPPFLAGS -I${withval}"
2003 LDFLAGS="$LDFLAGS -L${withval}"
2004 if test ! -z "$need_dash_r" ; then
2005 LDFLAGS="$LDFLAGS -R${withval}"
2006 fi
2007 if test ! -z "$blibpath" ; then
2008 blibpath="$blibpath:${withval}"
2009 fi
2010 fi
2011 AC_CHECK_HEADERS(sectok.h)
2012 if test "$ac_cv_header_sectok_h" != yes; then
2013 AC_MSG_ERROR(Can't find sectok.h)
2014 fi
2015 AC_CHECK_LIB(sectok, sectok_open)
2016 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2017 AC_MSG_ERROR(Can't find libsectok)
2018 fi
2019 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002020 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002021 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002022 fi
2023 ]
2024)
2025
2026# Check whether user wants OpenSC support
2027AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002028 AC_HELP_STRING([--with-opensc=PFX],
2029 [Enable smartcard support using OpenSC]),
2030 opensc_config_prefix="$withval", opensc_config_prefix="")
2031if test x$opensc_config_prefix != x ; then
2032 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2033 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2034 if test "$OPENSC_CONFIG" != "no"; then
2035 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2036 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2037 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2038 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2039 AC_DEFINE(SMARTCARD)
2040 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002041 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002042 fi
2043fi
Damien Miller85de5802001-09-18 14:01:11 +10002044
Darren Tucker5f88d342003-10-15 16:57:57 +10002045# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002046AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002047 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002048 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002049 # Needed by our getrrsetbyname()
2050 AC_SEARCH_LIBS(res_query, resolv)
2051 AC_SEARCH_LIBS(dn_expand, resolv)
2052 AC_CHECK_FUNCS(_getshort _getlong)
2053 AC_CHECK_MEMBER(HEADER.ad,
2054 [AC_DEFINE(HAVE_HEADER_AD)],,
2055 [#include <arpa/nameser.h>])
2056 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002057
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002058# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002059KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002060AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002061 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002062 [ if test "x$withval" != "xno" ; then
2063 if test "x$withval" = "xyes" ; then
2064 KRB5ROOT="/usr/local"
2065 else
2066 KRB5ROOT=${withval}
2067 fi
2068
2069 AC_DEFINE(KRB5)
2070 KRB5_MSG="yes"
2071
2072 AC_MSG_CHECKING(for krb5-config)
2073 if test -x $KRB5ROOT/bin/krb5-config ; then
2074 KRB5CONF=$KRB5ROOT/bin/krb5-config
2075 AC_MSG_RESULT($KRB5CONF)
2076
2077 AC_MSG_CHECKING(for gssapi support)
2078 if $KRB5CONF | grep gssapi >/dev/null ; then
2079 AC_MSG_RESULT(yes)
2080 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
2081 dnl m4 quadragraphs: "sed 's/-l[^- ]*//g'"
2082 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
2083 K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002084 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002085 AC_MSG_RESULT(no)
2086 K5CFLAGS="`$KRB5CONF --cflags`"
2087 K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
2088 K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002089 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002090 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2091 LDFLAGS="$LDFLAGS $K5LDFLAGS"
2092 AC_MSG_CHECKING(whether we are using Heimdal)
2093 AC_TRY_COMPILE([ #include <krb5.h> ],
2094 [ char *tmp = heimdal_version; ],
2095 [ AC_MSG_RESULT(yes)
2096 AC_DEFINE(HEIMDAL) ],
2097 AC_MSG_RESULT(no)
2098 )
2099 else
2100 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002101 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002102 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002103 AC_MSG_CHECKING(whether we are using Heimdal)
2104 AC_TRY_COMPILE([ #include <krb5.h> ],
2105 [ char *tmp = heimdal_version; ],
2106 [ AC_MSG_RESULT(yes)
2107 AC_DEFINE(HEIMDAL)
2108 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2109 ],
2110 [ AC_MSG_RESULT(no)
2111 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2112 ]
2113 )
Damien Miller200d0a72003-06-30 19:21:36 +10002114 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002115
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002116 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2117 [ AC_DEFINE(GSSAPI)
2118 K5LIBS="-lgssapi $K5LIBS" ],
2119 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2120 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002121 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002122 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2123 $K5LIBS)
2124 ],
2125 $K5LIBS)
2126
2127 AC_CHECK_HEADER(gssapi.h, ,
2128 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002129 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002130 AC_CHECK_HEADERS(gssapi.h, ,
2131 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002132 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002133 ]
2134 )
2135
2136 oldCPP="$CPPFLAGS"
2137 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2138 AC_CHECK_HEADER(gssapi_krb5.h, ,
2139 [ CPPFLAGS="$oldCPP" ])
2140
Damien Millera8e06ce2003-11-21 23:48:55 +11002141 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002142 if test ! -z "$need_dash_r" ; then
2143 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2144 fi
2145 if test ! -z "$blibpath" ; then
2146 blibpath="$blibpath:${KRB5ROOT}/lib"
2147 fi
2148 fi ]
2149 AC_SEARCH_LIBS(k_hasafs, kafs,
Darren Tucker3c78c5e2004-01-23 22:03:10 +11002150 [ AC_DEFINE(USE_AFS)
Darren Tucker1d3ca582004-01-22 12:05:34 +11002151 K5LIBS="-lkafs $K5LIBS"
2152 ]
2153 )
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002154)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002155LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002156
Damien Millera22ba012000-03-02 23:09:20 +11002157# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002158
Damien Millerf58c6722002-05-13 13:15:42 +10002159PRIVSEP_PATH=/var/empty
2160AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002161 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002162 [
2163 if test "x$withval" != "$no" ; then
2164 PRIVSEP_PATH=$withval
2165 fi
2166 ]
2167)
2168AC_SUBST(PRIVSEP_PATH)
2169
Damien Millera22ba012000-03-02 23:09:20 +11002170AC_ARG_WITH(xauth,
2171 [ --with-xauth=PATH Specify path to xauth program ],
2172 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002173 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002174 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002175 fi
2176 ],
2177 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002178 TestPath="$PATH"
2179 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2180 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2181 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2182 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2183 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002184 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002185 xauth_path="/usr/openwin/bin/xauth"
2186 fi
2187 ]
2188)
2189
Damien Miller7d901272003-01-13 16:55:22 +11002190STRIP_OPT=-s
2191AC_ARG_ENABLE(strip,
2192 [ --disable-strip Disable calling strip(1) on install],
2193 [
2194 if test "x$enableval" = "xno" ; then
2195 STRIP_OPT=
2196 fi
2197 ]
2198)
2199AC_SUBST(STRIP_OPT)
2200
Damien Millera19cf472000-11-29 13:28:50 +11002201if test -z "$xauth_path" ; then
2202 XAUTH_PATH="undefined"
2203 AC_SUBST(XAUTH_PATH)
2204else
Damien Millera22ba012000-03-02 23:09:20 +11002205 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002206 XAUTH_PATH=$xauth_path
2207 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002208fi
Damien Millera22ba012000-03-02 23:09:20 +11002209
2210# Check for mail directory (last resort if we cannot get it from headers)
2211if test ! -z "$MAIL" ; then
2212 maildir=`dirname $MAIL`
2213 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2214fi
2215
Damien Millera22ba012000-03-02 23:09:20 +11002216if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002217 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002218 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002219 [
2220 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2221 have_dev_ptmx=1
2222 ]
2223 )
2224 fi
Damien Millera22ba012000-03-02 23:09:20 +11002225fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002226AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002227 [
2228 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2229 have_dev_ptc=1
2230 ]
2231)
2232
Damien Millera22ba012000-03-02 23:09:20 +11002233# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002234AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002235 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002236 [
Damien Miller897741e2001-04-16 10:41:46 +10002237 case "$withval" in
2238 man|cat|doc)
2239 MANTYPE=$withval
2240 ;;
2241 *)
2242 AC_MSG_ERROR(invalid man type: $withval)
2243 ;;
2244 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002245 ]
2246)
Ben Lindstrombc709922001-04-18 18:04:21 +00002247if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002248 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2249 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002250 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2251 MANTYPE=doc
2252 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2253 MANTYPE=man
2254 else
2255 MANTYPE=cat
2256 fi
2257fi
Damien Miller670a4b82000-01-22 13:53:11 +11002258AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002259if test "$MANTYPE" = "doc"; then
2260 mansubdir=man;
2261else
2262 mansubdir=$MANTYPE;
2263fi
2264AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002265
Damien Millera22ba012000-03-02 23:09:20 +11002266# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002267MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002268AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002269 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002270 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002271 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002272 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002273 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002274 fi
2275 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002276)
2277
Damien Millera22ba012000-03-02 23:09:20 +11002278# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002279AC_ARG_WITH(shadow,
2280 [ --without-shadow Disable shadow password support],
2281 [
2282 if test "x$withval" = "xno" ; then
2283 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002284 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002285 fi
2286 ]
2287)
2288
Damien Miller1f335fb2000-06-26 11:31:33 +10002289if test -z "$disable_shadow" ; then
2290 AC_MSG_CHECKING([if the systems has expire shadow information])
2291 AC_TRY_COMPILE(
2292 [
2293#include <sys/types.h>
2294#include <shadow.h>
2295 struct spwd sp;
2296 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2297 [ sp_expire_available=yes ], []
2298 )
2299
2300 if test "x$sp_expire_available" = "xyes" ; then
2301 AC_MSG_RESULT(yes)
2302 AC_DEFINE(HAS_SHADOW_EXPIRE)
2303 else
2304 AC_MSG_RESULT(no)
2305 fi
2306fi
2307
Damien Millera22ba012000-03-02 23:09:20 +11002308# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002309if test ! -z "$IPADDR_IN_DISPLAY" ; then
2310 DISPLAY_HACK_MSG="yes"
2311 AC_DEFINE(IPADDR_IN_DISPLAY)
2312else
Damien Millera8e06ce2003-11-21 23:48:55 +11002313 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002314 AC_ARG_WITH(ipaddr-display,
2315 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2316 [
2317 if test "x$withval" != "xno" ; then
2318 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002319 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002320 fi
2321 ]
2322 )
2323fi
Damien Miller76112de1999-12-21 11:18:08 +11002324
Darren Tuckere1a790d2003-09-16 11:52:19 +10002325# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002326AC_ARG_ENABLE(etc-default-login,
2327 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2328[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002329AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2330
2331if test "x$external_path_file" = "x/etc/default/login"; then
2332 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2333fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002334])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002335
Tim Rice43a1c132002-04-17 21:19:14 -07002336dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2337if test $ac_cv_func_login_getcapbool = "yes" -a \
2338 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002339 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002340fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002341
Damien Millera22ba012000-03-02 23:09:20 +11002342# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002343SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002344AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002345 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002346 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002347 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002348 AC_MSG_WARN([
2349--with-default-path=PATH has no effect on this system.
2350Edit /etc/login.conf instead.])
2351 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002352 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002353 AC_MSG_WARN([
2354--with-default-path=PATH will only be used if PATH is not defined in
2355$external_path_file .])
2356 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002357 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002358 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002359 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002360 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002361 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2362 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002363 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002364 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002365 AC_MSG_WARN([
2366If PATH is defined in $external_path_file, ensure the path to scp is included,
2367otherwise scp will not work.])
2368 fi
2369 AC_TRY_RUN(
2370 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002371/* find out what STDPATH is */
2372#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002373#ifdef HAVE_PATHS_H
2374# include <paths.h>
2375#endif
2376#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002377# ifdef _PATH_USERPATH /* Irix */
2378# define _PATH_STDPATH _PATH_USERPATH
2379# else
2380# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2381# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002382#endif
2383#include <sys/types.h>
2384#include <sys/stat.h>
2385#include <fcntl.h>
2386#define DATA "conftest.stdpath"
2387
2388main()
2389{
2390 FILE *fd;
2391 int rc;
2392
2393 fd = fopen(DATA,"w");
2394 if(fd == NULL)
2395 exit(1);
2396
2397 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2398 exit(1);
2399
2400 exit(0);
2401}
2402 ], [ user_path=`cat conftest.stdpath` ],
2403 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2404 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2405 )
2406# make sure $bindir is in USER_PATH so scp will work
2407 t_bindir=`eval echo ${bindir}`
2408 case $t_bindir in
2409 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2410 esac
2411 case $t_bindir in
2412 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2413 esac
2414 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2415 if test $? -ne 0 ; then
2416 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2417 if test $? -ne 0 ; then
2418 user_path=$user_path:$t_bindir
2419 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2420 fi
2421 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002422 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002423)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002424if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002425 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2426 AC_SUBST(user_path)
2427fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002428
Damien Millera18bbd32002-05-13 10:48:57 +10002429# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002430AC_ARG_WITH(superuser-path,
2431 [ --with-superuser-path= Specify different path for super-user],
2432 [
2433 if test "x$withval" != "xno" ; then
2434 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2435 superuser_path=$withval
2436 fi
2437 ]
2438)
2439
2440
Damien Miller61e50f12000-05-08 20:49:37 +10002441AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002442IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002443AC_ARG_WITH(4in6,
2444 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2445 [
2446 if test "x$withval" != "xno" ; then
2447 AC_MSG_RESULT(yes)
2448 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002449 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002450 else
2451 AC_MSG_RESULT(no)
2452 fi
2453 ],[
2454 if test "x$inet6_default_4in6" = "xyes"; then
2455 AC_MSG_RESULT([yes (default)])
2456 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002457 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002458 else
2459 AC_MSG_RESULT([no (default)])
2460 fi
2461 ]
2462)
2463
Damien Miller60396b02001-02-18 17:01:00 +11002464# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002465BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002466AC_ARG_WITH(bsd-auth,
2467 [ --with-bsd-auth Enable BSD auth support],
2468 [
2469 if test "x$withval" != "xno" ; then
2470 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002471 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002472 fi
2473 ]
2474)
2475
Damien Millera22ba012000-03-02 23:09:20 +11002476# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002477piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002478# make sure the directory exists
2479if test ! -d $piddir ; then
2480 piddir=`eval echo ${sysconfdir}`
2481 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002482 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002483 esac
2484fi
2485
Tim Rice88f2ab52002-03-17 12:17:34 -08002486AC_ARG_WITH(pid-dir,
2487 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2488 [
2489 if test "x$withval" != "xno" ; then
2490 piddir=$withval
2491 if test ! -d $piddir ; then
2492 AC_MSG_WARN([** no $piddir directory on this system **])
2493 fi
2494 fi
2495 ]
2496)
2497
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002498AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002499AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002500
andre2ff7b5d2000-06-03 14:57:40 +00002501dnl allow user to disable some login recording features
2502AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002503 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002504 [
2505 if test "x$enableval" = "xno" ; then
2506 AC_DEFINE(DISABLE_LASTLOG)
2507 fi
2508 ]
andre2ff7b5d2000-06-03 14:57:40 +00002509)
2510AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002511 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002512 [
2513 if test "x$enableval" = "xno" ; then
2514 AC_DEFINE(DISABLE_UTMP)
2515 fi
2516 ]
andre2ff7b5d2000-06-03 14:57:40 +00002517)
2518AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002519 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002520 [
2521 if test "x$enableval" = "xno" ; then
2522 AC_DEFINE(DISABLE_UTMPX)
2523 fi
2524 ]
andre2ff7b5d2000-06-03 14:57:40 +00002525)
2526AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002527 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002528 [
2529 if test "x$enableval" = "xno" ; then
2530 AC_DEFINE(DISABLE_WTMP)
2531 fi
2532 ]
andre2ff7b5d2000-06-03 14:57:40 +00002533)
2534AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002535 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002536 [
2537 if test "x$enableval" = "xno" ; then
2538 AC_DEFINE(DISABLE_WTMPX)
2539 fi
2540 ]
andre2ff7b5d2000-06-03 14:57:40 +00002541)
2542AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002543 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002544 [
2545 if test "x$enableval" = "xno" ; then
2546 AC_DEFINE(DISABLE_LOGIN)
2547 fi
2548 ]
andre2ff7b5d2000-06-03 14:57:40 +00002549)
2550AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002551 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002552 [
2553 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002554 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002555 fi
2556 ]
andre2ff7b5d2000-06-03 14:57:40 +00002557)
2558AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002559 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002560 [
2561 if test "x$enableval" = "xno" ; then
2562 AC_DEFINE(DISABLE_PUTUTXLINE)
2563 fi
2564 ]
andre2ff7b5d2000-06-03 14:57:40 +00002565)
2566AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002567 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002568 [
2569 if test "x$withval" = "xno" ; then
2570 AC_DEFINE(DISABLE_LASTLOG)
2571 else
2572 conf_lastlog_location=$withval
2573 fi
2574 ]
2575)
andre2ff7b5d2000-06-03 14:57:40 +00002576
2577dnl lastlog, [uw]tmpx? detection
2578dnl NOTE: set the paths in the platform section to avoid the
2579dnl need for command-line parameters
2580dnl lastlog and [uw]tmp are subject to a file search if all else fails
2581
2582dnl lastlog detection
2583dnl NOTE: the code itself will detect if lastlog is a directory
2584AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2585AC_TRY_COMPILE([
2586#include <sys/types.h>
2587#include <utmp.h>
2588#ifdef HAVE_LASTLOG_H
2589# include <lastlog.h>
2590#endif
Damien Miller2994e082000-06-04 15:51:47 +10002591#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002592# include <paths.h>
2593#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002594#ifdef HAVE_LOGIN_H
2595# include <login.h>
2596#endif
andre2ff7b5d2000-06-03 14:57:40 +00002597 ],
2598 [ char *lastlog = LASTLOG_FILE; ],
2599 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002600 [
2601 AC_MSG_RESULT(no)
2602 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2603 AC_TRY_COMPILE([
2604#include <sys/types.h>
2605#include <utmp.h>
2606#ifdef HAVE_LASTLOG_H
2607# include <lastlog.h>
2608#endif
2609#ifdef HAVE_PATHS_H
2610# include <paths.h>
2611#endif
2612 ],
2613 [ char *lastlog = _PATH_LASTLOG; ],
2614 [ AC_MSG_RESULT(yes) ],
2615 [
andree441aa32000-06-12 22:34:38 +00002616 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002617 system_lastlog_path=no
2618 ])
2619 ]
andre2ff7b5d2000-06-03 14:57:40 +00002620)
Damien Miller2994e082000-06-04 15:51:47 +10002621
andre2ff7b5d2000-06-03 14:57:40 +00002622if test -z "$conf_lastlog_location"; then
2623 if test x"$system_lastlog_path" = x"no" ; then
2624 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002625 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002626 conf_lastlog_location=$f
2627 fi
2628 done
2629 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002630 AC_MSG_WARN([** Cannot find lastlog **])
2631 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002632 fi
2633 fi
2634fi
2635
2636if test -n "$conf_lastlog_location"; then
2637 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2638fi
2639
2640dnl utmp detection
2641AC_MSG_CHECKING([if your system defines UTMP_FILE])
2642AC_TRY_COMPILE([
2643#include <sys/types.h>
2644#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002645#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002646# include <paths.h>
2647#endif
2648 ],
2649 [ char *utmp = UTMP_FILE; ],
2650 [ AC_MSG_RESULT(yes) ],
2651 [ AC_MSG_RESULT(no)
2652 system_utmp_path=no ]
2653)
2654if test -z "$conf_utmp_location"; then
2655 if test x"$system_utmp_path" = x"no" ; then
2656 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2657 if test -f $f ; then
2658 conf_utmp_location=$f
2659 fi
2660 done
2661 if test -z "$conf_utmp_location"; then
2662 AC_DEFINE(DISABLE_UTMP)
2663 fi
2664 fi
2665fi
2666if test -n "$conf_utmp_location"; then
2667 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2668fi
2669
2670dnl wtmp detection
2671AC_MSG_CHECKING([if your system defines WTMP_FILE])
2672AC_TRY_COMPILE([
2673#include <sys/types.h>
2674#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002675#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002676# include <paths.h>
2677#endif
2678 ],
2679 [ char *wtmp = WTMP_FILE; ],
2680 [ AC_MSG_RESULT(yes) ],
2681 [ AC_MSG_RESULT(no)
2682 system_wtmp_path=no ]
2683)
2684if test -z "$conf_wtmp_location"; then
2685 if test x"$system_wtmp_path" = x"no" ; then
2686 for f in /usr/adm/wtmp /var/log/wtmp; do
2687 if test -f $f ; then
2688 conf_wtmp_location=$f
2689 fi
2690 done
2691 if test -z "$conf_wtmp_location"; then
2692 AC_DEFINE(DISABLE_WTMP)
2693 fi
2694 fi
2695fi
2696if test -n "$conf_wtmp_location"; then
2697 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2698fi
2699
2700
2701dnl utmpx detection - I don't know any system so perverse as to require
2702dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2703dnl there, though.
2704AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2705AC_TRY_COMPILE([
2706#include <sys/types.h>
2707#include <utmp.h>
2708#ifdef HAVE_UTMPX_H
2709#include <utmpx.h>
2710#endif
Damien Miller2994e082000-06-04 15:51:47 +10002711#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002712# include <paths.h>
2713#endif
2714 ],
2715 [ char *utmpx = UTMPX_FILE; ],
2716 [ AC_MSG_RESULT(yes) ],
2717 [ AC_MSG_RESULT(no)
2718 system_utmpx_path=no ]
2719)
2720if test -z "$conf_utmpx_location"; then
2721 if test x"$system_utmpx_path" = x"no" ; then
2722 AC_DEFINE(DISABLE_UTMPX)
2723 fi
2724else
2725 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2726fi
2727
2728dnl wtmpx detection
2729AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2730AC_TRY_COMPILE([
2731#include <sys/types.h>
2732#include <utmp.h>
2733#ifdef HAVE_UTMPX_H
2734#include <utmpx.h>
2735#endif
Damien Miller2994e082000-06-04 15:51:47 +10002736#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002737# include <paths.h>
2738#endif
2739 ],
2740 [ char *wtmpx = WTMPX_FILE; ],
2741 [ AC_MSG_RESULT(yes) ],
2742 [ AC_MSG_RESULT(no)
2743 system_wtmpx_path=no ]
2744)
2745if test -z "$conf_wtmpx_location"; then
2746 if test x"$system_wtmpx_path" = x"no" ; then
2747 AC_DEFINE(DISABLE_WTMPX)
2748 fi
2749else
2750 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2751fi
2752
Damien Miller4018c192000-04-30 09:30:44 +10002753
Damien Miller29ea30d2000-03-17 10:54:15 +11002754if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002755 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2756 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002757fi
2758
Tim Rice4cec93f2002-02-26 08:40:48 -08002759dnl remove pam and dl because they are in $LIBPAM
2760if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002761 LIBS=`echo $LIBS | sed 's/-lpam //'`
2762fi
2763if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2764 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002765fi
2766
Damien Millerbac2d8a2000-09-05 16:13:06 +11002767AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002768AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2769AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002770
Damien Miller7b22d652000-06-18 14:07:04 +10002771# Print summary of options
2772
Damien Miller7b22d652000-06-18 14:07:04 +10002773# Someone please show me a better way :)
2774A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2775B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2776C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2777D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002778E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002779F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002780G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002781H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2782I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2783J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002784
2785echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002786echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002787echo " User binaries: $B"
2788echo " System binaries: $C"
2789echo " Configuration files: $D"
2790echo " Askpass program: $E"
2791echo " Manual pages: $F"
2792echo " PID file: $G"
2793echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002794if test "x$external_path_file" = "x/etc/login.conf" ; then
2795echo " At runtime, sshd will use the path defined in $external_path_file"
2796echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002797else
Damien Millerf58c6722002-05-13 13:15:42 +10002798echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002799 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002800echo " (If PATH is set in $external_path_file it will be used instead. If"
2801echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2802 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002803fi
Damien Millera18bbd32002-05-13 10:48:57 +10002804if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002805echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002806fi
Damien Millerf58c6722002-05-13 13:15:42 +10002807echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002808echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002809echo " KerberosV support: $KRB5_MSG"
2810echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002811echo " S/KEY support: $SKEY_MSG"
2812echo " TCP Wrappers support: $TCPW_MSG"
2813echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002814echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002815echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2816echo " BSD Auth support: $BSD_AUTH_MSG"
2817echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002818if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002819echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002820fi
2821
Damien Miller7b22d652000-06-18 14:07:04 +10002822echo ""
2823
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002824echo " Host: ${host}"
2825echo " Compiler: ${CC}"
2826echo " Compiler flags: ${CFLAGS}"
2827echo "Preprocessor flags: ${CPPFLAGS}"
2828echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002829echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002830
2831echo ""
2832
Damien Miller82cf0ce2000-12-20 13:34:48 +11002833if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002834 echo "PAM is enabled. You may need to install a PAM control file "
2835 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002836 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002837 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002838 echo ""
2839fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002840
Damien Miller6c21c512002-01-22 21:57:53 +11002841if test ! -z "$RAND_HELPER_CMDHASH" ; then
2842 echo "WARNING: you are using the builtin random number collection "
2843 echo "service. Please read WARNING.RNG and request that your OS "
2844 echo "vendor includes kernel-based random number collection in "
2845 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002846 echo ""
2847fi
Damien Miller60396b02001-02-18 17:01:00 +11002848