blob: 768b174b2d8bf5dd76bad63f624cf179d2044699 [file] [log] [blame]
Darren Tuckerf58fb7e2004-02-06 15:59:06 +11001# $Id: configure.ac,v 1.192 2004/02/06 04:59:06 dtucker Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100012AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110013AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100014AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110015AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000016AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070017AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080018AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110019AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100020AC_PATH_PROG(ENT, ent)
21AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110022AC_PATH_PROG(TEST_MINUS_S_SH, bash)
23AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
24AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070025AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110026
Damien Millere8bb4502001-09-25 16:39:35 +100027# System features
28AC_SYS_LARGEFILE
29
Damien Miller3f62aba2000-11-29 11:56:35 +110030if test -z "$AR" ; then
31 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32fi
33
Damien Millerad833b32000-08-23 10:46:23 +100034# Use LOGIN_PROGRAM from environment if possible
35if test ! -z "$LOGIN_PROGRAM" ; then
36 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37else
38 # Search for login
39 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
40 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
41 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
42 fi
43fi
44
Damien Miller166bd442000-03-16 10:48:25 +110045if test -z "$LD" ; then
46 LD=$CC
47fi
48AC_SUBST(LD)
49
Damien Miller166bd442000-03-16 10:48:25 +110050AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110051if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100052 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110053fi
54
Tim Rice88368a32003-12-08 12:35:59 -080055AC_ARG_WITH(rpath,
56 [ --without-rpath Disable auto-added -R linker paths],
57 [
58 if test "x$withval" = "xno" ; then
59 need_dash_r=""
60 fi
61 if test "x$withval" = "xyes" ; then
62 need_dash_r=1
63 fi
64 ]
65)
66
Damien Millera22ba012000-03-02 23:09:20 +110067# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110068case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110069*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110070 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +100071 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -080072 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110073 fi
Damien Millereab4bae2003-04-29 23:22:40 +100074 saved_LDFLAGS="$LDFLAGS"
75 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
76 if (test -z "$blibflags"); then
77 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
78 AC_TRY_LINK([], [], [blibflags=$tryflags])
79 fi
80 done
81 if (test -z "$blibflags"); then
82 AC_MSG_RESULT(not found)
83 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
84 else
85 AC_MSG_RESULT($blibflags)
86 fi
87 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100088 dnl Check for authenticate. Might be in libs.a on older AIXes
89 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070090 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100091 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070092 LIBS="$LIBS -ls"
93 ])
94 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +100095 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
96 AC_CHECK_DECL(loginfailed,
97 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
98 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +100099 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000100 [(void)loginfailed("user","host","tty",0);],
101 [AC_MSG_RESULT(yes)
102 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000103 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000104 )],
105 [],
106 [#include <usersec.h>]
107 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000108 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +1100109 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000110 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000111 AC_DEFINE(SETEUID_BREAKS_SETUID)
112 AC_DEFINE(BROKEN_SETREUID)
113 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000114 dnl AIX handles lastlog as part of its login message
115 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000116 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000117 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100118 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100119*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100120 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800121 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100122 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000123 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100124 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100125 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000126 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000127 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700128 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000129 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100130 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000131*-*-dgux*)
132 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100133 AC_DEFINE(SETEUID_BREAKS_SETUID)
134 AC_DEFINE(BROKEN_SETREUID)
135 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000136 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000137*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000138 AC_MSG_CHECKING(if we have working getaddrinfo)
139 AC_TRY_RUN([#include <mach-o/dyld.h>
140main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
141 exit(0);
142 else
143 exit(1);
144}], [AC_MSG_RESULT(working)],
145 [AC_MSG_RESULT(buggy)
146 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700147 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000148 AC_DEFINE(SETEUID_BREAKS_SETUID)
149 AC_DEFINE(BROKEN_SETREUID)
150 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100151 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000152 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000153*-*-hpux10.26)
154 if test -z "$GCC"; then
155 CFLAGS="$CFLAGS -Ae"
156 fi
157 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
158 IPADDR_IN_DISPLAY=yes
159 AC_DEFINE(HAVE_SECUREWARE)
160 AC_DEFINE(USE_PIPES)
161 AC_DEFINE(LOGIN_NO_ENDOPT)
162 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000163 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000164 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000165 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700166 LIBS="$LIBS -lsec -lsecpw"
167 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000168 disable_ptmx_check=yes
169 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100170*-*-hpux10*)
171 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000172 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100173 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000174 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100175 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000176 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000177 AC_DEFINE(LOGIN_NO_ENDOPT)
178 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100179 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000180 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000181 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700182 LIBS="$LIBS -lsec"
183 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100184 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000185*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000186 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100187 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100188 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100189 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000190 AC_DEFINE(LOGIN_NO_ENDOPT)
191 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100192 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000193 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000194 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tuckerf58fb7e2004-02-06 15:59:06 +1100195 case "$host" in
196 *-*-hpux11.11*)
197 AC_DEFINE(BROKEN_GETADDRINFO);;
198 esac
Tim Ricef028f1e2002-07-19 12:41:10 -0700199 LIBS="$LIBS -lsec"
200 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000201 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100202*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100203 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000204 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000205 AC_DEFINE(SETEUID_BREAKS_SETUID)
206 AC_DEFINE(BROKEN_SETREUID)
207 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000208 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000209 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100210 ;;
211*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100212 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000213 AC_DEFINE(WITH_IRIX_ARRAY)
214 AC_DEFINE(WITH_IRIX_PROJECT)
215 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000216 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000217 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000218 AC_DEFINE(SETEUID_BREAKS_SETUID)
219 AC_DEFINE(BROKEN_SETREUID)
220 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000221 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000222 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100223 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100224*-*-linux*)
225 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100226 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000227 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100228 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000229 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000230 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000231 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100232 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000233 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000234 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000235 AC_DEFINE(BROKEN_CMSG_TYPE)
236 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000237 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100238 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000239mips-sony-bsd|mips-sony-newsos4)
240 AC_DEFINE(HAVE_NEWS4)
241 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000242 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100243*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000244 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800245 if test "x$withval" != "xno" ; then
246 need_dash_r=1
247 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100248 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100249*-*-freebsd*)
250 check_for_libcrypt_later=1
251 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000252*-*-bsdi*)
253 AC_DEFINE(SETEUID_BREAKS_SETUID)
254 AC_DEFINE(BROKEN_SETREUID)
255 AC_DEFINE(BROKEN_SETREGID)
256 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000257*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000258 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100259 conf_utmp_location=/etc/utmp
260 conf_wtmp_location=/usr/adm/wtmp
261 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000262 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000263 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000264 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100265 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000266 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100267*-*-solaris*)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100268 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000269 AC_DEFINE(LOGIN_NEEDS_UTMPX)
270 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000271 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000272 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000273 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
274 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000275 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000276 # hardwire lastlog location (can't detect it on some versions)
277 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000278 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
279 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
280 if test "$sol2ver" -ge 8; then
281 AC_MSG_RESULT(yes)
282 AC_DEFINE(DISABLE_UTMP)
283 AC_DEFINE(DISABLE_WTMP)
284 else
285 AC_MSG_RESULT(no)
286 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100287 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000288*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000289 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000290 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100291 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000292 conf_utmp_location=/etc/utmp
293 conf_wtmp_location=/var/adm/wtmp
294 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000295 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000296 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000297*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700298 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000299 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000300 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000301 AC_DEFINE(SETEUID_BREAKS_SETUID)
302 AC_DEFINE(BROKEN_SETREUID)
303 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000304 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000305*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700306 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000307 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100308 IPADDR_IN_DISPLAY=yes
309 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000310 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000311 AC_DEFINE(SETEUID_BREAKS_SETUID)
312 AC_DEFINE(BROKEN_SETREUID)
313 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000314 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000315 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700316 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
317 # Attention: always take care to bind libsocket and libnsl before libc,
318 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000319 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100320*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100321 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700322 AC_DEFINE(SETEUID_BREAKS_SETUID)
323 AC_DEFINE(BROKEN_SETREUID)
324 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100325 ;;
326*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100327 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700328 AC_DEFINE(SETEUID_BREAKS_SETUID)
329 AC_DEFINE(BROKEN_SETREUID)
330 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100331 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100332*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100333 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100334*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800335 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Rice13aae5e2001-10-21 17:53:58 -0700336 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100337 RANLIB=true
338 no_dev_ptmx=1
339 AC_DEFINE(BROKEN_SYS_TERMIO_H)
340 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000341 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000342 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100343 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700344 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100345 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700346 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700347 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100348 ;;
349*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800350 if test -z "$GCC"; then
351 CFLAGS="$CFLAGS -belf"
352 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100353 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000354 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100355 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000356 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000357 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700358 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700359 AC_DEFINE(SETEUID_BREAKS_SETUID)
360 AC_DEFINE(BROKEN_SETREUID)
361 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700362 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100363 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700364 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000365 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000366*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100367 AC_DEFINE(NO_SSH_LASTLOG)
368 AC_DEFINE(SETEUID_BREAKS_SETUID)
369 AC_DEFINE(BROKEN_SETREUID)
370 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000371 AC_DEFINE(USE_PIPES)
372 AC_DEFINE(DISABLE_FD_PASSING)
373 LDFLAGS="$LDFLAGS"
374 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
375 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000376 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000377*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100378 AC_DEFINE(SETEUID_BREAKS_SETUID)
379 AC_DEFINE(BROKEN_SETREUID)
380 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000381 AC_DEFINE(WITH_ABBREV_NO_TTY)
382 AC_DEFINE(USE_PIPES)
383 AC_DEFINE(DISABLE_FD_PASSING)
384 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100385 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000386 MANTYPE=cat
387 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000388*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100389 AC_DEFINE(SETEUID_BREAKS_SETUID)
390 AC_DEFINE(BROKEN_SETREUID)
391 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000392 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700393 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700394 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000395 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
396 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
397 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700398 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000399*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000400 AC_MSG_CHECKING(for Digital Unix SIA)
401 no_osfsia=""
402 AC_ARG_WITH(osfsia,
403 [ --with-osfsia Enable Digital Unix SIA],
404 [
405 if test "x$withval" = "xno" ; then
406 AC_MSG_RESULT(disabled)
407 no_osfsia=1
408 fi
409 ],
410 )
411 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000412 if test -f /etc/sia/matrix.conf; then
413 AC_MSG_RESULT(yes)
414 AC_DEFINE(HAVE_OSF_SIA)
415 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000416 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000417 LIBS="$LIBS -lsecurity -ldb -lm -laud"
418 else
419 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100420 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000421 fi
422 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000423 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700424 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000425 AC_DEFINE(BROKEN_SETREUID)
426 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000427 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000428
429*-*-nto-qnx)
430 AC_DEFINE(USE_PIPES)
431 AC_DEFINE(NO_X11_UNIX_SOCKETS)
432 AC_DEFINE(MISSING_NFDBITS)
433 AC_DEFINE(MISSING_HOWMANY)
434 AC_DEFINE(MISSING_FD_MASK)
435 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100436esac
437
Damien Millere37bfc12000-06-05 09:37:43 +1000438# Allow user to specify flags
439AC_ARG_WITH(cflags,
440 [ --with-cflags Specify additional flags to pass to compiler],
441 [
442 if test "x$withval" != "xno" ; then
443 CFLAGS="$CFLAGS $withval"
444 fi
445 ]
446)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000447AC_ARG_WITH(cppflags,
448 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
449 [
450 if test "x$withval" != "xno"; then
451 CPPFLAGS="$CPPFLAGS $withval"
452 fi
453 ]
454)
Damien Millere37bfc12000-06-05 09:37:43 +1000455AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000456 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000457 [
458 if test "x$withval" != "xno" ; then
459 LDFLAGS="$LDFLAGS $withval"
460 fi
461 ]
462)
463AC_ARG_WITH(libs,
464 [ --with-libs Specify additional libraries to link with],
465 [
466 if test "x$withval" != "xno" ; then
467 LIBS="$LIBS $withval"
468 fi
469 ]
470)
471
Darren Tucker6eb93042003-06-29 21:30:41 +1000472AC_MSG_CHECKING(compiler and flags for sanity)
473AC_TRY_RUN([
474#include <stdio.h>
475int main(){exit(0);}
476 ],
477 [ AC_MSG_RESULT(yes) ],
478 [
479 AC_MSG_RESULT(no)
480 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
481 ]
482)
483
Tim Rice4cec93f2002-02-26 08:40:48 -0800484# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000485AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000486 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800487 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100488 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000489 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000490 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
Tim Rice2597bfd2004-01-26 19:03:39 -0800491 sys/cdefs.h sys/mman.h sys/pstat.h sys/ptms.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000492 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700493 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Damien Miller5c3a5582003-09-23 22:12:38 +1000494 util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800495
Damien Millera22ba012000-03-02 23:09:20 +1100496# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700497AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
498AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000499
Damien Millerdf288022001-02-18 13:07:07 +1100500dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700501if test "x$with_tcp_wrappers" != "xno" ; then
502 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
503 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
504 fi
505fi
Damien Millerdf288022001-02-18 13:07:07 +1100506
Tim Rice1e1ef642003-09-11 22:19:31 -0700507dnl IRIX and Solaris 2.5.1 have dirname() in libgen
508AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
509 AC_CHECK_LIB(gen, dirname,[
510 AC_CACHE_CHECK([for broken dirname],
511 ac_cv_have_broken_dirname, [
512 save_LIBS="$LIBS"
513 LIBS="$LIBS -lgen"
514 AC_TRY_RUN(
515 [
516#include <libgen.h>
517#include <string.h>
518
519int main(int argc, char **argv) {
520 char *s, buf[32];
521
522 strncpy(buf,"/etc", 32);
523 s = dirname(buf);
524 if (!s || strncmp(s, "/", 32) != 0) {
525 exit(1);
526 } else {
527 exit(0);
528 }
529}
530 ],
531 [ ac_cv_have_broken_dirname="no" ],
532 [ ac_cv_have_broken_dirname="yes" ]
533 )
534 LIBS="$save_LIBS"
535 ])
536 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
537 LIBS="$LIBS -lgen"
538 AC_DEFINE(HAVE_DIRNAME)
539 AC_CHECK_HEADERS(libgen.h)
540 fi
541 ])
542])
543
544AC_CHECK_FUNC(getspnam, ,
545 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
546AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
547
Tim Rice13aae5e2001-10-21 17:53:58 -0700548dnl zlib is required
549AC_ARG_WITH(zlib,
550 [ --with-zlib=PATH Use zlib in PATH],
551 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000552 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100553 AC_MSG_ERROR([*** zlib is required ***])
554 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700555 if test -d "$withval/lib"; then
556 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700557 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700558 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700559 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700560 fi
561 else
562 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700563 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700564 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700565 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700566 fi
567 fi
568 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700569 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700570 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700571 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700572 fi
573 ]
574)
575
Tim Ricefcb62202004-01-23 18:35:16 -0800576AC_CHECK_LIB(z, deflate, ,
577 [
578 saved_CPPFLAGS="$CPPFLAGS"
579 saved_LDFLAGS="$LDFLAGS"
580 save_LIBS="$LIBS"
581 dnl Check default zlib install dir
582 if test -n "${need_dash_r}"; then
583 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
584 else
585 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
586 fi
587 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
588 LIBS="$LIBS -lz"
589 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
590 [
591 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
592 ]
593 )
594 ]
595)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100596AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100597
598AC_ARG_WITH(zlib-version-check,
599 [ --without-zlib-version-check Disable zlib version check],
600 [ if test "x$withval" = "xno" ; then
601 zlib_check_nonfatal=1
602 fi
603 ]
604)
605
Darren Tucker2dcd2392004-01-23 17:13:33 +1100606AC_MSG_CHECKING(for zlib 1.1.4 or greater)
607AC_TRY_RUN([
608#include <zlib.h>
609int main()
610{
611 int a, b, c, v;
612 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
613 exit(1);
614 v = a*1000000 + b*1000 + c;
615 if (v >= 1001004)
616 exit(0);
617 exit(2);
618}
619 ],
620 AC_MSG_RESULT(yes),
621 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100622 if test -z "$zlib_check_nonfatal" ; then
623 AC_MSG_ERROR([*** zlib too old - check config.log ***
624Your reported zlib version has known security problems. It's possible your
625vendor has fixed these problems without changing the version number. If you
626are sure this is the case, you can disable the check by running
627"./configure --without-zlib-version-check".
628If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
629 else
630 AC_MSG_WARN([zlib version may have security problems])
631 fi
632 ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100633)
Damien Miller6f9c3372000-10-25 10:06:04 +1100634
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000635dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100636AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000637 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
638)
Damien Millera8e06ce2003-11-21 23:48:55 +1100639AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700640 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
641 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000642)
Damien Millerab18c411999-11-11 10:40:23 +1100643
Tim Ricee589a292001-11-03 11:09:32 -0800644dnl Checks for libutil functions
645AC_CHECK_HEADERS(libutil.h)
646AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
647AC_CHECK_FUNCS(logout updwtmp logwtmp)
648
Ben Lindstrom8697e082001-02-24 21:41:10 +0000649AC_FUNC_STRFTIME
650
Damien Miller3c027682001-03-14 11:39:45 +1100651# Check for ALTDIRFUNC glob() extension
652AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
653AC_EGREP_CPP(FOUNDIT,
654 [
655 #include <glob.h>
656 #ifdef GLOB_ALTDIRFUNC
657 FOUNDIT
658 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100659 ],
Damien Miller3c027682001-03-14 11:39:45 +1100660 [
661 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
662 AC_MSG_RESULT(yes)
663 ],
664 [
665 AC_MSG_RESULT(no)
666 ]
667)
Damien Millerab18c411999-11-11 10:40:23 +1100668
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000669# Check for g.gl_matchc glob() extension
670AC_MSG_CHECKING(for gl_matchc field in glob_t)
671AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100672 [
673 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000674 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100675 ],
676 [
677 AC_DEFINE(GLOB_HAS_GL_MATCHC)
678 AC_MSG_RESULT(yes)
679 ],
680 [
681 AC_MSG_RESULT(no)
682 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000683)
684
Damien Miller18bb4732001-03-28 14:35:30 +1000685AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
686AC_TRY_RUN(
687 [
688#include <sys/types.h>
689#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700690int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000691 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100692 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000693 [
694 AC_MSG_RESULT(no)
695 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
696 ]
697)
698
Damien Millerc547bf12001-02-16 10:18:12 +1100699# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100700SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100701AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700702 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100703 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100704 [
705 if test "x$withval" != "xno" ; then
706
707 if test "x$withval" != "xyes" ; then
708 CPPFLAGS="$CPPFLAGS -I${withval}/include"
709 LDFLAGS="$LDFLAGS -L${withval}/lib"
710 fi
711
712 AC_DEFINE(SKEY)
713 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100714 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100715
Tim Rice4cec93f2002-02-26 08:40:48 -0800716 AC_MSG_CHECKING([for s/key support])
717 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100718 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800719#include <stdio.h>
720#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700721int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800722 ],
723 [AC_MSG_RESULT(yes)],
724 [
725 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100726 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
727 ])
728 fi
729 ]
730)
731
732# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700733TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100734AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700735 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100736 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100737 [
738 if test "x$withval" != "xno" ; then
739 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700740 saved_LDFLAGS="$LDFLAGS"
741 saved_CPPFLAGS="$CPPFLAGS"
742 if test -n "${withval}" -a "${withval}" != "yes"; then
743 if test -d "${withval}/lib"; then
744 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700745 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700746 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700747 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700748 fi
749 else
750 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700751 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700752 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700753 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700754 fi
755 fi
756 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700757 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700758 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700759 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700760 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700761 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800762 LIBWRAP="-lwrap"
763 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100764 AC_MSG_CHECKING(for libwrap)
765 AC_TRY_LINK(
766 [
767#include <tcpd.h>
768 int deny_severity = 0, allow_severity = 0;
769 ],
770 [hosts_access(0);],
771 [
772 AC_MSG_RESULT(yes)
773 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800774 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700775 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100776 ],
777 [
778 AC_MSG_ERROR([*** libwrap missing])
779 ]
780 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800781 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100782 fi
783 ]
784)
785
Damien Millerfe1f1432003-02-24 15:45:42 +1100786dnl Checks for library functions. Please keep in alphabetical order
787AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000788 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000789 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000790 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000791 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100792 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000793 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
794 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
795 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100796 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000797 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000798 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000799 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100800)
Tim Rice13aae5e2001-10-21 17:53:58 -0700801
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000802# IRIX has a const char return value for gai_strerror()
803AC_CHECK_FUNCS(gai_strerror,[
804 AC_DEFINE(HAVE_GAI_STRERROR)
805 AC_TRY_COMPILE([
806#include <sys/types.h>
807#include <sys/socket.h>
808#include <netdb.h>
809
810const char *gai_strerror(int);],[
811char *str;
812
813str = gai_strerror(0);],[
814 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
815 [Define if gai_strerror() returns const char *])])])
816
Damien Millercd6853c2003-01-28 11:33:42 +1100817AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
818
Darren Tuckerf1159b52003-07-07 19:44:01 +1000819dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000820AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000821AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000822
Darren Tuckerb2427c82003-09-10 15:22:44 +1000823dnl tcsendbreak might be a macro
824AC_CHECK_DECL(tcsendbreak,
825 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100826 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000827 [#include <termios.h>]
828)
829
Darren Tucker2a6b0292003-12-31 14:59:17 +1100830AC_CHECK_FUNCS(setresuid, [
831 dnl Some platorms have setresuid that isn't implemented, test for this
832 AC_MSG_CHECKING(if setresuid seems to work)
833 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100834#include <stdlib.h>
835#include <errno.h>
836int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100837 ],
838 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100839 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100840 AC_MSG_RESULT(not implemented)]
841 )
842])
Darren Tuckere937be32003-12-17 18:53:26 +1100843
Darren Tucker2a6b0292003-12-31 14:59:17 +1100844AC_CHECK_FUNCS(setresgid, [
845 dnl Some platorms have setresgid that isn't implemented, test for this
846 AC_MSG_CHECKING(if setresgid seems to work)
847 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100848#include <stdlib.h>
849#include <errno.h>
850int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100851 ],
852 [AC_MSG_RESULT(yes)],
853 [AC_DEFINE(BROKEN_SETRESGID)
854 AC_MSG_RESULT(not implemented)]
855 )
856])
Darren Tuckere937be32003-12-17 18:53:26 +1100857
Damien Millerad833b32000-08-23 10:46:23 +1000858dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000859AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000860dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000861AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000862AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000863dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000864AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000865AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100866
Damien Millera8e06ce2003-11-21 23:48:55 +1100867AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100868 [AC_DEFINE(HAVE_DAEMON)],
869 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
870)
871
Damien Millera8e06ce2003-11-21 23:48:55 +1100872AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100873 [AC_DEFINE(HAVE_GETPAGESIZE)],
874 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
875)
876
Damien Millercb170cb2000-07-01 16:52:55 +1000877# Check for broken snprintf
878if test "x$ac_cv_func_snprintf" = "xyes" ; then
879 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
880 AC_TRY_RUN(
881 [
882#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700883int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000884 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100885 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000886 [
887 AC_MSG_RESULT(no)
888 AC_DEFINE(BROKEN_SNPRINTF)
889 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
890 ]
891 )
892fi
893
Damien Millere8328192003-01-07 15:18:32 +1100894dnl see whether mkstemp() requires XXXXXX
895if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
896AC_MSG_CHECKING([for (overly) strict mkstemp])
897AC_TRY_RUN(
898 [
899#include <stdlib.h>
900main() { char template[]="conftest.mkstemp-test";
901if (mkstemp(template) == -1)
902 exit(1);
903unlink(template); exit(0);
904}
905 ],
906 [
907 AC_MSG_RESULT(no)
908 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100909 [
Damien Millere8328192003-01-07 15:18:32 +1100910 AC_MSG_RESULT(yes)
911 AC_DEFINE(HAVE_STRICT_MKSTEMP)
912 ],
913 [
914 AC_MSG_RESULT(yes)
915 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100916 ]
Damien Millere8328192003-01-07 15:18:32 +1100917)
918fi
919
Darren Tucker70a3d552003-08-21 17:58:29 +1000920dnl make sure that openpty does not reacquire controlling terminal
921if test ! -z "$check_for_openpty_ctty_bug"; then
922 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
923 AC_TRY_RUN(
924 [
925#include <stdio.h>
926#include <sys/fcntl.h>
927#include <sys/types.h>
928#include <sys/wait.h>
929
930int
931main()
932{
933 pid_t pid;
934 int fd, ptyfd, ttyfd, status;
935
936 pid = fork();
937 if (pid < 0) { /* failed */
938 exit(1);
939 } else if (pid > 0) { /* parent */
940 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100941 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000942 exit(WEXITSTATUS(status));
943 else
944 exit(2);
945 } else { /* child */
946 close(0); close(1); close(2);
947 setsid();
948 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
949 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
950 if (fd >= 0)
951 exit(3); /* Acquired ctty: broken */
952 else
953 exit(0); /* Did not acquire ctty: OK */
954 }
955}
956 ],
957 [
958 AC_MSG_RESULT(yes)
959 ],
960 [
961 AC_MSG_RESULT(no)
962 AC_DEFINE(SSHD_ACQUIRES_CTTY)
963 ]
964 )
965fi
966
Damien Miller606f8802000-09-16 15:39:56 +1100967AC_FUNC_GETPGRP
968
Damien Millera64b57a2001-01-17 10:44:13 +1100969# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000970PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100971AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100972 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100973 [
Damien Millera64b57a2001-01-17 10:44:13 +1100974 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100975 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
976 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100977 AC_MSG_ERROR([PAM headers not found])
978 fi
979
980 AC_CHECK_LIB(dl, dlopen, , )
981 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
982 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000983 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100984
Damien Millera64b57a2001-01-17 10:44:13 +1100985 PAM_MSG="yes"
986
987 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800988 if test $ac_cv_lib_dl_dlopen = yes; then
989 LIBPAM="-lpam -ldl"
990 else
991 LIBPAM="-lpam"
992 fi
993 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100994 fi
995 ]
996)
Damien Millera22ba012000-03-02 23:09:20 +1100997
Damien Millera64b57a2001-01-17 10:44:13 +1100998# Check for older PAM
999if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001000 # Check PAM strerror arguments (old PAM)
1001 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1002 AC_TRY_COMPILE(
1003 [
Damien Miller81171112000-04-23 11:14:01 +10001004#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001005#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001006#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001007#elif defined (HAVE_PAM_PAM_APPL_H)
1008#include <pam/pam_appl.h>
1009#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001010 ],
1011 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001012 [AC_MSG_RESULT(no)],
1013 [
1014 AC_DEFINE(HAVE_OLD_PAM)
1015 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001016 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001017 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001018 )
Damien Millera22ba012000-03-02 23:09:20 +11001019fi
1020
Damien Millerfc93d4b2002-09-04 23:26:29 +10001021# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1022# because the system crypt() is more featureful.
1023if test "x$check_for_libcrypt_before" = "x1"; then
1024 AC_CHECK_LIB(crypt, crypt)
1025fi
1026
Tim Riceaef73712002-05-11 13:17:42 -07001027# Search for OpenSSL
1028saved_CPPFLAGS="$CPPFLAGS"
1029saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001030AC_ARG_WITH(ssl-dir,
1031 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1032 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001033 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001034 if test -d "$withval/lib"; then
1035 if test -n "${need_dash_r}"; then
1036 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1037 else
1038 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1039 fi
1040 else
1041 if test -n "${need_dash_r}"; then
1042 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1043 else
1044 LDFLAGS="-L${withval} ${LDFLAGS}"
1045 fi
1046 fi
1047 if test -d "$withval/include"; then
1048 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1049 else
1050 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1051 fi
Damien Millera22ba012000-03-02 23:09:20 +11001052 fi
1053 ]
1054)
Tim Riceaef73712002-05-11 13:17:42 -07001055LIBS="$LIBS -lcrypto"
1056AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001057 [
Tim Riceaef73712002-05-11 13:17:42 -07001058 dnl Check default openssl install dir
1059 if test -n "${need_dash_r}"; then
1060 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001061 else
Tim Riceaef73712002-05-11 13:17:42 -07001062 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001063 fi
Tim Riceaef73712002-05-11 13:17:42 -07001064 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1065 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1066 [
1067 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1068 ]
1069 )
1070 ]
1071)
1072
Tim Riced730b782002-08-13 18:52:10 -07001073# Determine OpenSSL header version
1074AC_MSG_CHECKING([OpenSSL header version])
1075AC_TRY_RUN(
1076 [
1077#include <stdio.h>
1078#include <string.h>
1079#include <openssl/opensslv.h>
1080#define DATA "conftest.sslincver"
1081int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001082 FILE *fd;
1083 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001084
Damien Millera8e06ce2003-11-21 23:48:55 +11001085 fd = fopen(DATA,"w");
1086 if(fd == NULL)
1087 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001088
1089 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1090 exit(1);
1091
1092 exit(0);
1093}
1094 ],
1095 [
1096 ssl_header_ver=`cat conftest.sslincver`
1097 AC_MSG_RESULT($ssl_header_ver)
1098 ],
1099 [
1100 AC_MSG_RESULT(not found)
1101 AC_MSG_ERROR(OpenSSL version header not found.)
1102 ]
1103)
1104
1105# Determine OpenSSL library version
1106AC_MSG_CHECKING([OpenSSL library version])
1107AC_TRY_RUN(
1108 [
1109#include <stdio.h>
1110#include <string.h>
1111#include <openssl/opensslv.h>
1112#include <openssl/crypto.h>
1113#define DATA "conftest.ssllibver"
1114int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001115 FILE *fd;
1116 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001117
Damien Millera8e06ce2003-11-21 23:48:55 +11001118 fd = fopen(DATA,"w");
1119 if(fd == NULL)
1120 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001121
1122 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1123 exit(1);
1124
1125 exit(0);
1126}
1127 ],
1128 [
1129 ssl_library_ver=`cat conftest.ssllibver`
1130 AC_MSG_RESULT($ssl_library_ver)
1131 ],
1132 [
1133 AC_MSG_RESULT(not found)
1134 AC_MSG_ERROR(OpenSSL library not found.)
1135 ]
1136)
Damien Millera22ba012000-03-02 23:09:20 +11001137
Damien Millerec932372002-01-22 22:16:03 +11001138# Sanity check OpenSSL headers
1139AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1140AC_TRY_RUN(
1141 [
1142#include <string.h>
1143#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001144int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001145 ],
1146 [
1147 AC_MSG_RESULT(yes)
1148 ],
1149 [
1150 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001151 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1152Check config.log for details.
1153Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001154 ]
1155)
1156
Damien Millera8e06ce2003-11-21 23:48:55 +11001157# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001158# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001159if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001160 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001161fi
1162
Damien Miller6c21c512002-01-22 21:57:53 +11001163
1164### Configure cryptographic random number support
1165
1166# Check wheter OpenSSL seeds itself
1167AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1168AC_TRY_RUN(
1169 [
1170#include <string.h>
1171#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001172int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001173 ],
1174 [
1175 OPENSSL_SEEDS_ITSELF=yes
1176 AC_MSG_RESULT(yes)
1177 ],
1178 [
1179 AC_MSG_RESULT(no)
1180 # Default to use of the rand helper if OpenSSL doesn't
1181 # seed itself
1182 USE_RAND_HELPER=yes
1183 ]
1184)
1185
1186
1187# Do we want to force the use of the rand helper?
1188AC_ARG_WITH(rand-helper,
1189 [ --with-rand-helper Use subprocess to gather strong randomness ],
1190 [
1191 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001192 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001193 # the previous test showed it to be unseeded.
1194 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1195 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1196 OPENSSL_SEEDS_ITSELF=yes
1197 USE_RAND_HELPER=""
1198 fi
1199 else
1200 USE_RAND_HELPER=yes
1201 fi
1202 ],
1203)
1204
1205# Which randomness source do we use?
1206if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1207 # OpenSSL only
1208 AC_DEFINE(OPENSSL_PRNG_ONLY)
1209 RAND_MSG="OpenSSL internal ONLY"
1210 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001211elif test ! -z "$USE_RAND_HELPER" ; then
1212 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001213 RAND_MSG="ssh-rand-helper"
1214 INSTALL_SSH_RAND_HELPER="yes"
1215fi
1216AC_SUBST(INSTALL_SSH_RAND_HELPER)
1217
1218### Configuration of ssh-rand-helper
1219
1220# PRNGD TCP socket
1221AC_ARG_WITH(prngd-port,
1222 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1223 [
Damien Millere996d722002-01-23 11:20:59 +11001224 case "$withval" in
1225 no)
1226 withval=""
1227 ;;
1228 [[0-9]]*)
1229 ;;
1230 *)
1231 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1232 ;;
1233 esac
1234 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001235 PRNGD_PORT="$withval"
1236 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1237 fi
1238 ]
1239)
1240
1241# PRNGD Unix domain socket
1242AC_ARG_WITH(prngd-socket,
1243 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1244 [
Damien Millere996d722002-01-23 11:20:59 +11001245 case "$withval" in
1246 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001247 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001248 ;;
1249 no)
1250 withval=""
1251 ;;
1252 /*)
1253 ;;
1254 *)
1255 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1256 ;;
1257 esac
1258
1259 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001260 if test ! -z "$PRNGD_PORT" ; then
1261 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1262 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001263 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001264 AC_MSG_WARN(Entropy socket is not readable)
1265 fi
1266 PRNGD_SOCKET="$withval"
1267 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1268 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001269 ],
1270 [
1271 # Check for existing socket only if we don't have a random device already
1272 if test "$USE_RAND_HELPER" = yes ; then
1273 AC_MSG_CHECKING(for PRNGD/EGD socket)
1274 # Insert other locations here
1275 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1276 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1277 PRNGD_SOCKET="$sock"
1278 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1279 break;
1280 fi
1281 done
1282 if test ! -z "$PRNGD_SOCKET" ; then
1283 AC_MSG_RESULT($PRNGD_SOCKET)
1284 else
1285 AC_MSG_RESULT(not found)
1286 fi
1287 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001288 ]
1289)
1290
1291# Change default command timeout for hashing entropy source
1292entropy_timeout=200
1293AC_ARG_WITH(entropy-timeout,
1294 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1295 [
1296 if test "x$withval" != "xno" ; then
1297 entropy_timeout=$withval
1298 fi
1299 ]
1300)
Damien Miller6c21c512002-01-22 21:57:53 +11001301AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1302
Damien Millerd3f6ad22002-06-25 10:24:47 +10001303SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001304AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001305 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001306 [
1307 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001308 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001309 fi
1310 ]
1311)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001312AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1313AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001314
Tim Rice88f2ab52002-03-17 12:17:34 -08001315# We do this little dance with the search path to insure
1316# that programs that we select for use by installed programs
1317# (which may be run by the super-user) come from trusted
1318# locations before they come from the user's private area.
1319# This should help avoid accidentally configuring some
1320# random version of a program in someone's personal bin.
1321
1322OPATH=$PATH
1323PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001324test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001325test -d /sbin && PATH=$PATH:/sbin
1326test -d /usr/sbin && PATH=$PATH:/usr/sbin
1327PATH=$PATH:/etc:$OPATH
1328
Damien Millera8e06ce2003-11-21 23:48:55 +11001329# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001330OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1331OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1332OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1333OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1334OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1335OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1336OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1337OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1338OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1339OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1340OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1341OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1342OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1343OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1344OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1345OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001346# restore PATH
1347PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001348
1349# Where does ssh-rand-helper get its randomness from?
1350INSTALL_SSH_PRNG_CMDS=""
1351if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1352 if test ! -z "$PRNGD_PORT" ; then
1353 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1354 elif test ! -z "$PRNGD_SOCKET" ; then
1355 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1356 else
1357 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1358 RAND_HELPER_CMDHASH=yes
1359 INSTALL_SSH_PRNG_CMDS="yes"
1360 fi
1361fi
1362AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1363
1364
Ben Lindstromb5628642000-10-18 00:02:25 +00001365# Cheap hack to ensure NEWS-OS libraries are arranged right.
1366if test ! -z "$SONY" ; then
1367 LIBS="$LIBS -liberty";
1368fi
1369
Damien Millera22ba012000-03-02 23:09:20 +11001370# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001371AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001372AC_CHECK_SIZEOF(short int, 2)
1373AC_CHECK_SIZEOF(int, 4)
1374AC_CHECK_SIZEOF(long int, 4)
1375AC_CHECK_SIZEOF(long long int, 8)
1376
Damien Millerfa2bb692002-04-23 23:22:25 +10001377# Sanity check long long for some platforms (AIX)
1378if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1379 ac_cv_sizeof_long_long_int=0
1380fi
1381
Damien Millera22ba012000-03-02 23:09:20 +11001382# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001383AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1384 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001385 [ #include <sys/types.h> ],
1386 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001387 [ ac_cv_have_u_int="yes" ],
1388 [ ac_cv_have_u_int="no" ]
1389 )
1390])
1391if test "x$ac_cv_have_u_int" = "xyes" ; then
1392 AC_DEFINE(HAVE_U_INT)
1393 have_u_int=1
1394fi
1395
Damien Miller61e50f12000-05-08 20:49:37 +10001396AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1397 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001398 [ #include <sys/types.h> ],
1399 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001400 [ ac_cv_have_intxx_t="yes" ],
1401 [ ac_cv_have_intxx_t="no" ]
1402 )
1403])
1404if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1405 AC_DEFINE(HAVE_INTXX_T)
1406 have_intxx_t=1
1407fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001408
1409if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001410 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001411then
1412 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1413 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001414 [ #include <stdint.h> ],
1415 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001416 [
1417 AC_DEFINE(HAVE_INTXX_T)
1418 AC_MSG_RESULT(yes)
1419 ],
1420 [ AC_MSG_RESULT(no) ]
1421 )
1422fi
1423
Damien Miller578783e2000-09-23 14:12:24 +11001424AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1425 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001426 [
1427#include <sys/types.h>
1428#ifdef HAVE_STDINT_H
1429# include <stdint.h>
1430#endif
1431#include <sys/socket.h>
1432#ifdef HAVE_SYS_BITYPES_H
1433# include <sys/bitypes.h>
1434#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001435 ],
1436 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001437 [ ac_cv_have_int64_t="yes" ],
1438 [ ac_cv_have_int64_t="no" ]
1439 )
1440])
1441if test "x$ac_cv_have_int64_t" = "xyes" ; then
1442 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001443fi
1444
Damien Miller61e50f12000-05-08 20:49:37 +10001445AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1446 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001447 [ #include <sys/types.h> ],
1448 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001449 [ ac_cv_have_u_intxx_t="yes" ],
1450 [ ac_cv_have_u_intxx_t="no" ]
1451 )
1452])
1453if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1454 AC_DEFINE(HAVE_U_INTXX_T)
1455 have_u_intxx_t=1
1456fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001457
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001458if test -z "$have_u_intxx_t" ; then
1459 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1460 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001461 [ #include <sys/socket.h> ],
1462 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001463 [
1464 AC_DEFINE(HAVE_U_INTXX_T)
1465 AC_MSG_RESULT(yes)
1466 ],
1467 [ AC_MSG_RESULT(no) ]
1468 )
1469fi
1470
Damien Miller578783e2000-09-23 14:12:24 +11001471AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1472 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001473 [ #include <sys/types.h> ],
1474 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001475 [ ac_cv_have_u_int64_t="yes" ],
1476 [ ac_cv_have_u_int64_t="no" ]
1477 )
1478])
1479if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1480 AC_DEFINE(HAVE_U_INT64_T)
1481 have_u_int64_t=1
1482fi
1483
Tim Rice4cec93f2002-02-26 08:40:48 -08001484if test -z "$have_u_int64_t" ; then
1485 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1486 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001487 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001488 [ u_int64_t a; a = 1],
1489 [
1490 AC_DEFINE(HAVE_U_INT64_T)
1491 AC_MSG_RESULT(yes)
1492 ],
1493 [ AC_MSG_RESULT(no) ]
1494 )
1495fi
1496
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001497if test -z "$have_u_intxx_t" ; then
1498 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1499 AC_TRY_COMPILE(
1500 [
1501#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001502 ],
1503 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001504 [ ac_cv_have_uintxx_t="yes" ],
1505 [ ac_cv_have_uintxx_t="no" ]
1506 )
1507 ])
1508 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1509 AC_DEFINE(HAVE_UINTXX_T)
1510 fi
1511fi
1512
1513if test -z "$have_uintxx_t" ; then
1514 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1515 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001516 [ #include <stdint.h> ],
1517 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001518 [
1519 AC_DEFINE(HAVE_UINTXX_T)
1520 AC_MSG_RESULT(yes)
1521 ],
1522 [ AC_MSG_RESULT(no) ]
1523 )
1524fi
1525
Damien Milleredb82922000-06-20 13:25:52 +10001526if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001527 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001528then
1529 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1530 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001531 [
1532#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001533 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001534 [
Damien Miller70494d12000-04-03 15:57:06 +10001535 int8_t a; int16_t b; int32_t c;
1536 u_int8_t e; u_int16_t f; u_int32_t g;
1537 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001538 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001539 [
1540 AC_DEFINE(HAVE_U_INTXX_T)
1541 AC_DEFINE(HAVE_INTXX_T)
1542 AC_MSG_RESULT(yes)
1543 ],
1544 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001545 )
Damien Millerb29ea912000-01-15 14:12:03 +11001546fi
1547
Damien Miller58be7382001-09-15 21:31:54 +10001548
1549AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1550 AC_TRY_COMPILE(
1551 [
1552#include <sys/types.h>
1553 ],
1554 [ u_char foo; foo = 125; ],
1555 [ ac_cv_have_u_char="yes" ],
1556 [ ac_cv_have_u_char="no" ]
1557 )
1558])
1559if test "x$ac_cv_have_u_char" = "xyes" ; then
1560 AC_DEFINE(HAVE_U_CHAR)
1561fi
1562
Tim Rice13aae5e2001-10-21 17:53:58 -07001563TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001564
Tim Rice200a5c02002-02-26 22:12:34 -08001565AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001566
Damien Miller61e50f12000-05-08 20:49:37 +10001567AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1568 AC_TRY_COMPILE(
1569 [
1570#include <sys/types.h>
1571 ],
1572 [ size_t foo; foo = 1235; ],
1573 [ ac_cv_have_size_t="yes" ],
1574 [ ac_cv_have_size_t="no" ]
1575 )
1576])
1577if test "x$ac_cv_have_size_t" = "xyes" ; then
1578 AC_DEFINE(HAVE_SIZE_T)
1579fi
Damien Miller95058511999-12-29 10:36:45 +11001580
Damien Miller615f9392000-05-17 22:53:33 +10001581AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1582 AC_TRY_COMPILE(
1583 [
1584#include <sys/types.h>
1585 ],
1586 [ ssize_t foo; foo = 1235; ],
1587 [ ac_cv_have_ssize_t="yes" ],
1588 [ ac_cv_have_ssize_t="no" ]
1589 )
1590])
1591if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1592 AC_DEFINE(HAVE_SSIZE_T)
1593fi
1594
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001595AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1596 AC_TRY_COMPILE(
1597 [
1598#include <time.h>
1599 ],
1600 [ clock_t foo; foo = 1235; ],
1601 [ ac_cv_have_clock_t="yes" ],
1602 [ ac_cv_have_clock_t="no" ]
1603 )
1604])
1605if test "x$ac_cv_have_clock_t" = "xyes" ; then
1606 AC_DEFINE(HAVE_CLOCK_T)
1607fi
1608
Damien Millerb54b40e2000-06-23 08:23:34 +10001609AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1610 AC_TRY_COMPILE(
1611 [
1612#include <sys/types.h>
1613#include <sys/socket.h>
1614 ],
1615 [ sa_family_t foo; foo = 1235; ],
1616 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001617 [ AC_TRY_COMPILE(
1618 [
1619#include <sys/types.h>
1620#include <sys/socket.h>
1621#include <netinet/in.h>
1622 ],
1623 [ sa_family_t foo; foo = 1235; ],
1624 [ ac_cv_have_sa_family_t="yes" ],
1625
Damien Millerb54b40e2000-06-23 08:23:34 +10001626 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001627 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001628 )
1629])
1630if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1631 AC_DEFINE(HAVE_SA_FAMILY_T)
1632fi
1633
Damien Miller0f91b4e2000-06-18 15:43:25 +10001634AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1635 AC_TRY_COMPILE(
1636 [
1637#include <sys/types.h>
1638 ],
1639 [ pid_t foo; foo = 1235; ],
1640 [ ac_cv_have_pid_t="yes" ],
1641 [ ac_cv_have_pid_t="no" ]
1642 )
1643])
1644if test "x$ac_cv_have_pid_t" = "xyes" ; then
1645 AC_DEFINE(HAVE_PID_T)
1646fi
1647
1648AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1649 AC_TRY_COMPILE(
1650 [
1651#include <sys/types.h>
1652 ],
1653 [ mode_t foo; foo = 1235; ],
1654 [ ac_cv_have_mode_t="yes" ],
1655 [ ac_cv_have_mode_t="no" ]
1656 )
1657])
1658if test "x$ac_cv_have_mode_t" = "xyes" ; then
1659 AC_DEFINE(HAVE_MODE_T)
1660fi
1661
Damien Miller61e50f12000-05-08 20:49:37 +10001662
1663AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1664 AC_TRY_COMPILE(
1665 [
Damien Miller81171112000-04-23 11:14:01 +10001666#include <sys/types.h>
1667#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001668 ],
1669 [ struct sockaddr_storage s; ],
1670 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1671 [ ac_cv_have_struct_sockaddr_storage="no" ]
1672 )
1673])
1674if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1675 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1676fi
Damien Miller34132e52000-01-14 15:45:46 +11001677
Damien Miller61e50f12000-05-08 20:49:37 +10001678AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1679 AC_TRY_COMPILE(
1680 [
Damien Miller7b22d652000-06-18 14:07:04 +10001681#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001682#include <netinet/in.h>
1683 ],
1684 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1685 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1686 [ ac_cv_have_struct_sockaddr_in6="no" ]
1687 )
1688])
1689if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1690 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1691fi
Damien Miller34132e52000-01-14 15:45:46 +11001692
Damien Miller61e50f12000-05-08 20:49:37 +10001693AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1694 AC_TRY_COMPILE(
1695 [
Damien Miller7b22d652000-06-18 14:07:04 +10001696#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001697#include <netinet/in.h>
1698 ],
1699 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1700 [ ac_cv_have_struct_in6_addr="yes" ],
1701 [ ac_cv_have_struct_in6_addr="no" ]
1702 )
1703])
1704if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1705 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1706fi
Damien Miller34132e52000-01-14 15:45:46 +11001707
Damien Miller61e50f12000-05-08 20:49:37 +10001708AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1709 AC_TRY_COMPILE(
1710 [
Damien Miller81171112000-04-23 11:14:01 +10001711#include <sys/types.h>
1712#include <sys/socket.h>
1713#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001714 ],
1715 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1716 [ ac_cv_have_struct_addrinfo="yes" ],
1717 [ ac_cv_have_struct_addrinfo="no" ]
1718 )
1719])
1720if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1721 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1722fi
1723
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001724AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1725 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001726 [ #include <sys/time.h> ],
1727 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001728 [ ac_cv_have_struct_timeval="yes" ],
1729 [ ac_cv_have_struct_timeval="no" ]
1730 )
1731])
1732if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1733 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1734 have_struct_timeval=1
1735fi
1736
Tim Rice4e4dc562003-03-18 10:21:40 -08001737AC_CHECK_TYPES(struct timespec)
1738
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001739# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001740if test "x$ac_cv_have_int64_t" = "xno" -a \
1741 "x$ac_cv_sizeof_long_int" != "x8" -a \
1742 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001743 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1744 echo "an alternative compiler (I.E., GCC) before continuing."
1745 echo ""
1746 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001747else
1748dnl test snprintf (broken on SCO w/gcc)
1749 AC_TRY_RUN(
1750 [
1751#include <stdio.h>
1752#include <string.h>
1753#ifdef HAVE_SNPRINTF
1754main()
1755{
1756 char buf[50];
1757 char expected_out[50];
1758 int mazsize = 50 ;
1759#if (SIZEOF_LONG_INT == 8)
1760 long int num = 0x7fffffffffffffff;
1761#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001762 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001763#endif
1764 strcpy(expected_out, "9223372036854775807");
1765 snprintf(buf, mazsize, "%lld", num);
1766 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001767 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001768 exit(0);
1769}
1770#else
1771main() { exit(0); }
1772#endif
1773 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1774 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001775fi
1776
Damien Miller78315eb2000-09-29 23:01:36 +11001777dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001778OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1779OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1780OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1781OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1782OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001783OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001784OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1785OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001786OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001787OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1788OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1789OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1790OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001791OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1792OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1793OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1794OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001795
1796AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001797
Damien Miller61e50f12000-05-08 20:49:37 +10001798AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1799 ac_cv_have_ss_family_in_struct_ss, [
1800 AC_TRY_COMPILE(
1801 [
Damien Miller81171112000-04-23 11:14:01 +10001802#include <sys/types.h>
1803#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001804 ],
1805 [ struct sockaddr_storage s; s.ss_family = 1; ],
1806 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1807 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1808 )
1809])
1810if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1811 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1812fi
1813
Damien Miller61e50f12000-05-08 20:49:37 +10001814AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1815 ac_cv_have___ss_family_in_struct_ss, [
1816 AC_TRY_COMPILE(
1817 [
Damien Miller81171112000-04-23 11:14:01 +10001818#include <sys/types.h>
1819#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001820 ],
1821 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1822 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1823 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1824 )
1825])
1826if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1827 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1828fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001829
Damien Millerad833b32000-08-23 10:46:23 +10001830AC_CACHE_CHECK([for pw_class field in struct passwd],
1831 ac_cv_have_pw_class_in_struct_passwd, [
1832 AC_TRY_COMPILE(
1833 [
Damien Millerad833b32000-08-23 10:46:23 +10001834#include <pwd.h>
1835 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001836 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001837 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1838 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1839 )
1840])
1841if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1842 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1843fi
1844
Kevin Steves82456952001-06-22 21:14:18 +00001845AC_CACHE_CHECK([for pw_expire field in struct passwd],
1846 ac_cv_have_pw_expire_in_struct_passwd, [
1847 AC_TRY_COMPILE(
1848 [
1849#include <pwd.h>
1850 ],
1851 [ struct passwd p; p.pw_expire = 0; ],
1852 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1853 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1854 )
1855])
1856if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1857 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1858fi
1859
1860AC_CACHE_CHECK([for pw_change field in struct passwd],
1861 ac_cv_have_pw_change_in_struct_passwd, [
1862 AC_TRY_COMPILE(
1863 [
1864#include <pwd.h>
1865 ],
1866 [ struct passwd p; p.pw_change = 0; ],
1867 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1868 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1869 )
1870])
1871if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1872 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1873fi
Damien Miller61e50f12000-05-08 20:49:37 +10001874
Tim Rice28bbb0c2002-05-27 17:37:32 -07001875dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001876AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1877 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001878 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001879 [
Tim Riceae49fe62002-04-12 10:26:21 -07001880#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001881#include <sys/socket.h>
1882#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001883int main() {
1884#ifdef msg_accrights
1885exit(1);
1886#endif
1887struct msghdr m;
1888m.msg_accrights = 0;
1889exit(0);
1890}
Kevin Steves939c9db2002-03-22 17:23:25 +00001891 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001892 [ ac_cv_have_accrights_in_msghdr="yes" ],
1893 [ ac_cv_have_accrights_in_msghdr="no" ]
1894 )
1895])
1896if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1897 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1898fi
1899
Kevin Stevesa44e0352002-04-07 16:18:03 +00001900AC_CACHE_CHECK([for msg_control field in struct msghdr],
1901 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001902 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001903 [
Tim Riceae49fe62002-04-12 10:26:21 -07001904#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001905#include <sys/socket.h>
1906#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001907int main() {
1908#ifdef msg_control
1909exit(1);
1910#endif
1911struct msghdr m;
1912m.msg_control = 0;
1913exit(0);
1914}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001915 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001916 [ ac_cv_have_control_in_msghdr="yes" ],
1917 [ ac_cv_have_control_in_msghdr="no" ]
1918 )
1919])
1920if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1921 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1922fi
1923
Damien Miller61e50f12000-05-08 20:49:37 +10001924AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001925 AC_TRY_LINK([],
1926 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001927 [ ac_cv_libc_defines___progname="yes" ],
1928 [ ac_cv_libc_defines___progname="no" ]
1929 )
1930])
1931if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1932 AC_DEFINE(HAVE___PROGNAME)
1933fi
1934
Kevin Steves4846f4a2002-03-22 18:19:53 +00001935AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1936 AC_TRY_LINK([
1937#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001938],
1939 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001940 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1941 [ ac_cv_cc_implements___FUNCTION__="no" ]
1942 )
1943])
1944if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1945 AC_DEFINE(HAVE___FUNCTION__)
1946fi
1947
1948AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1949 AC_TRY_LINK([
1950#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001951],
1952 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001953 [ ac_cv_cc_implements___func__="yes" ],
1954 [ ac_cv_cc_implements___func__="no" ]
1955 )
1956])
1957if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1958 AC_DEFINE(HAVE___func__)
1959fi
1960
Damien Miller4f8e6692001-07-14 13:22:53 +10001961AC_CACHE_CHECK([whether getopt has optreset support],
1962 ac_cv_have_getopt_optreset, [
1963 AC_TRY_LINK(
1964 [
1965#include <getopt.h>
1966 ],
1967 [ extern int optreset; optreset = 0; ],
1968 [ ac_cv_have_getopt_optreset="yes" ],
1969 [ ac_cv_have_getopt_optreset="no" ]
1970 )
1971])
1972if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1973 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1974fi
Damien Millera22ba012000-03-02 23:09:20 +11001975
Damien Millerecbb26d2000-07-15 14:59:14 +10001976AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001977 AC_TRY_LINK([],
1978 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001979 [ ac_cv_libc_defines_sys_errlist="yes" ],
1980 [ ac_cv_libc_defines_sys_errlist="no" ]
1981 )
1982])
1983if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1984 AC_DEFINE(HAVE_SYS_ERRLIST)
1985fi
1986
1987
Damien Miller11fa2cc2000-08-16 10:35:58 +10001988AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001989 AC_TRY_LINK([],
1990 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001991 [ ac_cv_libc_defines_sys_nerr="yes" ],
1992 [ ac_cv_libc_defines_sys_nerr="no" ]
1993 )
1994])
1995if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1996 AC_DEFINE(HAVE_SYS_NERR)
1997fi
1998
Damien Millera8e06ce2003-11-21 23:48:55 +11001999SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002000# Check whether user wants sectok support
2001AC_ARG_WITH(sectok,
2002 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002003 [
2004 if test "x$withval" != "xno" ; then
2005 if test "x$withval" != "xyes" ; then
2006 CPPFLAGS="$CPPFLAGS -I${withval}"
2007 LDFLAGS="$LDFLAGS -L${withval}"
2008 if test ! -z "$need_dash_r" ; then
2009 LDFLAGS="$LDFLAGS -R${withval}"
2010 fi
2011 if test ! -z "$blibpath" ; then
2012 blibpath="$blibpath:${withval}"
2013 fi
2014 fi
2015 AC_CHECK_HEADERS(sectok.h)
2016 if test "$ac_cv_header_sectok_h" != yes; then
2017 AC_MSG_ERROR(Can't find sectok.h)
2018 fi
2019 AC_CHECK_LIB(sectok, sectok_open)
2020 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2021 AC_MSG_ERROR(Can't find libsectok)
2022 fi
2023 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002024 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002025 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002026 fi
2027 ]
2028)
2029
2030# Check whether user wants OpenSC support
2031AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002032 AC_HELP_STRING([--with-opensc=PFX],
2033 [Enable smartcard support using OpenSC]),
2034 opensc_config_prefix="$withval", opensc_config_prefix="")
2035if test x$opensc_config_prefix != x ; then
2036 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2037 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2038 if test "$OPENSC_CONFIG" != "no"; then
2039 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2040 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2041 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2042 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2043 AC_DEFINE(SMARTCARD)
2044 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002045 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002046 fi
2047fi
Damien Miller85de5802001-09-18 14:01:11 +10002048
Darren Tucker5f88d342003-10-15 16:57:57 +10002049# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002050AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002051 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002052 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002053 # Needed by our getrrsetbyname()
2054 AC_SEARCH_LIBS(res_query, resolv)
2055 AC_SEARCH_LIBS(dn_expand, resolv)
2056 AC_CHECK_FUNCS(_getshort _getlong)
2057 AC_CHECK_MEMBER(HEADER.ad,
2058 [AC_DEFINE(HAVE_HEADER_AD)],,
2059 [#include <arpa/nameser.h>])
2060 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002061
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002062# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002063KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002064AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002065 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002066 [ if test "x$withval" != "xno" ; then
2067 if test "x$withval" = "xyes" ; then
2068 KRB5ROOT="/usr/local"
2069 else
2070 KRB5ROOT=${withval}
2071 fi
2072
2073 AC_DEFINE(KRB5)
2074 KRB5_MSG="yes"
2075
2076 AC_MSG_CHECKING(for krb5-config)
2077 if test -x $KRB5ROOT/bin/krb5-config ; then
2078 KRB5CONF=$KRB5ROOT/bin/krb5-config
2079 AC_MSG_RESULT($KRB5CONF)
2080
2081 AC_MSG_CHECKING(for gssapi support)
2082 if $KRB5CONF | grep gssapi >/dev/null ; then
2083 AC_MSG_RESULT(yes)
2084 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
2085 dnl m4 quadragraphs: "sed 's/-l[^- ]*//g'"
2086 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
2087 K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002088 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002089 AC_MSG_RESULT(no)
2090 K5CFLAGS="`$KRB5CONF --cflags`"
2091 K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
2092 K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002093 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002094 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2095 LDFLAGS="$LDFLAGS $K5LDFLAGS"
2096 AC_MSG_CHECKING(whether we are using Heimdal)
2097 AC_TRY_COMPILE([ #include <krb5.h> ],
2098 [ char *tmp = heimdal_version; ],
2099 [ AC_MSG_RESULT(yes)
2100 AC_DEFINE(HEIMDAL) ],
2101 AC_MSG_RESULT(no)
2102 )
2103 else
2104 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002105 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002106 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002107 AC_MSG_CHECKING(whether we are using Heimdal)
2108 AC_TRY_COMPILE([ #include <krb5.h> ],
2109 [ char *tmp = heimdal_version; ],
2110 [ AC_MSG_RESULT(yes)
2111 AC_DEFINE(HEIMDAL)
2112 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2113 ],
2114 [ AC_MSG_RESULT(no)
2115 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2116 ]
2117 )
Damien Miller200d0a72003-06-30 19:21:36 +10002118 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002119
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002120 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2121 [ AC_DEFINE(GSSAPI)
2122 K5LIBS="-lgssapi $K5LIBS" ],
2123 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2124 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002125 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002126 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2127 $K5LIBS)
2128 ],
2129 $K5LIBS)
2130
2131 AC_CHECK_HEADER(gssapi.h, ,
2132 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002133 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002134 AC_CHECK_HEADERS(gssapi.h, ,
2135 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002136 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002137 ]
2138 )
2139
2140 oldCPP="$CPPFLAGS"
2141 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2142 AC_CHECK_HEADER(gssapi_krb5.h, ,
2143 [ CPPFLAGS="$oldCPP" ])
2144
Damien Millera8e06ce2003-11-21 23:48:55 +11002145 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002146 if test ! -z "$need_dash_r" ; then
2147 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2148 fi
2149 if test ! -z "$blibpath" ; then
2150 blibpath="$blibpath:${KRB5ROOT}/lib"
2151 fi
2152 fi ]
2153 AC_SEARCH_LIBS(k_hasafs, kafs,
Darren Tucker3c78c5e2004-01-23 22:03:10 +11002154 [ AC_DEFINE(USE_AFS)
Darren Tucker1d3ca582004-01-22 12:05:34 +11002155 K5LIBS="-lkafs $K5LIBS"
2156 ]
2157 )
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002158)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002159LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002160
Damien Millera22ba012000-03-02 23:09:20 +11002161# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002162
Damien Millerf58c6722002-05-13 13:15:42 +10002163PRIVSEP_PATH=/var/empty
2164AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002165 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002166 [
2167 if test "x$withval" != "$no" ; then
2168 PRIVSEP_PATH=$withval
2169 fi
2170 ]
2171)
2172AC_SUBST(PRIVSEP_PATH)
2173
Damien Millera22ba012000-03-02 23:09:20 +11002174AC_ARG_WITH(xauth,
2175 [ --with-xauth=PATH Specify path to xauth program ],
2176 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002177 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002178 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002179 fi
2180 ],
2181 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002182 TestPath="$PATH"
2183 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2184 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2185 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2186 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2187 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002188 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002189 xauth_path="/usr/openwin/bin/xauth"
2190 fi
2191 ]
2192)
2193
Damien Miller7d901272003-01-13 16:55:22 +11002194STRIP_OPT=-s
2195AC_ARG_ENABLE(strip,
2196 [ --disable-strip Disable calling strip(1) on install],
2197 [
2198 if test "x$enableval" = "xno" ; then
2199 STRIP_OPT=
2200 fi
2201 ]
2202)
2203AC_SUBST(STRIP_OPT)
2204
Damien Millera19cf472000-11-29 13:28:50 +11002205if test -z "$xauth_path" ; then
2206 XAUTH_PATH="undefined"
2207 AC_SUBST(XAUTH_PATH)
2208else
Damien Millera22ba012000-03-02 23:09:20 +11002209 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002210 XAUTH_PATH=$xauth_path
2211 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002212fi
Damien Millera22ba012000-03-02 23:09:20 +11002213
2214# Check for mail directory (last resort if we cannot get it from headers)
2215if test ! -z "$MAIL" ; then
2216 maildir=`dirname $MAIL`
2217 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2218fi
2219
Damien Millera22ba012000-03-02 23:09:20 +11002220if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002221 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002222 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002223 [
2224 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2225 have_dev_ptmx=1
2226 ]
2227 )
2228 fi
Damien Millera22ba012000-03-02 23:09:20 +11002229fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002230AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002231 [
2232 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2233 have_dev_ptc=1
2234 ]
2235)
2236
Damien Millera22ba012000-03-02 23:09:20 +11002237# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002238AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002239 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002240 [
Damien Miller897741e2001-04-16 10:41:46 +10002241 case "$withval" in
2242 man|cat|doc)
2243 MANTYPE=$withval
2244 ;;
2245 *)
2246 AC_MSG_ERROR(invalid man type: $withval)
2247 ;;
2248 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002249 ]
2250)
Ben Lindstrombc709922001-04-18 18:04:21 +00002251if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002252 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2253 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002254 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2255 MANTYPE=doc
2256 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2257 MANTYPE=man
2258 else
2259 MANTYPE=cat
2260 fi
2261fi
Damien Miller670a4b82000-01-22 13:53:11 +11002262AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002263if test "$MANTYPE" = "doc"; then
2264 mansubdir=man;
2265else
2266 mansubdir=$MANTYPE;
2267fi
2268AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002269
Damien Millera22ba012000-03-02 23:09:20 +11002270# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002271MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002272AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002273 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002274 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002275 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002276 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002277 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002278 fi
2279 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002280)
2281
Damien Millera22ba012000-03-02 23:09:20 +11002282# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002283AC_ARG_WITH(shadow,
2284 [ --without-shadow Disable shadow password support],
2285 [
2286 if test "x$withval" = "xno" ; then
2287 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002288 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002289 fi
2290 ]
2291)
2292
Damien Miller1f335fb2000-06-26 11:31:33 +10002293if test -z "$disable_shadow" ; then
2294 AC_MSG_CHECKING([if the systems has expire shadow information])
2295 AC_TRY_COMPILE(
2296 [
2297#include <sys/types.h>
2298#include <shadow.h>
2299 struct spwd sp;
2300 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2301 [ sp_expire_available=yes ], []
2302 )
2303
2304 if test "x$sp_expire_available" = "xyes" ; then
2305 AC_MSG_RESULT(yes)
2306 AC_DEFINE(HAS_SHADOW_EXPIRE)
2307 else
2308 AC_MSG_RESULT(no)
2309 fi
2310fi
2311
Damien Millera22ba012000-03-02 23:09:20 +11002312# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002313if test ! -z "$IPADDR_IN_DISPLAY" ; then
2314 DISPLAY_HACK_MSG="yes"
2315 AC_DEFINE(IPADDR_IN_DISPLAY)
2316else
Damien Millera8e06ce2003-11-21 23:48:55 +11002317 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002318 AC_ARG_WITH(ipaddr-display,
2319 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2320 [
2321 if test "x$withval" != "xno" ; then
2322 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002323 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002324 fi
2325 ]
2326 )
2327fi
Damien Miller76112de1999-12-21 11:18:08 +11002328
Darren Tuckere1a790d2003-09-16 11:52:19 +10002329# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002330AC_ARG_ENABLE(etc-default-login,
2331 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2332[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002333AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2334
2335if test "x$external_path_file" = "x/etc/default/login"; then
2336 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2337fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002338])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002339
Tim Rice43a1c132002-04-17 21:19:14 -07002340dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2341if test $ac_cv_func_login_getcapbool = "yes" -a \
2342 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002343 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002344fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002345
Damien Millera22ba012000-03-02 23:09:20 +11002346# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002347SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002348AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002349 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002350 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002351 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002352 AC_MSG_WARN([
2353--with-default-path=PATH has no effect on this system.
2354Edit /etc/login.conf instead.])
2355 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002356 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002357 AC_MSG_WARN([
2358--with-default-path=PATH will only be used if PATH is not defined in
2359$external_path_file .])
2360 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002361 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002362 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002363 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002364 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002365 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2366 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002367 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002368 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002369 AC_MSG_WARN([
2370If PATH is defined in $external_path_file, ensure the path to scp is included,
2371otherwise scp will not work.])
2372 fi
2373 AC_TRY_RUN(
2374 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002375/* find out what STDPATH is */
2376#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002377#ifdef HAVE_PATHS_H
2378# include <paths.h>
2379#endif
2380#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002381# ifdef _PATH_USERPATH /* Irix */
2382# define _PATH_STDPATH _PATH_USERPATH
2383# else
2384# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2385# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002386#endif
2387#include <sys/types.h>
2388#include <sys/stat.h>
2389#include <fcntl.h>
2390#define DATA "conftest.stdpath"
2391
2392main()
2393{
2394 FILE *fd;
2395 int rc;
2396
2397 fd = fopen(DATA,"w");
2398 if(fd == NULL)
2399 exit(1);
2400
2401 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2402 exit(1);
2403
2404 exit(0);
2405}
2406 ], [ user_path=`cat conftest.stdpath` ],
2407 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2408 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2409 )
2410# make sure $bindir is in USER_PATH so scp will work
2411 t_bindir=`eval echo ${bindir}`
2412 case $t_bindir in
2413 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2414 esac
2415 case $t_bindir in
2416 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2417 esac
2418 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2419 if test $? -ne 0 ; then
2420 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2421 if test $? -ne 0 ; then
2422 user_path=$user_path:$t_bindir
2423 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2424 fi
2425 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002426 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002427)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002428if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002429 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2430 AC_SUBST(user_path)
2431fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002432
Damien Millera18bbd32002-05-13 10:48:57 +10002433# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002434AC_ARG_WITH(superuser-path,
2435 [ --with-superuser-path= Specify different path for super-user],
2436 [
2437 if test "x$withval" != "xno" ; then
2438 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2439 superuser_path=$withval
2440 fi
2441 ]
2442)
2443
2444
Damien Miller61e50f12000-05-08 20:49:37 +10002445AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002446IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002447AC_ARG_WITH(4in6,
2448 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2449 [
2450 if test "x$withval" != "xno" ; then
2451 AC_MSG_RESULT(yes)
2452 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002453 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002454 else
2455 AC_MSG_RESULT(no)
2456 fi
2457 ],[
2458 if test "x$inet6_default_4in6" = "xyes"; then
2459 AC_MSG_RESULT([yes (default)])
2460 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002461 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002462 else
2463 AC_MSG_RESULT([no (default)])
2464 fi
2465 ]
2466)
2467
Damien Miller60396b02001-02-18 17:01:00 +11002468# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002469BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002470AC_ARG_WITH(bsd-auth,
2471 [ --with-bsd-auth Enable BSD auth support],
2472 [
2473 if test "x$withval" != "xno" ; then
2474 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002475 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002476 fi
2477 ]
2478)
2479
Damien Millera22ba012000-03-02 23:09:20 +11002480# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002481piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002482# make sure the directory exists
2483if test ! -d $piddir ; then
2484 piddir=`eval echo ${sysconfdir}`
2485 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002486 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002487 esac
2488fi
2489
Tim Rice88f2ab52002-03-17 12:17:34 -08002490AC_ARG_WITH(pid-dir,
2491 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2492 [
2493 if test "x$withval" != "xno" ; then
2494 piddir=$withval
2495 if test ! -d $piddir ; then
2496 AC_MSG_WARN([** no $piddir directory on this system **])
2497 fi
2498 fi
2499 ]
2500)
2501
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002502AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002503AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002504
andre2ff7b5d2000-06-03 14:57:40 +00002505dnl allow user to disable some login recording features
2506AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002507 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002508 [
2509 if test "x$enableval" = "xno" ; then
2510 AC_DEFINE(DISABLE_LASTLOG)
2511 fi
2512 ]
andre2ff7b5d2000-06-03 14:57:40 +00002513)
2514AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002515 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002516 [
2517 if test "x$enableval" = "xno" ; then
2518 AC_DEFINE(DISABLE_UTMP)
2519 fi
2520 ]
andre2ff7b5d2000-06-03 14:57:40 +00002521)
2522AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002523 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002524 [
2525 if test "x$enableval" = "xno" ; then
2526 AC_DEFINE(DISABLE_UTMPX)
2527 fi
2528 ]
andre2ff7b5d2000-06-03 14:57:40 +00002529)
2530AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002531 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002532 [
2533 if test "x$enableval" = "xno" ; then
2534 AC_DEFINE(DISABLE_WTMP)
2535 fi
2536 ]
andre2ff7b5d2000-06-03 14:57:40 +00002537)
2538AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002539 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002540 [
2541 if test "x$enableval" = "xno" ; then
2542 AC_DEFINE(DISABLE_WTMPX)
2543 fi
2544 ]
andre2ff7b5d2000-06-03 14:57:40 +00002545)
2546AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002547 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002548 [
2549 if test "x$enableval" = "xno" ; then
2550 AC_DEFINE(DISABLE_LOGIN)
2551 fi
2552 ]
andre2ff7b5d2000-06-03 14:57:40 +00002553)
2554AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002555 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002556 [
2557 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002558 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002559 fi
2560 ]
andre2ff7b5d2000-06-03 14:57:40 +00002561)
2562AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002563 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002564 [
2565 if test "x$enableval" = "xno" ; then
2566 AC_DEFINE(DISABLE_PUTUTXLINE)
2567 fi
2568 ]
andre2ff7b5d2000-06-03 14:57:40 +00002569)
2570AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002571 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002572 [
2573 if test "x$withval" = "xno" ; then
2574 AC_DEFINE(DISABLE_LASTLOG)
2575 else
2576 conf_lastlog_location=$withval
2577 fi
2578 ]
2579)
andre2ff7b5d2000-06-03 14:57:40 +00002580
2581dnl lastlog, [uw]tmpx? detection
2582dnl NOTE: set the paths in the platform section to avoid the
2583dnl need for command-line parameters
2584dnl lastlog and [uw]tmp are subject to a file search if all else fails
2585
2586dnl lastlog detection
2587dnl NOTE: the code itself will detect if lastlog is a directory
2588AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2589AC_TRY_COMPILE([
2590#include <sys/types.h>
2591#include <utmp.h>
2592#ifdef HAVE_LASTLOG_H
2593# include <lastlog.h>
2594#endif
Damien Miller2994e082000-06-04 15:51:47 +10002595#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002596# include <paths.h>
2597#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002598#ifdef HAVE_LOGIN_H
2599# include <login.h>
2600#endif
andre2ff7b5d2000-06-03 14:57:40 +00002601 ],
2602 [ char *lastlog = LASTLOG_FILE; ],
2603 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002604 [
2605 AC_MSG_RESULT(no)
2606 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2607 AC_TRY_COMPILE([
2608#include <sys/types.h>
2609#include <utmp.h>
2610#ifdef HAVE_LASTLOG_H
2611# include <lastlog.h>
2612#endif
2613#ifdef HAVE_PATHS_H
2614# include <paths.h>
2615#endif
2616 ],
2617 [ char *lastlog = _PATH_LASTLOG; ],
2618 [ AC_MSG_RESULT(yes) ],
2619 [
andree441aa32000-06-12 22:34:38 +00002620 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002621 system_lastlog_path=no
2622 ])
2623 ]
andre2ff7b5d2000-06-03 14:57:40 +00002624)
Damien Miller2994e082000-06-04 15:51:47 +10002625
andre2ff7b5d2000-06-03 14:57:40 +00002626if test -z "$conf_lastlog_location"; then
2627 if test x"$system_lastlog_path" = x"no" ; then
2628 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002629 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002630 conf_lastlog_location=$f
2631 fi
2632 done
2633 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002634 AC_MSG_WARN([** Cannot find lastlog **])
2635 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002636 fi
2637 fi
2638fi
2639
2640if test -n "$conf_lastlog_location"; then
2641 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2642fi
2643
2644dnl utmp detection
2645AC_MSG_CHECKING([if your system defines UTMP_FILE])
2646AC_TRY_COMPILE([
2647#include <sys/types.h>
2648#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002649#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002650# include <paths.h>
2651#endif
2652 ],
2653 [ char *utmp = UTMP_FILE; ],
2654 [ AC_MSG_RESULT(yes) ],
2655 [ AC_MSG_RESULT(no)
2656 system_utmp_path=no ]
2657)
2658if test -z "$conf_utmp_location"; then
2659 if test x"$system_utmp_path" = x"no" ; then
2660 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2661 if test -f $f ; then
2662 conf_utmp_location=$f
2663 fi
2664 done
2665 if test -z "$conf_utmp_location"; then
2666 AC_DEFINE(DISABLE_UTMP)
2667 fi
2668 fi
2669fi
2670if test -n "$conf_utmp_location"; then
2671 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2672fi
2673
2674dnl wtmp detection
2675AC_MSG_CHECKING([if your system defines WTMP_FILE])
2676AC_TRY_COMPILE([
2677#include <sys/types.h>
2678#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002679#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002680# include <paths.h>
2681#endif
2682 ],
2683 [ char *wtmp = WTMP_FILE; ],
2684 [ AC_MSG_RESULT(yes) ],
2685 [ AC_MSG_RESULT(no)
2686 system_wtmp_path=no ]
2687)
2688if test -z "$conf_wtmp_location"; then
2689 if test x"$system_wtmp_path" = x"no" ; then
2690 for f in /usr/adm/wtmp /var/log/wtmp; do
2691 if test -f $f ; then
2692 conf_wtmp_location=$f
2693 fi
2694 done
2695 if test -z "$conf_wtmp_location"; then
2696 AC_DEFINE(DISABLE_WTMP)
2697 fi
2698 fi
2699fi
2700if test -n "$conf_wtmp_location"; then
2701 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2702fi
2703
2704
2705dnl utmpx detection - I don't know any system so perverse as to require
2706dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2707dnl there, though.
2708AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2709AC_TRY_COMPILE([
2710#include <sys/types.h>
2711#include <utmp.h>
2712#ifdef HAVE_UTMPX_H
2713#include <utmpx.h>
2714#endif
Damien Miller2994e082000-06-04 15:51:47 +10002715#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002716# include <paths.h>
2717#endif
2718 ],
2719 [ char *utmpx = UTMPX_FILE; ],
2720 [ AC_MSG_RESULT(yes) ],
2721 [ AC_MSG_RESULT(no)
2722 system_utmpx_path=no ]
2723)
2724if test -z "$conf_utmpx_location"; then
2725 if test x"$system_utmpx_path" = x"no" ; then
2726 AC_DEFINE(DISABLE_UTMPX)
2727 fi
2728else
2729 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2730fi
2731
2732dnl wtmpx detection
2733AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2734AC_TRY_COMPILE([
2735#include <sys/types.h>
2736#include <utmp.h>
2737#ifdef HAVE_UTMPX_H
2738#include <utmpx.h>
2739#endif
Damien Miller2994e082000-06-04 15:51:47 +10002740#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002741# include <paths.h>
2742#endif
2743 ],
2744 [ char *wtmpx = WTMPX_FILE; ],
2745 [ AC_MSG_RESULT(yes) ],
2746 [ AC_MSG_RESULT(no)
2747 system_wtmpx_path=no ]
2748)
2749if test -z "$conf_wtmpx_location"; then
2750 if test x"$system_wtmpx_path" = x"no" ; then
2751 AC_DEFINE(DISABLE_WTMPX)
2752 fi
2753else
2754 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2755fi
2756
Damien Miller4018c192000-04-30 09:30:44 +10002757
Damien Miller29ea30d2000-03-17 10:54:15 +11002758if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002759 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2760 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002761fi
2762
Tim Rice4cec93f2002-02-26 08:40:48 -08002763dnl remove pam and dl because they are in $LIBPAM
2764if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002765 LIBS=`echo $LIBS | sed 's/-lpam //'`
2766fi
2767if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2768 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002769fi
2770
Damien Millerbac2d8a2000-09-05 16:13:06 +11002771AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002772AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2773AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002774
Damien Miller7b22d652000-06-18 14:07:04 +10002775# Print summary of options
2776
Damien Miller7b22d652000-06-18 14:07:04 +10002777# Someone please show me a better way :)
2778A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2779B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2780C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2781D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002782E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002783F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002784G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002785H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2786I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2787J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002788
2789echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002790echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002791echo " User binaries: $B"
2792echo " System binaries: $C"
2793echo " Configuration files: $D"
2794echo " Askpass program: $E"
2795echo " Manual pages: $F"
2796echo " PID file: $G"
2797echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002798if test "x$external_path_file" = "x/etc/login.conf" ; then
2799echo " At runtime, sshd will use the path defined in $external_path_file"
2800echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002801else
Damien Millerf58c6722002-05-13 13:15:42 +10002802echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002803 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002804echo " (If PATH is set in $external_path_file it will be used instead. If"
2805echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2806 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002807fi
Damien Millera18bbd32002-05-13 10:48:57 +10002808if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002809echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002810fi
Damien Millerf58c6722002-05-13 13:15:42 +10002811echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002812echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002813echo " KerberosV support: $KRB5_MSG"
2814echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002815echo " S/KEY support: $SKEY_MSG"
2816echo " TCP Wrappers support: $TCPW_MSG"
2817echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002818echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002819echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2820echo " BSD Auth support: $BSD_AUTH_MSG"
2821echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002822if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002823echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002824fi
2825
Damien Miller7b22d652000-06-18 14:07:04 +10002826echo ""
2827
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002828echo " Host: ${host}"
2829echo " Compiler: ${CC}"
2830echo " Compiler flags: ${CFLAGS}"
2831echo "Preprocessor flags: ${CPPFLAGS}"
2832echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002833echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002834
2835echo ""
2836
Damien Miller82cf0ce2000-12-20 13:34:48 +11002837if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002838 echo "PAM is enabled. You may need to install a PAM control file "
2839 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002840 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002841 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002842 echo ""
2843fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002844
Damien Miller6c21c512002-01-22 21:57:53 +11002845if test ! -z "$RAND_HELPER_CMDHASH" ; then
2846 echo "WARNING: you are using the builtin random number collection "
2847 echo "service. Please read WARNING.RNG and request that your OS "
2848 echo "vendor includes kernel-based random number collection in "
2849 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002850 echo ""
2851fi
Damien Miller60396b02001-02-18 17:01:00 +11002852