blob: 51be4534b705f1fb875a0ee6a935a8bc8d8a6693 [file] [log] [blame]
Tim Ricefcb62202004-01-23 18:35:16 -08001# $Id: configure.ac,v 1.188 2004/01/24 02:35:16 tim Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100012AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110013AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100014AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110015AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000016AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070017AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080018AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110019AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100020AC_PATH_PROG(ENT, ent)
21AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110022AC_PATH_PROG(TEST_MINUS_S_SH, bash)
23AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
24AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070025AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110026
Damien Millere8bb4502001-09-25 16:39:35 +100027# System features
28AC_SYS_LARGEFILE
29
Damien Miller3f62aba2000-11-29 11:56:35 +110030if test -z "$AR" ; then
31 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32fi
33
Damien Millerad833b32000-08-23 10:46:23 +100034# Use LOGIN_PROGRAM from environment if possible
35if test ! -z "$LOGIN_PROGRAM" ; then
36 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37else
38 # Search for login
39 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
40 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
41 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
42 fi
43fi
44
Damien Miller166bd442000-03-16 10:48:25 +110045if test -z "$LD" ; then
46 LD=$CC
47fi
48AC_SUBST(LD)
49
Damien Miller166bd442000-03-16 10:48:25 +110050AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110051if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100052 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110053fi
54
Tim Rice88368a32003-12-08 12:35:59 -080055AC_ARG_WITH(rpath,
56 [ --without-rpath Disable auto-added -R linker paths],
57 [
58 if test "x$withval" = "xno" ; then
59 need_dash_r=""
60 fi
61 if test "x$withval" = "xyes" ; then
62 need_dash_r=1
63 fi
64 ]
65)
66
Damien Millera22ba012000-03-02 23:09:20 +110067# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110068case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110069*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110070 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +100071 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -080072 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110073 fi
Damien Millereab4bae2003-04-29 23:22:40 +100074 saved_LDFLAGS="$LDFLAGS"
75 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
76 if (test -z "$blibflags"); then
77 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
78 AC_TRY_LINK([], [], [blibflags=$tryflags])
79 fi
80 done
81 if (test -z "$blibflags"); then
82 AC_MSG_RESULT(not found)
83 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
84 else
85 AC_MSG_RESULT($blibflags)
86 fi
87 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100088 dnl Check for authenticate. Might be in libs.a on older AIXes
89 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070090 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100091 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070092 LIBS="$LIBS -ls"
93 ])
94 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +100095 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
96 AC_CHECK_DECL(loginfailed,
97 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
98 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +100099 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000100 [(void)loginfailed("user","host","tty",0);],
101 [AC_MSG_RESULT(yes)
102 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000103 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000104 )],
105 [],
106 [#include <usersec.h>]
107 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000108 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +1100109 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000110 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000111 AC_DEFINE(SETEUID_BREAKS_SETUID)
112 AC_DEFINE(BROKEN_SETREUID)
113 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000114 dnl AIX handles lastlog as part of its login message
115 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000116 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000117 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100118 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100119*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100120 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800121 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100122 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000123 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100124 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100125 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000126 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000127 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700128 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000129 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100130 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000131*-*-dgux*)
132 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100133 AC_DEFINE(SETEUID_BREAKS_SETUID)
134 AC_DEFINE(BROKEN_SETREUID)
135 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000136 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000137*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000138 AC_MSG_CHECKING(if we have working getaddrinfo)
139 AC_TRY_RUN([#include <mach-o/dyld.h>
140main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
141 exit(0);
142 else
143 exit(1);
144}], [AC_MSG_RESULT(working)],
145 [AC_MSG_RESULT(buggy)
146 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700147 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000148 AC_DEFINE(SETEUID_BREAKS_SETUID)
149 AC_DEFINE(BROKEN_SETREUID)
150 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100151 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000152 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000153*-*-hpux10.26)
154 if test -z "$GCC"; then
155 CFLAGS="$CFLAGS -Ae"
156 fi
157 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
158 IPADDR_IN_DISPLAY=yes
159 AC_DEFINE(HAVE_SECUREWARE)
160 AC_DEFINE(USE_PIPES)
161 AC_DEFINE(LOGIN_NO_ENDOPT)
162 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000163 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000164 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000165 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700166 LIBS="$LIBS -lsec -lsecpw"
167 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000168 disable_ptmx_check=yes
169 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100170*-*-hpux10*)
171 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000172 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100173 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000174 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100175 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000176 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000177 AC_DEFINE(LOGIN_NO_ENDOPT)
178 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100179 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000180 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000181 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700182 LIBS="$LIBS -lsec"
183 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100184 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000185*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000186 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100187 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100188 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100189 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000190 AC_DEFINE(LOGIN_NO_ENDOPT)
191 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100192 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000193 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000194 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700195 LIBS="$LIBS -lsec"
196 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000197 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100198*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100199 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000200 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000201 AC_DEFINE(SETEUID_BREAKS_SETUID)
202 AC_DEFINE(BROKEN_SETREUID)
203 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000204 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000205 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100206 ;;
207*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100208 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000209 AC_DEFINE(WITH_IRIX_ARRAY)
210 AC_DEFINE(WITH_IRIX_PROJECT)
211 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000212 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000213 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000214 AC_DEFINE(SETEUID_BREAKS_SETUID)
215 AC_DEFINE(BROKEN_SETREUID)
216 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000217 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000218 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100219 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100220*-*-linux*)
221 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100222 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000223 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100224 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000225 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000226 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000227 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100228 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000229 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000230 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000231 AC_DEFINE(BROKEN_CMSG_TYPE)
232 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000233 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100234 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000235mips-sony-bsd|mips-sony-newsos4)
236 AC_DEFINE(HAVE_NEWS4)
237 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000238 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100239*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000240 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800241 if test "x$withval" != "xno" ; then
242 need_dash_r=1
243 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100244 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100245*-*-freebsd*)
246 check_for_libcrypt_later=1
247 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000248*-*-bsdi*)
249 AC_DEFINE(SETEUID_BREAKS_SETUID)
250 AC_DEFINE(BROKEN_SETREUID)
251 AC_DEFINE(BROKEN_SETREGID)
252 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000253*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000254 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100255 conf_utmp_location=/etc/utmp
256 conf_wtmp_location=/usr/adm/wtmp
257 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000258 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000259 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000260 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100261 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000262 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100263*-*-solaris*)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100264 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000265 AC_DEFINE(LOGIN_NEEDS_UTMPX)
266 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000267 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000268 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000269 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
270 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000271 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000272 # hardwire lastlog location (can't detect it on some versions)
273 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000274 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
275 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
276 if test "$sol2ver" -ge 8; then
277 AC_MSG_RESULT(yes)
278 AC_DEFINE(DISABLE_UTMP)
279 AC_DEFINE(DISABLE_WTMP)
280 else
281 AC_MSG_RESULT(no)
282 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100283 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000284*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000285 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000286 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100287 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000288 conf_utmp_location=/etc/utmp
289 conf_wtmp_location=/var/adm/wtmp
290 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000291 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000292 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000293*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700294 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000295 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000296 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000297 AC_DEFINE(SETEUID_BREAKS_SETUID)
298 AC_DEFINE(BROKEN_SETREUID)
299 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000300 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000301*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700302 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000303 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100304 IPADDR_IN_DISPLAY=yes
305 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000306 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000307 AC_DEFINE(SETEUID_BREAKS_SETUID)
308 AC_DEFINE(BROKEN_SETREUID)
309 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000310 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000311 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700312 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
313 # Attention: always take care to bind libsocket and libnsl before libc,
314 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000315 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100316*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100317 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700318 AC_DEFINE(SETEUID_BREAKS_SETUID)
319 AC_DEFINE(BROKEN_SETREUID)
320 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100321 ;;
322*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100323 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700324 AC_DEFINE(SETEUID_BREAKS_SETUID)
325 AC_DEFINE(BROKEN_SETREUID)
326 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100327 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100328*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100329 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100330*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800331 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Rice13aae5e2001-10-21 17:53:58 -0700332 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100333 RANLIB=true
334 no_dev_ptmx=1
335 AC_DEFINE(BROKEN_SYS_TERMIO_H)
336 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000337 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000338 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100339 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700340 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100341 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700342 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700343 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100344 ;;
345*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800346 if test -z "$GCC"; then
347 CFLAGS="$CFLAGS -belf"
348 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100349 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000350 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100351 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000352 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000353 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700354 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700355 AC_DEFINE(SETEUID_BREAKS_SETUID)
356 AC_DEFINE(BROKEN_SETREUID)
357 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700358 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100359 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700360 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000361 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000362*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000363 AC_DEFINE(USE_PIPES)
364 AC_DEFINE(DISABLE_FD_PASSING)
365 LDFLAGS="$LDFLAGS"
366 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
367 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000368 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000369*-*-unicosmp*)
370 AC_DEFINE(WITH_ABBREV_NO_TTY)
371 AC_DEFINE(USE_PIPES)
372 AC_DEFINE(DISABLE_FD_PASSING)
373 LDFLAGS="$LDFLAGS"
374 LIBS="$LIBS -lgen -lacid"
375 MANTYPE=cat
376 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000377*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000378 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700379 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700380 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000381 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
382 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
383 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700384 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000385*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000386 AC_MSG_CHECKING(for Digital Unix SIA)
387 no_osfsia=""
388 AC_ARG_WITH(osfsia,
389 [ --with-osfsia Enable Digital Unix SIA],
390 [
391 if test "x$withval" = "xno" ; then
392 AC_MSG_RESULT(disabled)
393 no_osfsia=1
394 fi
395 ],
396 )
397 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000398 if test -f /etc/sia/matrix.conf; then
399 AC_MSG_RESULT(yes)
400 AC_DEFINE(HAVE_OSF_SIA)
401 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000402 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000403 LIBS="$LIBS -lsecurity -ldb -lm -laud"
404 else
405 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100406 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000407 fi
408 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000409 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700410 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000411 AC_DEFINE(BROKEN_SETREUID)
412 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000413 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000414
415*-*-nto-qnx)
416 AC_DEFINE(USE_PIPES)
417 AC_DEFINE(NO_X11_UNIX_SOCKETS)
418 AC_DEFINE(MISSING_NFDBITS)
419 AC_DEFINE(MISSING_HOWMANY)
420 AC_DEFINE(MISSING_FD_MASK)
421 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100422esac
423
Damien Millere37bfc12000-06-05 09:37:43 +1000424# Allow user to specify flags
425AC_ARG_WITH(cflags,
426 [ --with-cflags Specify additional flags to pass to compiler],
427 [
428 if test "x$withval" != "xno" ; then
429 CFLAGS="$CFLAGS $withval"
430 fi
431 ]
432)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000433AC_ARG_WITH(cppflags,
434 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
435 [
436 if test "x$withval" != "xno"; then
437 CPPFLAGS="$CPPFLAGS $withval"
438 fi
439 ]
440)
Damien Millere37bfc12000-06-05 09:37:43 +1000441AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000442 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000443 [
444 if test "x$withval" != "xno" ; then
445 LDFLAGS="$LDFLAGS $withval"
446 fi
447 ]
448)
449AC_ARG_WITH(libs,
450 [ --with-libs Specify additional libraries to link with],
451 [
452 if test "x$withval" != "xno" ; then
453 LIBS="$LIBS $withval"
454 fi
455 ]
456)
457
Darren Tucker6eb93042003-06-29 21:30:41 +1000458AC_MSG_CHECKING(compiler and flags for sanity)
459AC_TRY_RUN([
460#include <stdio.h>
461int main(){exit(0);}
462 ],
463 [ AC_MSG_RESULT(yes) ],
464 [
465 AC_MSG_RESULT(no)
466 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
467 ]
468)
469
Tim Rice4cec93f2002-02-26 08:40:48 -0800470# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000471AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000472 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800473 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100474 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000475 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000476 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
477 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000478 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700479 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Damien Miller5c3a5582003-09-23 22:12:38 +1000480 util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800481
Damien Millera22ba012000-03-02 23:09:20 +1100482# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700483AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
484AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000485
Damien Millerdf288022001-02-18 13:07:07 +1100486dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700487if test "x$with_tcp_wrappers" != "xno" ; then
488 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
489 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
490 fi
491fi
Damien Millerdf288022001-02-18 13:07:07 +1100492
Tim Rice1e1ef642003-09-11 22:19:31 -0700493dnl IRIX and Solaris 2.5.1 have dirname() in libgen
494AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
495 AC_CHECK_LIB(gen, dirname,[
496 AC_CACHE_CHECK([for broken dirname],
497 ac_cv_have_broken_dirname, [
498 save_LIBS="$LIBS"
499 LIBS="$LIBS -lgen"
500 AC_TRY_RUN(
501 [
502#include <libgen.h>
503#include <string.h>
504
505int main(int argc, char **argv) {
506 char *s, buf[32];
507
508 strncpy(buf,"/etc", 32);
509 s = dirname(buf);
510 if (!s || strncmp(s, "/", 32) != 0) {
511 exit(1);
512 } else {
513 exit(0);
514 }
515}
516 ],
517 [ ac_cv_have_broken_dirname="no" ],
518 [ ac_cv_have_broken_dirname="yes" ]
519 )
520 LIBS="$save_LIBS"
521 ])
522 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
523 LIBS="$LIBS -lgen"
524 AC_DEFINE(HAVE_DIRNAME)
525 AC_CHECK_HEADERS(libgen.h)
526 fi
527 ])
528])
529
530AC_CHECK_FUNC(getspnam, ,
531 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
532AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
533
Tim Rice13aae5e2001-10-21 17:53:58 -0700534dnl zlib is required
535AC_ARG_WITH(zlib,
536 [ --with-zlib=PATH Use zlib in PATH],
537 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000538 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100539 AC_MSG_ERROR([*** zlib is required ***])
540 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700541 if test -d "$withval/lib"; then
542 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700543 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700544 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700545 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700546 fi
547 else
548 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700549 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700550 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700551 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700552 fi
553 fi
554 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700555 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700556 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700557 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700558 fi
559 ]
560)
561
Tim Ricefcb62202004-01-23 18:35:16 -0800562AC_CHECK_LIB(z, deflate, ,
563 [
564 saved_CPPFLAGS="$CPPFLAGS"
565 saved_LDFLAGS="$LDFLAGS"
566 save_LIBS="$LIBS"
567 dnl Check default zlib install dir
568 if test -n "${need_dash_r}"; then
569 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
570 else
571 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
572 fi
573 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
574 LIBS="$LIBS -lz"
575 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
576 [
577 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
578 ]
579 )
580 ]
581)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100582AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
583AC_MSG_CHECKING(for zlib 1.1.4 or greater)
584AC_TRY_RUN([
585#include <zlib.h>
586int main()
587{
588 int a, b, c, v;
589 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
590 exit(1);
591 v = a*1000000 + b*1000 + c;
592 if (v >= 1001004)
593 exit(0);
594 exit(2);
595}
596 ],
597 AC_MSG_RESULT(yes),
598 [ AC_MSG_RESULT(no)
599 AC_MSG_ERROR([*** zlib too old - check config.log ***]) ]
600)
601
Damien Miller6f9c3372000-10-25 10:06:04 +1100602
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000603dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100604AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000605 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
606)
Damien Millera8e06ce2003-11-21 23:48:55 +1100607AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700608 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
609 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000610)
Damien Millerab18c411999-11-11 10:40:23 +1100611
Tim Ricee589a292001-11-03 11:09:32 -0800612dnl Checks for libutil functions
613AC_CHECK_HEADERS(libutil.h)
614AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
615AC_CHECK_FUNCS(logout updwtmp logwtmp)
616
Ben Lindstrom8697e082001-02-24 21:41:10 +0000617AC_FUNC_STRFTIME
618
Damien Miller3c027682001-03-14 11:39:45 +1100619# Check for ALTDIRFUNC glob() extension
620AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
621AC_EGREP_CPP(FOUNDIT,
622 [
623 #include <glob.h>
624 #ifdef GLOB_ALTDIRFUNC
625 FOUNDIT
626 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100627 ],
Damien Miller3c027682001-03-14 11:39:45 +1100628 [
629 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
630 AC_MSG_RESULT(yes)
631 ],
632 [
633 AC_MSG_RESULT(no)
634 ]
635)
Damien Millerab18c411999-11-11 10:40:23 +1100636
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000637# Check for g.gl_matchc glob() extension
638AC_MSG_CHECKING(for gl_matchc field in glob_t)
639AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100640 [
641 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000642 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100643 ],
644 [
645 AC_DEFINE(GLOB_HAS_GL_MATCHC)
646 AC_MSG_RESULT(yes)
647 ],
648 [
649 AC_MSG_RESULT(no)
650 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000651)
652
Damien Miller18bb4732001-03-28 14:35:30 +1000653AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
654AC_TRY_RUN(
655 [
656#include <sys/types.h>
657#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700658int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000659 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100660 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000661 [
662 AC_MSG_RESULT(no)
663 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
664 ]
665)
666
Damien Millerc547bf12001-02-16 10:18:12 +1100667# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100668SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100669AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700670 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100671 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100672 [
673 if test "x$withval" != "xno" ; then
674
675 if test "x$withval" != "xyes" ; then
676 CPPFLAGS="$CPPFLAGS -I${withval}/include"
677 LDFLAGS="$LDFLAGS -L${withval}/lib"
678 fi
679
680 AC_DEFINE(SKEY)
681 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100682 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100683
Tim Rice4cec93f2002-02-26 08:40:48 -0800684 AC_MSG_CHECKING([for s/key support])
685 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100686 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800687#include <stdio.h>
688#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700689int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800690 ],
691 [AC_MSG_RESULT(yes)],
692 [
693 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100694 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
695 ])
696 fi
697 ]
698)
699
700# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700701TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100702AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700703 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100704 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100705 [
706 if test "x$withval" != "xno" ; then
707 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700708 saved_LDFLAGS="$LDFLAGS"
709 saved_CPPFLAGS="$CPPFLAGS"
710 if test -n "${withval}" -a "${withval}" != "yes"; then
711 if test -d "${withval}/lib"; then
712 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700713 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700714 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700715 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700716 fi
717 else
718 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700719 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700720 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700721 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700722 fi
723 fi
724 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700725 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700726 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700727 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700728 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700729 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800730 LIBWRAP="-lwrap"
731 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100732 AC_MSG_CHECKING(for libwrap)
733 AC_TRY_LINK(
734 [
735#include <tcpd.h>
736 int deny_severity = 0, allow_severity = 0;
737 ],
738 [hosts_access(0);],
739 [
740 AC_MSG_RESULT(yes)
741 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800742 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700743 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100744 ],
745 [
746 AC_MSG_ERROR([*** libwrap missing])
747 ]
748 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800749 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100750 fi
751 ]
752)
753
Damien Millerfe1f1432003-02-24 15:45:42 +1100754dnl Checks for library functions. Please keep in alphabetical order
755AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000756 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000757 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000758 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000759 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100760 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000761 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
762 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
763 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100764 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000765 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000766 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000767 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100768)
Tim Rice13aae5e2001-10-21 17:53:58 -0700769
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000770# IRIX has a const char return value for gai_strerror()
771AC_CHECK_FUNCS(gai_strerror,[
772 AC_DEFINE(HAVE_GAI_STRERROR)
773 AC_TRY_COMPILE([
774#include <sys/types.h>
775#include <sys/socket.h>
776#include <netdb.h>
777
778const char *gai_strerror(int);],[
779char *str;
780
781str = gai_strerror(0);],[
782 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
783 [Define if gai_strerror() returns const char *])])])
784
Damien Millercd6853c2003-01-28 11:33:42 +1100785AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
786
Darren Tuckerf1159b52003-07-07 19:44:01 +1000787dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000788AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000789AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000790
Darren Tuckerb2427c82003-09-10 15:22:44 +1000791dnl tcsendbreak might be a macro
792AC_CHECK_DECL(tcsendbreak,
793 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100794 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000795 [#include <termios.h>]
796)
797
Darren Tucker2a6b0292003-12-31 14:59:17 +1100798AC_CHECK_FUNCS(setresuid, [
799 dnl Some platorms have setresuid that isn't implemented, test for this
800 AC_MSG_CHECKING(if setresuid seems to work)
801 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100802#include <stdlib.h>
803#include <errno.h>
804int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100805 ],
806 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100807 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100808 AC_MSG_RESULT(not implemented)]
809 )
810])
Darren Tuckere937be32003-12-17 18:53:26 +1100811
Darren Tucker2a6b0292003-12-31 14:59:17 +1100812AC_CHECK_FUNCS(setresgid, [
813 dnl Some platorms have setresgid that isn't implemented, test for this
814 AC_MSG_CHECKING(if setresgid seems to work)
815 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100816#include <stdlib.h>
817#include <errno.h>
818int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100819 ],
820 [AC_MSG_RESULT(yes)],
821 [AC_DEFINE(BROKEN_SETRESGID)
822 AC_MSG_RESULT(not implemented)]
823 )
824])
Darren Tuckere937be32003-12-17 18:53:26 +1100825
Damien Millerad833b32000-08-23 10:46:23 +1000826dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000827AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000828dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000829AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000830AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000831dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000832AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000833AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100834
Damien Millera8e06ce2003-11-21 23:48:55 +1100835AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100836 [AC_DEFINE(HAVE_DAEMON)],
837 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
838)
839
Damien Millera8e06ce2003-11-21 23:48:55 +1100840AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100841 [AC_DEFINE(HAVE_GETPAGESIZE)],
842 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
843)
844
Damien Millercb170cb2000-07-01 16:52:55 +1000845# Check for broken snprintf
846if test "x$ac_cv_func_snprintf" = "xyes" ; then
847 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
848 AC_TRY_RUN(
849 [
850#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700851int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000852 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100853 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000854 [
855 AC_MSG_RESULT(no)
856 AC_DEFINE(BROKEN_SNPRINTF)
857 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
858 ]
859 )
860fi
861
Damien Millere8328192003-01-07 15:18:32 +1100862dnl see whether mkstemp() requires XXXXXX
863if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
864AC_MSG_CHECKING([for (overly) strict mkstemp])
865AC_TRY_RUN(
866 [
867#include <stdlib.h>
868main() { char template[]="conftest.mkstemp-test";
869if (mkstemp(template) == -1)
870 exit(1);
871unlink(template); exit(0);
872}
873 ],
874 [
875 AC_MSG_RESULT(no)
876 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100877 [
Damien Millere8328192003-01-07 15:18:32 +1100878 AC_MSG_RESULT(yes)
879 AC_DEFINE(HAVE_STRICT_MKSTEMP)
880 ],
881 [
882 AC_MSG_RESULT(yes)
883 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100884 ]
Damien Millere8328192003-01-07 15:18:32 +1100885)
886fi
887
Darren Tucker70a3d552003-08-21 17:58:29 +1000888dnl make sure that openpty does not reacquire controlling terminal
889if test ! -z "$check_for_openpty_ctty_bug"; then
890 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
891 AC_TRY_RUN(
892 [
893#include <stdio.h>
894#include <sys/fcntl.h>
895#include <sys/types.h>
896#include <sys/wait.h>
897
898int
899main()
900{
901 pid_t pid;
902 int fd, ptyfd, ttyfd, status;
903
904 pid = fork();
905 if (pid < 0) { /* failed */
906 exit(1);
907 } else if (pid > 0) { /* parent */
908 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100909 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000910 exit(WEXITSTATUS(status));
911 else
912 exit(2);
913 } else { /* child */
914 close(0); close(1); close(2);
915 setsid();
916 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
917 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
918 if (fd >= 0)
919 exit(3); /* Acquired ctty: broken */
920 else
921 exit(0); /* Did not acquire ctty: OK */
922 }
923}
924 ],
925 [
926 AC_MSG_RESULT(yes)
927 ],
928 [
929 AC_MSG_RESULT(no)
930 AC_DEFINE(SSHD_ACQUIRES_CTTY)
931 ]
932 )
933fi
934
Damien Miller606f8802000-09-16 15:39:56 +1100935AC_FUNC_GETPGRP
936
Damien Millera64b57a2001-01-17 10:44:13 +1100937# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000938PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100939AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100940 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100941 [
Damien Millera64b57a2001-01-17 10:44:13 +1100942 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100943 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
944 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100945 AC_MSG_ERROR([PAM headers not found])
946 fi
947
948 AC_CHECK_LIB(dl, dlopen, , )
949 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
950 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000951 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100952
Damien Millera64b57a2001-01-17 10:44:13 +1100953 PAM_MSG="yes"
954
955 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800956 if test $ac_cv_lib_dl_dlopen = yes; then
957 LIBPAM="-lpam -ldl"
958 else
959 LIBPAM="-lpam"
960 fi
961 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100962 fi
963 ]
964)
Damien Millera22ba012000-03-02 23:09:20 +1100965
Damien Millera64b57a2001-01-17 10:44:13 +1100966# Check for older PAM
967if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100968 # Check PAM strerror arguments (old PAM)
969 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
970 AC_TRY_COMPILE(
971 [
Damien Miller81171112000-04-23 11:14:01 +1000972#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +1100973#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +1000974#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +1100975#elif defined (HAVE_PAM_PAM_APPL_H)
976#include <pam/pam_appl.h>
977#endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100978 ],
979 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +1100980 [AC_MSG_RESULT(no)],
981 [
982 AC_DEFINE(HAVE_OLD_PAM)
983 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000984 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100985 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100986 )
Damien Millera22ba012000-03-02 23:09:20 +1100987fi
988
Damien Millerfc93d4b2002-09-04 23:26:29 +1000989# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
990# because the system crypt() is more featureful.
991if test "x$check_for_libcrypt_before" = "x1"; then
992 AC_CHECK_LIB(crypt, crypt)
993fi
994
Tim Riceaef73712002-05-11 13:17:42 -0700995# Search for OpenSSL
996saved_CPPFLAGS="$CPPFLAGS"
997saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100998AC_ARG_WITH(ssl-dir,
999 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1000 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001001 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001002 if test -d "$withval/lib"; then
1003 if test -n "${need_dash_r}"; then
1004 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1005 else
1006 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1007 fi
1008 else
1009 if test -n "${need_dash_r}"; then
1010 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1011 else
1012 LDFLAGS="-L${withval} ${LDFLAGS}"
1013 fi
1014 fi
1015 if test -d "$withval/include"; then
1016 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1017 else
1018 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1019 fi
Damien Millera22ba012000-03-02 23:09:20 +11001020 fi
1021 ]
1022)
Tim Riceaef73712002-05-11 13:17:42 -07001023LIBS="$LIBS -lcrypto"
1024AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001025 [
Tim Riceaef73712002-05-11 13:17:42 -07001026 dnl Check default openssl install dir
1027 if test -n "${need_dash_r}"; then
1028 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001029 else
Tim Riceaef73712002-05-11 13:17:42 -07001030 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001031 fi
Tim Riceaef73712002-05-11 13:17:42 -07001032 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1033 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1034 [
1035 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1036 ]
1037 )
1038 ]
1039)
1040
Tim Riced730b782002-08-13 18:52:10 -07001041# Determine OpenSSL header version
1042AC_MSG_CHECKING([OpenSSL header version])
1043AC_TRY_RUN(
1044 [
1045#include <stdio.h>
1046#include <string.h>
1047#include <openssl/opensslv.h>
1048#define DATA "conftest.sslincver"
1049int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001050 FILE *fd;
1051 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001052
Damien Millera8e06ce2003-11-21 23:48:55 +11001053 fd = fopen(DATA,"w");
1054 if(fd == NULL)
1055 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001056
1057 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1058 exit(1);
1059
1060 exit(0);
1061}
1062 ],
1063 [
1064 ssl_header_ver=`cat conftest.sslincver`
1065 AC_MSG_RESULT($ssl_header_ver)
1066 ],
1067 [
1068 AC_MSG_RESULT(not found)
1069 AC_MSG_ERROR(OpenSSL version header not found.)
1070 ]
1071)
1072
1073# Determine OpenSSL library version
1074AC_MSG_CHECKING([OpenSSL library version])
1075AC_TRY_RUN(
1076 [
1077#include <stdio.h>
1078#include <string.h>
1079#include <openssl/opensslv.h>
1080#include <openssl/crypto.h>
1081#define DATA "conftest.ssllibver"
1082int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001083 FILE *fd;
1084 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001085
Damien Millera8e06ce2003-11-21 23:48:55 +11001086 fd = fopen(DATA,"w");
1087 if(fd == NULL)
1088 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001089
1090 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1091 exit(1);
1092
1093 exit(0);
1094}
1095 ],
1096 [
1097 ssl_library_ver=`cat conftest.ssllibver`
1098 AC_MSG_RESULT($ssl_library_ver)
1099 ],
1100 [
1101 AC_MSG_RESULT(not found)
1102 AC_MSG_ERROR(OpenSSL library not found.)
1103 ]
1104)
Damien Millera22ba012000-03-02 23:09:20 +11001105
Damien Millerec932372002-01-22 22:16:03 +11001106# Sanity check OpenSSL headers
1107AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1108AC_TRY_RUN(
1109 [
1110#include <string.h>
1111#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001112int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001113 ],
1114 [
1115 AC_MSG_RESULT(yes)
1116 ],
1117 [
1118 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001119 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1120Check config.log for details.
1121Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001122 ]
1123)
1124
Damien Millera8e06ce2003-11-21 23:48:55 +11001125# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001126# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001127if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001128 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001129fi
1130
Damien Miller6c21c512002-01-22 21:57:53 +11001131
1132### Configure cryptographic random number support
1133
1134# Check wheter OpenSSL seeds itself
1135AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1136AC_TRY_RUN(
1137 [
1138#include <string.h>
1139#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001140int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001141 ],
1142 [
1143 OPENSSL_SEEDS_ITSELF=yes
1144 AC_MSG_RESULT(yes)
1145 ],
1146 [
1147 AC_MSG_RESULT(no)
1148 # Default to use of the rand helper if OpenSSL doesn't
1149 # seed itself
1150 USE_RAND_HELPER=yes
1151 ]
1152)
1153
1154
1155# Do we want to force the use of the rand helper?
1156AC_ARG_WITH(rand-helper,
1157 [ --with-rand-helper Use subprocess to gather strong randomness ],
1158 [
1159 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001160 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001161 # the previous test showed it to be unseeded.
1162 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1163 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1164 OPENSSL_SEEDS_ITSELF=yes
1165 USE_RAND_HELPER=""
1166 fi
1167 else
1168 USE_RAND_HELPER=yes
1169 fi
1170 ],
1171)
1172
1173# Which randomness source do we use?
1174if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1175 # OpenSSL only
1176 AC_DEFINE(OPENSSL_PRNG_ONLY)
1177 RAND_MSG="OpenSSL internal ONLY"
1178 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001179elif test ! -z "$USE_RAND_HELPER" ; then
1180 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001181 RAND_MSG="ssh-rand-helper"
1182 INSTALL_SSH_RAND_HELPER="yes"
1183fi
1184AC_SUBST(INSTALL_SSH_RAND_HELPER)
1185
1186### Configuration of ssh-rand-helper
1187
1188# PRNGD TCP socket
1189AC_ARG_WITH(prngd-port,
1190 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1191 [
Damien Millere996d722002-01-23 11:20:59 +11001192 case "$withval" in
1193 no)
1194 withval=""
1195 ;;
1196 [[0-9]]*)
1197 ;;
1198 *)
1199 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1200 ;;
1201 esac
1202 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001203 PRNGD_PORT="$withval"
1204 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1205 fi
1206 ]
1207)
1208
1209# PRNGD Unix domain socket
1210AC_ARG_WITH(prngd-socket,
1211 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1212 [
Damien Millere996d722002-01-23 11:20:59 +11001213 case "$withval" in
1214 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001215 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001216 ;;
1217 no)
1218 withval=""
1219 ;;
1220 /*)
1221 ;;
1222 *)
1223 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1224 ;;
1225 esac
1226
1227 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001228 if test ! -z "$PRNGD_PORT" ; then
1229 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1230 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001231 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001232 AC_MSG_WARN(Entropy socket is not readable)
1233 fi
1234 PRNGD_SOCKET="$withval"
1235 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1236 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001237 ],
1238 [
1239 # Check for existing socket only if we don't have a random device already
1240 if test "$USE_RAND_HELPER" = yes ; then
1241 AC_MSG_CHECKING(for PRNGD/EGD socket)
1242 # Insert other locations here
1243 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1244 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1245 PRNGD_SOCKET="$sock"
1246 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1247 break;
1248 fi
1249 done
1250 if test ! -z "$PRNGD_SOCKET" ; then
1251 AC_MSG_RESULT($PRNGD_SOCKET)
1252 else
1253 AC_MSG_RESULT(not found)
1254 fi
1255 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001256 ]
1257)
1258
1259# Change default command timeout for hashing entropy source
1260entropy_timeout=200
1261AC_ARG_WITH(entropy-timeout,
1262 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1263 [
1264 if test "x$withval" != "xno" ; then
1265 entropy_timeout=$withval
1266 fi
1267 ]
1268)
Damien Miller6c21c512002-01-22 21:57:53 +11001269AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1270
Damien Millerd3f6ad22002-06-25 10:24:47 +10001271SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001272AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001273 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001274 [
1275 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001276 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001277 fi
1278 ]
1279)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001280AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1281AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001282
Tim Rice88f2ab52002-03-17 12:17:34 -08001283# We do this little dance with the search path to insure
1284# that programs that we select for use by installed programs
1285# (which may be run by the super-user) come from trusted
1286# locations before they come from the user's private area.
1287# This should help avoid accidentally configuring some
1288# random version of a program in someone's personal bin.
1289
1290OPATH=$PATH
1291PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001292test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001293test -d /sbin && PATH=$PATH:/sbin
1294test -d /usr/sbin && PATH=$PATH:/usr/sbin
1295PATH=$PATH:/etc:$OPATH
1296
Damien Millera8e06ce2003-11-21 23:48:55 +11001297# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001298OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1299OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1300OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1301OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1302OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1303OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1304OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1305OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1306OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1307OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1308OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1309OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1310OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1311OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1312OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1313OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001314# restore PATH
1315PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001316
1317# Where does ssh-rand-helper get its randomness from?
1318INSTALL_SSH_PRNG_CMDS=""
1319if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1320 if test ! -z "$PRNGD_PORT" ; then
1321 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1322 elif test ! -z "$PRNGD_SOCKET" ; then
1323 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1324 else
1325 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1326 RAND_HELPER_CMDHASH=yes
1327 INSTALL_SSH_PRNG_CMDS="yes"
1328 fi
1329fi
1330AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1331
1332
Ben Lindstromb5628642000-10-18 00:02:25 +00001333# Cheap hack to ensure NEWS-OS libraries are arranged right.
1334if test ! -z "$SONY" ; then
1335 LIBS="$LIBS -liberty";
1336fi
1337
Damien Millera22ba012000-03-02 23:09:20 +11001338# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001339AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001340AC_CHECK_SIZEOF(short int, 2)
1341AC_CHECK_SIZEOF(int, 4)
1342AC_CHECK_SIZEOF(long int, 4)
1343AC_CHECK_SIZEOF(long long int, 8)
1344
Damien Millerfa2bb692002-04-23 23:22:25 +10001345# Sanity check long long for some platforms (AIX)
1346if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1347 ac_cv_sizeof_long_long_int=0
1348fi
1349
Damien Millera22ba012000-03-02 23:09:20 +11001350# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001351AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1352 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001353 [ #include <sys/types.h> ],
1354 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001355 [ ac_cv_have_u_int="yes" ],
1356 [ ac_cv_have_u_int="no" ]
1357 )
1358])
1359if test "x$ac_cv_have_u_int" = "xyes" ; then
1360 AC_DEFINE(HAVE_U_INT)
1361 have_u_int=1
1362fi
1363
Damien Miller61e50f12000-05-08 20:49:37 +10001364AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1365 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001366 [ #include <sys/types.h> ],
1367 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001368 [ ac_cv_have_intxx_t="yes" ],
1369 [ ac_cv_have_intxx_t="no" ]
1370 )
1371])
1372if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1373 AC_DEFINE(HAVE_INTXX_T)
1374 have_intxx_t=1
1375fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001376
1377if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001378 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001379then
1380 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1381 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001382 [ #include <stdint.h> ],
1383 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001384 [
1385 AC_DEFINE(HAVE_INTXX_T)
1386 AC_MSG_RESULT(yes)
1387 ],
1388 [ AC_MSG_RESULT(no) ]
1389 )
1390fi
1391
Damien Miller578783e2000-09-23 14:12:24 +11001392AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1393 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001394 [
1395#include <sys/types.h>
1396#ifdef HAVE_STDINT_H
1397# include <stdint.h>
1398#endif
1399#include <sys/socket.h>
1400#ifdef HAVE_SYS_BITYPES_H
1401# include <sys/bitypes.h>
1402#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001403 ],
1404 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001405 [ ac_cv_have_int64_t="yes" ],
1406 [ ac_cv_have_int64_t="no" ]
1407 )
1408])
1409if test "x$ac_cv_have_int64_t" = "xyes" ; then
1410 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001411fi
1412
Damien Miller61e50f12000-05-08 20:49:37 +10001413AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1414 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001415 [ #include <sys/types.h> ],
1416 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001417 [ ac_cv_have_u_intxx_t="yes" ],
1418 [ ac_cv_have_u_intxx_t="no" ]
1419 )
1420])
1421if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1422 AC_DEFINE(HAVE_U_INTXX_T)
1423 have_u_intxx_t=1
1424fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001425
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001426if test -z "$have_u_intxx_t" ; then
1427 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1428 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001429 [ #include <sys/socket.h> ],
1430 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001431 [
1432 AC_DEFINE(HAVE_U_INTXX_T)
1433 AC_MSG_RESULT(yes)
1434 ],
1435 [ AC_MSG_RESULT(no) ]
1436 )
1437fi
1438
Damien Miller578783e2000-09-23 14:12:24 +11001439AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1440 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001441 [ #include <sys/types.h> ],
1442 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001443 [ ac_cv_have_u_int64_t="yes" ],
1444 [ ac_cv_have_u_int64_t="no" ]
1445 )
1446])
1447if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1448 AC_DEFINE(HAVE_U_INT64_T)
1449 have_u_int64_t=1
1450fi
1451
Tim Rice4cec93f2002-02-26 08:40:48 -08001452if test -z "$have_u_int64_t" ; then
1453 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1454 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001455 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001456 [ u_int64_t a; a = 1],
1457 [
1458 AC_DEFINE(HAVE_U_INT64_T)
1459 AC_MSG_RESULT(yes)
1460 ],
1461 [ AC_MSG_RESULT(no) ]
1462 )
1463fi
1464
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001465if test -z "$have_u_intxx_t" ; then
1466 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1467 AC_TRY_COMPILE(
1468 [
1469#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001470 ],
1471 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001472 [ ac_cv_have_uintxx_t="yes" ],
1473 [ ac_cv_have_uintxx_t="no" ]
1474 )
1475 ])
1476 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1477 AC_DEFINE(HAVE_UINTXX_T)
1478 fi
1479fi
1480
1481if test -z "$have_uintxx_t" ; then
1482 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1483 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001484 [ #include <stdint.h> ],
1485 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001486 [
1487 AC_DEFINE(HAVE_UINTXX_T)
1488 AC_MSG_RESULT(yes)
1489 ],
1490 [ AC_MSG_RESULT(no) ]
1491 )
1492fi
1493
Damien Milleredb82922000-06-20 13:25:52 +10001494if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001495 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001496then
1497 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1498 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001499 [
1500#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001501 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001502 [
Damien Miller70494d12000-04-03 15:57:06 +10001503 int8_t a; int16_t b; int32_t c;
1504 u_int8_t e; u_int16_t f; u_int32_t g;
1505 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001506 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001507 [
1508 AC_DEFINE(HAVE_U_INTXX_T)
1509 AC_DEFINE(HAVE_INTXX_T)
1510 AC_MSG_RESULT(yes)
1511 ],
1512 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001513 )
Damien Millerb29ea912000-01-15 14:12:03 +11001514fi
1515
Damien Miller58be7382001-09-15 21:31:54 +10001516
1517AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1518 AC_TRY_COMPILE(
1519 [
1520#include <sys/types.h>
1521 ],
1522 [ u_char foo; foo = 125; ],
1523 [ ac_cv_have_u_char="yes" ],
1524 [ ac_cv_have_u_char="no" ]
1525 )
1526])
1527if test "x$ac_cv_have_u_char" = "xyes" ; then
1528 AC_DEFINE(HAVE_U_CHAR)
1529fi
1530
Tim Rice13aae5e2001-10-21 17:53:58 -07001531TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001532
Tim Rice200a5c02002-02-26 22:12:34 -08001533AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001534
Damien Miller61e50f12000-05-08 20:49:37 +10001535AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1536 AC_TRY_COMPILE(
1537 [
1538#include <sys/types.h>
1539 ],
1540 [ size_t foo; foo = 1235; ],
1541 [ ac_cv_have_size_t="yes" ],
1542 [ ac_cv_have_size_t="no" ]
1543 )
1544])
1545if test "x$ac_cv_have_size_t" = "xyes" ; then
1546 AC_DEFINE(HAVE_SIZE_T)
1547fi
Damien Miller95058511999-12-29 10:36:45 +11001548
Damien Miller615f9392000-05-17 22:53:33 +10001549AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1550 AC_TRY_COMPILE(
1551 [
1552#include <sys/types.h>
1553 ],
1554 [ ssize_t foo; foo = 1235; ],
1555 [ ac_cv_have_ssize_t="yes" ],
1556 [ ac_cv_have_ssize_t="no" ]
1557 )
1558])
1559if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1560 AC_DEFINE(HAVE_SSIZE_T)
1561fi
1562
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001563AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1564 AC_TRY_COMPILE(
1565 [
1566#include <time.h>
1567 ],
1568 [ clock_t foo; foo = 1235; ],
1569 [ ac_cv_have_clock_t="yes" ],
1570 [ ac_cv_have_clock_t="no" ]
1571 )
1572])
1573if test "x$ac_cv_have_clock_t" = "xyes" ; then
1574 AC_DEFINE(HAVE_CLOCK_T)
1575fi
1576
Damien Millerb54b40e2000-06-23 08:23:34 +10001577AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1578 AC_TRY_COMPILE(
1579 [
1580#include <sys/types.h>
1581#include <sys/socket.h>
1582 ],
1583 [ sa_family_t foo; foo = 1235; ],
1584 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001585 [ AC_TRY_COMPILE(
1586 [
1587#include <sys/types.h>
1588#include <sys/socket.h>
1589#include <netinet/in.h>
1590 ],
1591 [ sa_family_t foo; foo = 1235; ],
1592 [ ac_cv_have_sa_family_t="yes" ],
1593
Damien Millerb54b40e2000-06-23 08:23:34 +10001594 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001595 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001596 )
1597])
1598if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1599 AC_DEFINE(HAVE_SA_FAMILY_T)
1600fi
1601
Damien Miller0f91b4e2000-06-18 15:43:25 +10001602AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1603 AC_TRY_COMPILE(
1604 [
1605#include <sys/types.h>
1606 ],
1607 [ pid_t foo; foo = 1235; ],
1608 [ ac_cv_have_pid_t="yes" ],
1609 [ ac_cv_have_pid_t="no" ]
1610 )
1611])
1612if test "x$ac_cv_have_pid_t" = "xyes" ; then
1613 AC_DEFINE(HAVE_PID_T)
1614fi
1615
1616AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1617 AC_TRY_COMPILE(
1618 [
1619#include <sys/types.h>
1620 ],
1621 [ mode_t foo; foo = 1235; ],
1622 [ ac_cv_have_mode_t="yes" ],
1623 [ ac_cv_have_mode_t="no" ]
1624 )
1625])
1626if test "x$ac_cv_have_mode_t" = "xyes" ; then
1627 AC_DEFINE(HAVE_MODE_T)
1628fi
1629
Damien Miller61e50f12000-05-08 20:49:37 +10001630
1631AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1632 AC_TRY_COMPILE(
1633 [
Damien Miller81171112000-04-23 11:14:01 +10001634#include <sys/types.h>
1635#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001636 ],
1637 [ struct sockaddr_storage s; ],
1638 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1639 [ ac_cv_have_struct_sockaddr_storage="no" ]
1640 )
1641])
1642if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1643 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1644fi
Damien Miller34132e52000-01-14 15:45:46 +11001645
Damien Miller61e50f12000-05-08 20:49:37 +10001646AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1647 AC_TRY_COMPILE(
1648 [
Damien Miller7b22d652000-06-18 14:07:04 +10001649#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001650#include <netinet/in.h>
1651 ],
1652 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1653 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1654 [ ac_cv_have_struct_sockaddr_in6="no" ]
1655 )
1656])
1657if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1658 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1659fi
Damien Miller34132e52000-01-14 15:45:46 +11001660
Damien Miller61e50f12000-05-08 20:49:37 +10001661AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1662 AC_TRY_COMPILE(
1663 [
Damien Miller7b22d652000-06-18 14:07:04 +10001664#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001665#include <netinet/in.h>
1666 ],
1667 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1668 [ ac_cv_have_struct_in6_addr="yes" ],
1669 [ ac_cv_have_struct_in6_addr="no" ]
1670 )
1671])
1672if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1673 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1674fi
Damien Miller34132e52000-01-14 15:45:46 +11001675
Damien Miller61e50f12000-05-08 20:49:37 +10001676AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1677 AC_TRY_COMPILE(
1678 [
Damien Miller81171112000-04-23 11:14:01 +10001679#include <sys/types.h>
1680#include <sys/socket.h>
1681#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001682 ],
1683 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1684 [ ac_cv_have_struct_addrinfo="yes" ],
1685 [ ac_cv_have_struct_addrinfo="no" ]
1686 )
1687])
1688if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1689 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1690fi
1691
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001692AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1693 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001694 [ #include <sys/time.h> ],
1695 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001696 [ ac_cv_have_struct_timeval="yes" ],
1697 [ ac_cv_have_struct_timeval="no" ]
1698 )
1699])
1700if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1701 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1702 have_struct_timeval=1
1703fi
1704
Tim Rice4e4dc562003-03-18 10:21:40 -08001705AC_CHECK_TYPES(struct timespec)
1706
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001707# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001708if test "x$ac_cv_have_int64_t" = "xno" -a \
1709 "x$ac_cv_sizeof_long_int" != "x8" -a \
1710 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001711 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1712 echo "an alternative compiler (I.E., GCC) before continuing."
1713 echo ""
1714 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001715else
1716dnl test snprintf (broken on SCO w/gcc)
1717 AC_TRY_RUN(
1718 [
1719#include <stdio.h>
1720#include <string.h>
1721#ifdef HAVE_SNPRINTF
1722main()
1723{
1724 char buf[50];
1725 char expected_out[50];
1726 int mazsize = 50 ;
1727#if (SIZEOF_LONG_INT == 8)
1728 long int num = 0x7fffffffffffffff;
1729#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001730 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001731#endif
1732 strcpy(expected_out, "9223372036854775807");
1733 snprintf(buf, mazsize, "%lld", num);
1734 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001735 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001736 exit(0);
1737}
1738#else
1739main() { exit(0); }
1740#endif
1741 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1742 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001743fi
1744
Damien Miller78315eb2000-09-29 23:01:36 +11001745dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001746OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1747OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1748OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1749OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1750OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001751OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001752OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1753OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001754OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001755OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1756OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1757OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1758OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001759OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1760OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1761OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1762OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001763
1764AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001765
Damien Miller61e50f12000-05-08 20:49:37 +10001766AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1767 ac_cv_have_ss_family_in_struct_ss, [
1768 AC_TRY_COMPILE(
1769 [
Damien Miller81171112000-04-23 11:14:01 +10001770#include <sys/types.h>
1771#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001772 ],
1773 [ struct sockaddr_storage s; s.ss_family = 1; ],
1774 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1775 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1776 )
1777])
1778if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1779 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1780fi
1781
Damien Miller61e50f12000-05-08 20:49:37 +10001782AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1783 ac_cv_have___ss_family_in_struct_ss, [
1784 AC_TRY_COMPILE(
1785 [
Damien Miller81171112000-04-23 11:14:01 +10001786#include <sys/types.h>
1787#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001788 ],
1789 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1790 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1791 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1792 )
1793])
1794if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1795 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1796fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001797
Damien Millerad833b32000-08-23 10:46:23 +10001798AC_CACHE_CHECK([for pw_class field in struct passwd],
1799 ac_cv_have_pw_class_in_struct_passwd, [
1800 AC_TRY_COMPILE(
1801 [
Damien Millerad833b32000-08-23 10:46:23 +10001802#include <pwd.h>
1803 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001804 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001805 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1806 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1807 )
1808])
1809if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1810 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1811fi
1812
Kevin Steves82456952001-06-22 21:14:18 +00001813AC_CACHE_CHECK([for pw_expire field in struct passwd],
1814 ac_cv_have_pw_expire_in_struct_passwd, [
1815 AC_TRY_COMPILE(
1816 [
1817#include <pwd.h>
1818 ],
1819 [ struct passwd p; p.pw_expire = 0; ],
1820 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1821 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1822 )
1823])
1824if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1825 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1826fi
1827
1828AC_CACHE_CHECK([for pw_change field in struct passwd],
1829 ac_cv_have_pw_change_in_struct_passwd, [
1830 AC_TRY_COMPILE(
1831 [
1832#include <pwd.h>
1833 ],
1834 [ struct passwd p; p.pw_change = 0; ],
1835 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1836 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1837 )
1838])
1839if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1840 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1841fi
Damien Miller61e50f12000-05-08 20:49:37 +10001842
Tim Rice28bbb0c2002-05-27 17:37:32 -07001843dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001844AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1845 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001846 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001847 [
Tim Riceae49fe62002-04-12 10:26:21 -07001848#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001849#include <sys/socket.h>
1850#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001851int main() {
1852#ifdef msg_accrights
1853exit(1);
1854#endif
1855struct msghdr m;
1856m.msg_accrights = 0;
1857exit(0);
1858}
Kevin Steves939c9db2002-03-22 17:23:25 +00001859 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001860 [ ac_cv_have_accrights_in_msghdr="yes" ],
1861 [ ac_cv_have_accrights_in_msghdr="no" ]
1862 )
1863])
1864if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1865 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1866fi
1867
Kevin Stevesa44e0352002-04-07 16:18:03 +00001868AC_CACHE_CHECK([for msg_control field in struct msghdr],
1869 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001870 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001871 [
Tim Riceae49fe62002-04-12 10:26:21 -07001872#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001873#include <sys/socket.h>
1874#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001875int main() {
1876#ifdef msg_control
1877exit(1);
1878#endif
1879struct msghdr m;
1880m.msg_control = 0;
1881exit(0);
1882}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001883 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001884 [ ac_cv_have_control_in_msghdr="yes" ],
1885 [ ac_cv_have_control_in_msghdr="no" ]
1886 )
1887])
1888if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1889 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1890fi
1891
Damien Miller61e50f12000-05-08 20:49:37 +10001892AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001893 AC_TRY_LINK([],
1894 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001895 [ ac_cv_libc_defines___progname="yes" ],
1896 [ ac_cv_libc_defines___progname="no" ]
1897 )
1898])
1899if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1900 AC_DEFINE(HAVE___PROGNAME)
1901fi
1902
Kevin Steves4846f4a2002-03-22 18:19:53 +00001903AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1904 AC_TRY_LINK([
1905#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001906],
1907 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001908 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1909 [ ac_cv_cc_implements___FUNCTION__="no" ]
1910 )
1911])
1912if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1913 AC_DEFINE(HAVE___FUNCTION__)
1914fi
1915
1916AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1917 AC_TRY_LINK([
1918#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001919],
1920 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001921 [ ac_cv_cc_implements___func__="yes" ],
1922 [ ac_cv_cc_implements___func__="no" ]
1923 )
1924])
1925if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1926 AC_DEFINE(HAVE___func__)
1927fi
1928
Damien Miller4f8e6692001-07-14 13:22:53 +10001929AC_CACHE_CHECK([whether getopt has optreset support],
1930 ac_cv_have_getopt_optreset, [
1931 AC_TRY_LINK(
1932 [
1933#include <getopt.h>
1934 ],
1935 [ extern int optreset; optreset = 0; ],
1936 [ ac_cv_have_getopt_optreset="yes" ],
1937 [ ac_cv_have_getopt_optreset="no" ]
1938 )
1939])
1940if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1941 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1942fi
Damien Millera22ba012000-03-02 23:09:20 +11001943
Damien Millerecbb26d2000-07-15 14:59:14 +10001944AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001945 AC_TRY_LINK([],
1946 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001947 [ ac_cv_libc_defines_sys_errlist="yes" ],
1948 [ ac_cv_libc_defines_sys_errlist="no" ]
1949 )
1950])
1951if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1952 AC_DEFINE(HAVE_SYS_ERRLIST)
1953fi
1954
1955
Damien Miller11fa2cc2000-08-16 10:35:58 +10001956AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001957 AC_TRY_LINK([],
1958 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001959 [ ac_cv_libc_defines_sys_nerr="yes" ],
1960 [ ac_cv_libc_defines_sys_nerr="no" ]
1961 )
1962])
1963if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1964 AC_DEFINE(HAVE_SYS_NERR)
1965fi
1966
Damien Millera8e06ce2003-11-21 23:48:55 +11001967SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001968# Check whether user wants sectok support
1969AC_ARG_WITH(sectok,
1970 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001971 [
1972 if test "x$withval" != "xno" ; then
1973 if test "x$withval" != "xyes" ; then
1974 CPPFLAGS="$CPPFLAGS -I${withval}"
1975 LDFLAGS="$LDFLAGS -L${withval}"
1976 if test ! -z "$need_dash_r" ; then
1977 LDFLAGS="$LDFLAGS -R${withval}"
1978 fi
1979 if test ! -z "$blibpath" ; then
1980 blibpath="$blibpath:${withval}"
1981 fi
1982 fi
1983 AC_CHECK_HEADERS(sectok.h)
1984 if test "$ac_cv_header_sectok_h" != yes; then
1985 AC_MSG_ERROR(Can't find sectok.h)
1986 fi
1987 AC_CHECK_LIB(sectok, sectok_open)
1988 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1989 AC_MSG_ERROR(Can't find libsectok)
1990 fi
1991 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001992 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11001993 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001994 fi
1995 ]
1996)
1997
1998# Check whether user wants OpenSC support
1999AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002000 AC_HELP_STRING([--with-opensc=PFX],
2001 [Enable smartcard support using OpenSC]),
2002 opensc_config_prefix="$withval", opensc_config_prefix="")
2003if test x$opensc_config_prefix != x ; then
2004 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2005 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2006 if test "$OPENSC_CONFIG" != "no"; then
2007 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2008 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2009 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2010 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2011 AC_DEFINE(SMARTCARD)
2012 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002013 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002014 fi
2015fi
Damien Miller85de5802001-09-18 14:01:11 +10002016
Darren Tucker5f88d342003-10-15 16:57:57 +10002017# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002018AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002019 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002020 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002021 # Needed by our getrrsetbyname()
2022 AC_SEARCH_LIBS(res_query, resolv)
2023 AC_SEARCH_LIBS(dn_expand, resolv)
2024 AC_CHECK_FUNCS(_getshort _getlong)
2025 AC_CHECK_MEMBER(HEADER.ad,
2026 [AC_DEFINE(HAVE_HEADER_AD)],,
2027 [#include <arpa/nameser.h>])
2028 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002029
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002030# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002031KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002032AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002033 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002034 [ if test "x$withval" != "xno" ; then
2035 if test "x$withval" = "xyes" ; then
2036 KRB5ROOT="/usr/local"
2037 else
2038 KRB5ROOT=${withval}
2039 fi
2040
2041 AC_DEFINE(KRB5)
2042 KRB5_MSG="yes"
2043
2044 AC_MSG_CHECKING(for krb5-config)
2045 if test -x $KRB5ROOT/bin/krb5-config ; then
2046 KRB5CONF=$KRB5ROOT/bin/krb5-config
2047 AC_MSG_RESULT($KRB5CONF)
2048
2049 AC_MSG_CHECKING(for gssapi support)
2050 if $KRB5CONF | grep gssapi >/dev/null ; then
2051 AC_MSG_RESULT(yes)
2052 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
2053 dnl m4 quadragraphs: "sed 's/-l[^- ]*//g'"
2054 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
2055 K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002056 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002057 AC_MSG_RESULT(no)
2058 K5CFLAGS="`$KRB5CONF --cflags`"
2059 K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
2060 K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002061 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002062 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2063 LDFLAGS="$LDFLAGS $K5LDFLAGS"
2064 AC_MSG_CHECKING(whether we are using Heimdal)
2065 AC_TRY_COMPILE([ #include <krb5.h> ],
2066 [ char *tmp = heimdal_version; ],
2067 [ AC_MSG_RESULT(yes)
2068 AC_DEFINE(HEIMDAL) ],
2069 AC_MSG_RESULT(no)
2070 )
2071 else
2072 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002073 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002074 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002075 AC_MSG_CHECKING(whether we are using Heimdal)
2076 AC_TRY_COMPILE([ #include <krb5.h> ],
2077 [ char *tmp = heimdal_version; ],
2078 [ AC_MSG_RESULT(yes)
2079 AC_DEFINE(HEIMDAL)
2080 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2081 ],
2082 [ AC_MSG_RESULT(no)
2083 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2084 ]
2085 )
Damien Miller200d0a72003-06-30 19:21:36 +10002086 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002087
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002088 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2089 [ AC_DEFINE(GSSAPI)
2090 K5LIBS="-lgssapi $K5LIBS" ],
2091 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2092 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002093 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002094 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2095 $K5LIBS)
2096 ],
2097 $K5LIBS)
2098
2099 AC_CHECK_HEADER(gssapi.h, ,
2100 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002101 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002102 AC_CHECK_HEADERS(gssapi.h, ,
2103 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002104 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002105 ]
2106 )
2107
2108 oldCPP="$CPPFLAGS"
2109 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2110 AC_CHECK_HEADER(gssapi_krb5.h, ,
2111 [ CPPFLAGS="$oldCPP" ])
2112
Damien Millera8e06ce2003-11-21 23:48:55 +11002113 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002114 if test ! -z "$need_dash_r" ; then
2115 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2116 fi
2117 if test ! -z "$blibpath" ; then
2118 blibpath="$blibpath:${KRB5ROOT}/lib"
2119 fi
2120 fi ]
2121 AC_SEARCH_LIBS(k_hasafs, kafs,
Darren Tucker3c78c5e2004-01-23 22:03:10 +11002122 [ AC_DEFINE(USE_AFS)
Darren Tucker1d3ca582004-01-22 12:05:34 +11002123 K5LIBS="-lkafs $K5LIBS"
2124 ]
2125 )
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002126)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002127LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002128
Damien Millera22ba012000-03-02 23:09:20 +11002129# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002130
Damien Millerf58c6722002-05-13 13:15:42 +10002131PRIVSEP_PATH=/var/empty
2132AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002133 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002134 [
2135 if test "x$withval" != "$no" ; then
2136 PRIVSEP_PATH=$withval
2137 fi
2138 ]
2139)
2140AC_SUBST(PRIVSEP_PATH)
2141
Damien Millera22ba012000-03-02 23:09:20 +11002142AC_ARG_WITH(xauth,
2143 [ --with-xauth=PATH Specify path to xauth program ],
2144 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002145 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002146 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002147 fi
2148 ],
2149 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002150 TestPath="$PATH"
2151 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2152 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2153 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2154 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2155 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002156 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002157 xauth_path="/usr/openwin/bin/xauth"
2158 fi
2159 ]
2160)
2161
Damien Miller7d901272003-01-13 16:55:22 +11002162STRIP_OPT=-s
2163AC_ARG_ENABLE(strip,
2164 [ --disable-strip Disable calling strip(1) on install],
2165 [
2166 if test "x$enableval" = "xno" ; then
2167 STRIP_OPT=
2168 fi
2169 ]
2170)
2171AC_SUBST(STRIP_OPT)
2172
Damien Millera19cf472000-11-29 13:28:50 +11002173if test -z "$xauth_path" ; then
2174 XAUTH_PATH="undefined"
2175 AC_SUBST(XAUTH_PATH)
2176else
Damien Millera22ba012000-03-02 23:09:20 +11002177 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002178 XAUTH_PATH=$xauth_path
2179 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002180fi
Damien Millera22ba012000-03-02 23:09:20 +11002181
2182# Check for mail directory (last resort if we cannot get it from headers)
2183if test ! -z "$MAIL" ; then
2184 maildir=`dirname $MAIL`
2185 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2186fi
2187
Damien Millera22ba012000-03-02 23:09:20 +11002188if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002189 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002190 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002191 [
2192 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2193 have_dev_ptmx=1
2194 ]
2195 )
2196 fi
Damien Millera22ba012000-03-02 23:09:20 +11002197fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002198AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002199 [
2200 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2201 have_dev_ptc=1
2202 ]
2203)
2204
Damien Millera22ba012000-03-02 23:09:20 +11002205# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002206AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002207 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002208 [
Damien Miller897741e2001-04-16 10:41:46 +10002209 case "$withval" in
2210 man|cat|doc)
2211 MANTYPE=$withval
2212 ;;
2213 *)
2214 AC_MSG_ERROR(invalid man type: $withval)
2215 ;;
2216 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002217 ]
2218)
Ben Lindstrombc709922001-04-18 18:04:21 +00002219if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002220 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2221 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002222 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2223 MANTYPE=doc
2224 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2225 MANTYPE=man
2226 else
2227 MANTYPE=cat
2228 fi
2229fi
Damien Miller670a4b82000-01-22 13:53:11 +11002230AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002231if test "$MANTYPE" = "doc"; then
2232 mansubdir=man;
2233else
2234 mansubdir=$MANTYPE;
2235fi
2236AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002237
Damien Millera22ba012000-03-02 23:09:20 +11002238# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002239MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002240AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002241 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002242 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002243 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002244 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002245 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002246 fi
2247 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002248)
2249
Damien Millera22ba012000-03-02 23:09:20 +11002250# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002251AC_ARG_WITH(shadow,
2252 [ --without-shadow Disable shadow password support],
2253 [
2254 if test "x$withval" = "xno" ; then
2255 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002256 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002257 fi
2258 ]
2259)
2260
Damien Miller1f335fb2000-06-26 11:31:33 +10002261if test -z "$disable_shadow" ; then
2262 AC_MSG_CHECKING([if the systems has expire shadow information])
2263 AC_TRY_COMPILE(
2264 [
2265#include <sys/types.h>
2266#include <shadow.h>
2267 struct spwd sp;
2268 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2269 [ sp_expire_available=yes ], []
2270 )
2271
2272 if test "x$sp_expire_available" = "xyes" ; then
2273 AC_MSG_RESULT(yes)
2274 AC_DEFINE(HAS_SHADOW_EXPIRE)
2275 else
2276 AC_MSG_RESULT(no)
2277 fi
2278fi
2279
Damien Millera22ba012000-03-02 23:09:20 +11002280# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002281if test ! -z "$IPADDR_IN_DISPLAY" ; then
2282 DISPLAY_HACK_MSG="yes"
2283 AC_DEFINE(IPADDR_IN_DISPLAY)
2284else
Damien Millera8e06ce2003-11-21 23:48:55 +11002285 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002286 AC_ARG_WITH(ipaddr-display,
2287 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2288 [
2289 if test "x$withval" != "xno" ; then
2290 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002291 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002292 fi
2293 ]
2294 )
2295fi
Damien Miller76112de1999-12-21 11:18:08 +11002296
Darren Tuckere1a790d2003-09-16 11:52:19 +10002297# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002298AC_ARG_ENABLE(etc-default-login,
2299 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2300[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002301AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2302
2303if test "x$external_path_file" = "x/etc/default/login"; then
2304 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2305fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002306])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002307
Tim Rice43a1c132002-04-17 21:19:14 -07002308dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2309if test $ac_cv_func_login_getcapbool = "yes" -a \
2310 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002311 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002312fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002313
Damien Millera22ba012000-03-02 23:09:20 +11002314# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002315SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002316AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002317 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002318 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002319 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002320 AC_MSG_WARN([
2321--with-default-path=PATH has no effect on this system.
2322Edit /etc/login.conf instead.])
2323 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002324 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002325 AC_MSG_WARN([
2326--with-default-path=PATH will only be used if PATH is not defined in
2327$external_path_file .])
2328 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002329 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002330 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002331 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002332 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002333 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2334 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002335 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002336 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002337 AC_MSG_WARN([
2338If PATH is defined in $external_path_file, ensure the path to scp is included,
2339otherwise scp will not work.])
2340 fi
2341 AC_TRY_RUN(
2342 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002343/* find out what STDPATH is */
2344#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002345#ifdef HAVE_PATHS_H
2346# include <paths.h>
2347#endif
2348#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002349# ifdef _PATH_USERPATH /* Irix */
2350# define _PATH_STDPATH _PATH_USERPATH
2351# else
2352# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2353# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002354#endif
2355#include <sys/types.h>
2356#include <sys/stat.h>
2357#include <fcntl.h>
2358#define DATA "conftest.stdpath"
2359
2360main()
2361{
2362 FILE *fd;
2363 int rc;
2364
2365 fd = fopen(DATA,"w");
2366 if(fd == NULL)
2367 exit(1);
2368
2369 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2370 exit(1);
2371
2372 exit(0);
2373}
2374 ], [ user_path=`cat conftest.stdpath` ],
2375 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2376 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2377 )
2378# make sure $bindir is in USER_PATH so scp will work
2379 t_bindir=`eval echo ${bindir}`
2380 case $t_bindir in
2381 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2382 esac
2383 case $t_bindir in
2384 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2385 esac
2386 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2387 if test $? -ne 0 ; then
2388 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2389 if test $? -ne 0 ; then
2390 user_path=$user_path:$t_bindir
2391 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2392 fi
2393 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002394 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002395)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002396if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002397 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2398 AC_SUBST(user_path)
2399fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002400
Damien Millera18bbd32002-05-13 10:48:57 +10002401# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002402AC_ARG_WITH(superuser-path,
2403 [ --with-superuser-path= Specify different path for super-user],
2404 [
2405 if test "x$withval" != "xno" ; then
2406 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2407 superuser_path=$withval
2408 fi
2409 ]
2410)
2411
2412
Damien Miller61e50f12000-05-08 20:49:37 +10002413AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002414IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002415AC_ARG_WITH(4in6,
2416 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2417 [
2418 if test "x$withval" != "xno" ; then
2419 AC_MSG_RESULT(yes)
2420 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002421 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002422 else
2423 AC_MSG_RESULT(no)
2424 fi
2425 ],[
2426 if test "x$inet6_default_4in6" = "xyes"; then
2427 AC_MSG_RESULT([yes (default)])
2428 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002429 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002430 else
2431 AC_MSG_RESULT([no (default)])
2432 fi
2433 ]
2434)
2435
Damien Miller60396b02001-02-18 17:01:00 +11002436# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002437BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002438AC_ARG_WITH(bsd-auth,
2439 [ --with-bsd-auth Enable BSD auth support],
2440 [
2441 if test "x$withval" != "xno" ; then
2442 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002443 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002444 fi
2445 ]
2446)
2447
Damien Millera22ba012000-03-02 23:09:20 +11002448# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002449piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002450# make sure the directory exists
2451if test ! -d $piddir ; then
2452 piddir=`eval echo ${sysconfdir}`
2453 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002454 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002455 esac
2456fi
2457
Tim Rice88f2ab52002-03-17 12:17:34 -08002458AC_ARG_WITH(pid-dir,
2459 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2460 [
2461 if test "x$withval" != "xno" ; then
2462 piddir=$withval
2463 if test ! -d $piddir ; then
2464 AC_MSG_WARN([** no $piddir directory on this system **])
2465 fi
2466 fi
2467 ]
2468)
2469
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002470AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002471AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002472
andre2ff7b5d2000-06-03 14:57:40 +00002473dnl allow user to disable some login recording features
2474AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002475 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002476 [
2477 if test "x$enableval" = "xno" ; then
2478 AC_DEFINE(DISABLE_LASTLOG)
2479 fi
2480 ]
andre2ff7b5d2000-06-03 14:57:40 +00002481)
2482AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002483 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002484 [
2485 if test "x$enableval" = "xno" ; then
2486 AC_DEFINE(DISABLE_UTMP)
2487 fi
2488 ]
andre2ff7b5d2000-06-03 14:57:40 +00002489)
2490AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002491 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002492 [
2493 if test "x$enableval" = "xno" ; then
2494 AC_DEFINE(DISABLE_UTMPX)
2495 fi
2496 ]
andre2ff7b5d2000-06-03 14:57:40 +00002497)
2498AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002499 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002500 [
2501 if test "x$enableval" = "xno" ; then
2502 AC_DEFINE(DISABLE_WTMP)
2503 fi
2504 ]
andre2ff7b5d2000-06-03 14:57:40 +00002505)
2506AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002507 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002508 [
2509 if test "x$enableval" = "xno" ; then
2510 AC_DEFINE(DISABLE_WTMPX)
2511 fi
2512 ]
andre2ff7b5d2000-06-03 14:57:40 +00002513)
2514AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002515 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002516 [
2517 if test "x$enableval" = "xno" ; then
2518 AC_DEFINE(DISABLE_LOGIN)
2519 fi
2520 ]
andre2ff7b5d2000-06-03 14:57:40 +00002521)
2522AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002523 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002524 [
2525 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002526 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002527 fi
2528 ]
andre2ff7b5d2000-06-03 14:57:40 +00002529)
2530AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002531 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002532 [
2533 if test "x$enableval" = "xno" ; then
2534 AC_DEFINE(DISABLE_PUTUTXLINE)
2535 fi
2536 ]
andre2ff7b5d2000-06-03 14:57:40 +00002537)
2538AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002539 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002540 [
2541 if test "x$withval" = "xno" ; then
2542 AC_DEFINE(DISABLE_LASTLOG)
2543 else
2544 conf_lastlog_location=$withval
2545 fi
2546 ]
2547)
andre2ff7b5d2000-06-03 14:57:40 +00002548
2549dnl lastlog, [uw]tmpx? detection
2550dnl NOTE: set the paths in the platform section to avoid the
2551dnl need for command-line parameters
2552dnl lastlog and [uw]tmp are subject to a file search if all else fails
2553
2554dnl lastlog detection
2555dnl NOTE: the code itself will detect if lastlog is a directory
2556AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2557AC_TRY_COMPILE([
2558#include <sys/types.h>
2559#include <utmp.h>
2560#ifdef HAVE_LASTLOG_H
2561# include <lastlog.h>
2562#endif
Damien Miller2994e082000-06-04 15:51:47 +10002563#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002564# include <paths.h>
2565#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002566#ifdef HAVE_LOGIN_H
2567# include <login.h>
2568#endif
andre2ff7b5d2000-06-03 14:57:40 +00002569 ],
2570 [ char *lastlog = LASTLOG_FILE; ],
2571 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002572 [
2573 AC_MSG_RESULT(no)
2574 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2575 AC_TRY_COMPILE([
2576#include <sys/types.h>
2577#include <utmp.h>
2578#ifdef HAVE_LASTLOG_H
2579# include <lastlog.h>
2580#endif
2581#ifdef HAVE_PATHS_H
2582# include <paths.h>
2583#endif
2584 ],
2585 [ char *lastlog = _PATH_LASTLOG; ],
2586 [ AC_MSG_RESULT(yes) ],
2587 [
andree441aa32000-06-12 22:34:38 +00002588 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002589 system_lastlog_path=no
2590 ])
2591 ]
andre2ff7b5d2000-06-03 14:57:40 +00002592)
Damien Miller2994e082000-06-04 15:51:47 +10002593
andre2ff7b5d2000-06-03 14:57:40 +00002594if test -z "$conf_lastlog_location"; then
2595 if test x"$system_lastlog_path" = x"no" ; then
2596 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002597 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002598 conf_lastlog_location=$f
2599 fi
2600 done
2601 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002602 AC_MSG_WARN([** Cannot find lastlog **])
2603 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002604 fi
2605 fi
2606fi
2607
2608if test -n "$conf_lastlog_location"; then
2609 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2610fi
2611
2612dnl utmp detection
2613AC_MSG_CHECKING([if your system defines UTMP_FILE])
2614AC_TRY_COMPILE([
2615#include <sys/types.h>
2616#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002617#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002618# include <paths.h>
2619#endif
2620 ],
2621 [ char *utmp = UTMP_FILE; ],
2622 [ AC_MSG_RESULT(yes) ],
2623 [ AC_MSG_RESULT(no)
2624 system_utmp_path=no ]
2625)
2626if test -z "$conf_utmp_location"; then
2627 if test x"$system_utmp_path" = x"no" ; then
2628 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2629 if test -f $f ; then
2630 conf_utmp_location=$f
2631 fi
2632 done
2633 if test -z "$conf_utmp_location"; then
2634 AC_DEFINE(DISABLE_UTMP)
2635 fi
2636 fi
2637fi
2638if test -n "$conf_utmp_location"; then
2639 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2640fi
2641
2642dnl wtmp detection
2643AC_MSG_CHECKING([if your system defines WTMP_FILE])
2644AC_TRY_COMPILE([
2645#include <sys/types.h>
2646#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002647#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002648# include <paths.h>
2649#endif
2650 ],
2651 [ char *wtmp = WTMP_FILE; ],
2652 [ AC_MSG_RESULT(yes) ],
2653 [ AC_MSG_RESULT(no)
2654 system_wtmp_path=no ]
2655)
2656if test -z "$conf_wtmp_location"; then
2657 if test x"$system_wtmp_path" = x"no" ; then
2658 for f in /usr/adm/wtmp /var/log/wtmp; do
2659 if test -f $f ; then
2660 conf_wtmp_location=$f
2661 fi
2662 done
2663 if test -z "$conf_wtmp_location"; then
2664 AC_DEFINE(DISABLE_WTMP)
2665 fi
2666 fi
2667fi
2668if test -n "$conf_wtmp_location"; then
2669 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2670fi
2671
2672
2673dnl utmpx detection - I don't know any system so perverse as to require
2674dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2675dnl there, though.
2676AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2677AC_TRY_COMPILE([
2678#include <sys/types.h>
2679#include <utmp.h>
2680#ifdef HAVE_UTMPX_H
2681#include <utmpx.h>
2682#endif
Damien Miller2994e082000-06-04 15:51:47 +10002683#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002684# include <paths.h>
2685#endif
2686 ],
2687 [ char *utmpx = UTMPX_FILE; ],
2688 [ AC_MSG_RESULT(yes) ],
2689 [ AC_MSG_RESULT(no)
2690 system_utmpx_path=no ]
2691)
2692if test -z "$conf_utmpx_location"; then
2693 if test x"$system_utmpx_path" = x"no" ; then
2694 AC_DEFINE(DISABLE_UTMPX)
2695 fi
2696else
2697 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2698fi
2699
2700dnl wtmpx detection
2701AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2702AC_TRY_COMPILE([
2703#include <sys/types.h>
2704#include <utmp.h>
2705#ifdef HAVE_UTMPX_H
2706#include <utmpx.h>
2707#endif
Damien Miller2994e082000-06-04 15:51:47 +10002708#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002709# include <paths.h>
2710#endif
2711 ],
2712 [ char *wtmpx = WTMPX_FILE; ],
2713 [ AC_MSG_RESULT(yes) ],
2714 [ AC_MSG_RESULT(no)
2715 system_wtmpx_path=no ]
2716)
2717if test -z "$conf_wtmpx_location"; then
2718 if test x"$system_wtmpx_path" = x"no" ; then
2719 AC_DEFINE(DISABLE_WTMPX)
2720 fi
2721else
2722 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2723fi
2724
Damien Miller4018c192000-04-30 09:30:44 +10002725
Damien Miller29ea30d2000-03-17 10:54:15 +11002726if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002727 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2728 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002729fi
2730
Tim Rice4cec93f2002-02-26 08:40:48 -08002731dnl remove pam and dl because they are in $LIBPAM
2732if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002733 LIBS=`echo $LIBS | sed 's/-lpam //'`
2734fi
2735if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2736 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002737fi
2738
Damien Millerbac2d8a2000-09-05 16:13:06 +11002739AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002740AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2741AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002742
Damien Miller7b22d652000-06-18 14:07:04 +10002743# Print summary of options
2744
Damien Miller7b22d652000-06-18 14:07:04 +10002745# Someone please show me a better way :)
2746A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2747B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2748C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2749D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002750E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002751F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002752G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002753H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2754I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2755J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002756
2757echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002758echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002759echo " User binaries: $B"
2760echo " System binaries: $C"
2761echo " Configuration files: $D"
2762echo " Askpass program: $E"
2763echo " Manual pages: $F"
2764echo " PID file: $G"
2765echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002766if test "x$external_path_file" = "x/etc/login.conf" ; then
2767echo " At runtime, sshd will use the path defined in $external_path_file"
2768echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002769else
Damien Millerf58c6722002-05-13 13:15:42 +10002770echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002771 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002772echo " (If PATH is set in $external_path_file it will be used instead. If"
2773echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2774 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002775fi
Damien Millera18bbd32002-05-13 10:48:57 +10002776if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002777echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002778fi
Damien Millerf58c6722002-05-13 13:15:42 +10002779echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002780echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002781echo " KerberosV support: $KRB5_MSG"
2782echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002783echo " S/KEY support: $SKEY_MSG"
2784echo " TCP Wrappers support: $TCPW_MSG"
2785echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002786echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002787echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2788echo " BSD Auth support: $BSD_AUTH_MSG"
2789echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002790if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002791echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002792fi
2793
Damien Miller7b22d652000-06-18 14:07:04 +10002794echo ""
2795
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002796echo " Host: ${host}"
2797echo " Compiler: ${CC}"
2798echo " Compiler flags: ${CFLAGS}"
2799echo "Preprocessor flags: ${CPPFLAGS}"
2800echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002801echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002802
2803echo ""
2804
Damien Miller82cf0ce2000-12-20 13:34:48 +11002805if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002806 echo "PAM is enabled. You may need to install a PAM control file "
2807 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002808 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002809 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002810 echo ""
2811fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002812
Damien Miller6c21c512002-01-22 21:57:53 +11002813if test ! -z "$RAND_HELPER_CMDHASH" ; then
2814 echo "WARNING: you are using the builtin random number collection "
2815 echo "service. Please read WARNING.RNG and request that your OS "
2816 echo "vendor includes kernel-based random number collection in "
2817 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002818 echo ""
2819fi
Damien Miller60396b02001-02-18 17:01:00 +11002820