blob: 5b094ba6ce4c5a3e34cf747d42c6d6e83851b5ce [file] [log] [blame]
Darren Tucker1d3ca582004-01-22 12:05:34 +11001# $Id: configure.ac,v 1.185 2004/01/22 01:05:35 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*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000070 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110071 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +110072 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +100073 if (test -z "$blibpath"); then
74 blibpath="/usr/lib:/lib:/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110075 fi
Damien Millereab4bae2003-04-29 23:22:40 +100076 saved_LDFLAGS="$LDFLAGS"
77 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
78 if (test -z "$blibflags"); then
79 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
80 AC_TRY_LINK([], [], [blibflags=$tryflags])
81 fi
82 done
83 if (test -z "$blibflags"); then
84 AC_MSG_RESULT(not found)
85 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
86 else
87 AC_MSG_RESULT($blibflags)
88 fi
89 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100090 dnl Check for authenticate. Might be in libs.a on older AIXes
91 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070092 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100093 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070094 LIBS="$LIBS -ls"
95 ])
96 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +100097 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
98 AC_CHECK_DECL(loginfailed,
99 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
100 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000101 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000102 [(void)loginfailed("user","host","tty",0);],
103 [AC_MSG_RESULT(yes)
104 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000105 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000106 )],
107 [],
108 [#include <usersec.h>]
109 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000110 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +1100111 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000112 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000113 AC_DEFINE(SETEUID_BREAKS_SETUID)
114 AC_DEFINE(BROKEN_SETREUID)
115 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000116 dnl AIX handles lastlog as part of its login message
117 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000118 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000119 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100120 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100121*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100122 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800123 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100124 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000125 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100126 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100127 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000128 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000129 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700130 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000131 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100132 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000133*-*-dgux*)
134 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100135 AC_DEFINE(SETEUID_BREAKS_SETUID)
136 AC_DEFINE(BROKEN_SETREUID)
137 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000138 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000139*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000140 AC_MSG_CHECKING(if we have working getaddrinfo)
141 AC_TRY_RUN([#include <mach-o/dyld.h>
142main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
143 exit(0);
144 else
145 exit(1);
146}], [AC_MSG_RESULT(working)],
147 [AC_MSG_RESULT(buggy)
148 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700149 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000150 AC_DEFINE(SETEUID_BREAKS_SETUID)
151 AC_DEFINE(BROKEN_SETREUID)
152 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100153 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000154 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000155*-*-hpux10.26)
156 if test -z "$GCC"; then
157 CFLAGS="$CFLAGS -Ae"
158 fi
159 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
160 IPADDR_IN_DISPLAY=yes
161 AC_DEFINE(HAVE_SECUREWARE)
162 AC_DEFINE(USE_PIPES)
163 AC_DEFINE(LOGIN_NO_ENDOPT)
164 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000165 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000166 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000167 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700168 LIBS="$LIBS -lsec -lsecpw"
169 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000170 disable_ptmx_check=yes
171 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100172*-*-hpux10*)
173 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000174 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100175 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000176 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100177 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000178 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000179 AC_DEFINE(LOGIN_NO_ENDOPT)
180 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100181 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000182 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000183 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700184 LIBS="$LIBS -lsec"
185 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100186 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000187*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000188 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100189 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100190 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100191 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000192 AC_DEFINE(LOGIN_NO_ENDOPT)
193 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100194 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000195 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000196 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700197 LIBS="$LIBS -lsec"
198 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000199 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100200*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000201 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000202 LDFLAGS="$LDFLAGS"
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*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000213 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100214 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000215 AC_DEFINE(WITH_IRIX_ARRAY)
216 AC_DEFINE(WITH_IRIX_PROJECT)
217 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000218 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000219 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000220 AC_DEFINE(SETEUID_BREAKS_SETUID)
221 AC_DEFINE(BROKEN_SETREUID)
222 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000223 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000224 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100225 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100226*-*-linux*)
227 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100228 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000229 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100230 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000231 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000232 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000233 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100234 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000235 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000236 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000237 AC_DEFINE(BROKEN_CMSG_TYPE)
238 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000239 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100240 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000241mips-sony-bsd|mips-sony-newsos4)
242 AC_DEFINE(HAVE_NEWS4)
243 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000244 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100245*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000246 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800247 if test "x$withval" != "xno" ; then
248 need_dash_r=1
249 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100250 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100251*-*-freebsd*)
252 check_for_libcrypt_later=1
253 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000254*-*-bsdi*)
255 AC_DEFINE(SETEUID_BREAKS_SETUID)
256 AC_DEFINE(BROKEN_SETREUID)
257 AC_DEFINE(BROKEN_SETREGID)
258 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000259*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000260 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100261 conf_utmp_location=/etc/utmp
262 conf_wtmp_location=/usr/adm/wtmp
263 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000264 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000265 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000266 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100267 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000268 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000269 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000270 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100271*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000272 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Rice88368a32003-12-08 12:35:59 -0800273 if test "x$withval" = "xno" ; then
274 LDFLAGS="$LDFLAGS -L/usr/local/lib"
275 else
276 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
277 need_dash_r=1
278 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100279 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000280 AC_DEFINE(LOGIN_NEEDS_UTMPX)
281 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000282 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000283 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000284 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
285 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000286 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000287 # hardwire lastlog location (can't detect it on some versions)
288 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000289 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
290 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
291 if test "$sol2ver" -ge 8; then
292 AC_MSG_RESULT(yes)
293 AC_DEFINE(DISABLE_UTMP)
294 AC_DEFINE(DISABLE_WTMP)
295 else
296 AC_MSG_RESULT(no)
297 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100298 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000299*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000300 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000301 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100302 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000303 conf_utmp_location=/etc/utmp
304 conf_wtmp_location=/var/adm/wtmp
305 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000306 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000307 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000308*-ncr-sysv*)
309 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
310 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700311 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000312 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000313 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000314 AC_DEFINE(SETEUID_BREAKS_SETUID)
315 AC_DEFINE(BROKEN_SETREUID)
316 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000317 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000318*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000319 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700320 # /usr/ucblib MUST NOT be searched on ReliantUNIX
321 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Darren Tucker89df7a32003-10-07 20:35:57 +1000322 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100323 IPADDR_IN_DISPLAY=yes
324 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000325 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000326 AC_DEFINE(SETEUID_BREAKS_SETUID)
327 AC_DEFINE(BROKEN_SETREUID)
328 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000329 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000330 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700331 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
332 # Attention: always take care to bind libsocket and libnsl before libc,
333 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000334 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100335*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000336 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100337 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100338 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700339 AC_DEFINE(SETEUID_BREAKS_SETUID)
340 AC_DEFINE(BROKEN_SETREUID)
341 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100342 ;;
343*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000344 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100345 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100346 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700347 AC_DEFINE(SETEUID_BREAKS_SETUID)
348 AC_DEFINE(BROKEN_SETREUID)
349 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100350 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100351*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000352 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100353 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100354 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100355*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000356 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100357 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700358 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100359 RANLIB=true
360 no_dev_ptmx=1
361 AC_DEFINE(BROKEN_SYS_TERMIO_H)
362 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000363 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000364 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100365 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700366 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100367 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700368 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700369 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100370 ;;
371*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800372 if test -z "$GCC"; then
373 CFLAGS="$CFLAGS -belf"
374 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000375 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000376 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100377 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000378 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100379 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000380 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000381 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700382 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700383 AC_DEFINE(SETEUID_BREAKS_SETUID)
384 AC_DEFINE(BROKEN_SETREUID)
385 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700386 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100387 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700388 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000389 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000390*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000391 AC_DEFINE(USE_PIPES)
392 AC_DEFINE(DISABLE_FD_PASSING)
393 LDFLAGS="$LDFLAGS"
394 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
395 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000396 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000397*-*-unicosmp*)
398 AC_DEFINE(WITH_ABBREV_NO_TTY)
399 AC_DEFINE(USE_PIPES)
400 AC_DEFINE(DISABLE_FD_PASSING)
401 LDFLAGS="$LDFLAGS"
402 LIBS="$LIBS -lgen -lacid"
403 MANTYPE=cat
404 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000405*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000406 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700407 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700408 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000409 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
410 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
411 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700412 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000413*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000414 AC_MSG_CHECKING(for Digital Unix SIA)
415 no_osfsia=""
416 AC_ARG_WITH(osfsia,
417 [ --with-osfsia Enable Digital Unix SIA],
418 [
419 if test "x$withval" = "xno" ; then
420 AC_MSG_RESULT(disabled)
421 no_osfsia=1
422 fi
423 ],
424 )
425 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000426 if test -f /etc/sia/matrix.conf; then
427 AC_MSG_RESULT(yes)
428 AC_DEFINE(HAVE_OSF_SIA)
429 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000430 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000431 LIBS="$LIBS -lsecurity -ldb -lm -laud"
432 else
433 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100434 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000435 fi
436 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000437 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700438 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000439 AC_DEFINE(BROKEN_SETREUID)
440 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000441 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000442
443*-*-nto-qnx)
444 AC_DEFINE(USE_PIPES)
445 AC_DEFINE(NO_X11_UNIX_SOCKETS)
446 AC_DEFINE(MISSING_NFDBITS)
447 AC_DEFINE(MISSING_HOWMANY)
448 AC_DEFINE(MISSING_FD_MASK)
449 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100450esac
451
Damien Millere37bfc12000-06-05 09:37:43 +1000452# Allow user to specify flags
453AC_ARG_WITH(cflags,
454 [ --with-cflags Specify additional flags to pass to compiler],
455 [
456 if test "x$withval" != "xno" ; then
457 CFLAGS="$CFLAGS $withval"
458 fi
459 ]
460)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000461AC_ARG_WITH(cppflags,
462 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
463 [
464 if test "x$withval" != "xno"; then
465 CPPFLAGS="$CPPFLAGS $withval"
466 fi
467 ]
468)
Damien Millere37bfc12000-06-05 09:37:43 +1000469AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000470 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000471 [
472 if test "x$withval" != "xno" ; then
473 LDFLAGS="$LDFLAGS $withval"
474 fi
475 ]
476)
477AC_ARG_WITH(libs,
478 [ --with-libs Specify additional libraries to link with],
479 [
480 if test "x$withval" != "xno" ; then
481 LIBS="$LIBS $withval"
482 fi
483 ]
484)
485
Darren Tucker6eb93042003-06-29 21:30:41 +1000486AC_MSG_CHECKING(compiler and flags for sanity)
487AC_TRY_RUN([
488#include <stdio.h>
489int main(){exit(0);}
490 ],
491 [ AC_MSG_RESULT(yes) ],
492 [
493 AC_MSG_RESULT(no)
494 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
495 ]
496)
497
Tim Rice4cec93f2002-02-26 08:40:48 -0800498# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000499AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000500 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800501 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100502 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000503 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000504 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
505 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000506 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700507 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Damien Miller5c3a5582003-09-23 22:12:38 +1000508 util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800509
Damien Millera22ba012000-03-02 23:09:20 +1100510# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700511AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
512AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000513
Damien Millerdf288022001-02-18 13:07:07 +1100514dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700515if test "x$with_tcp_wrappers" != "xno" ; then
516 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
517 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
518 fi
519fi
Damien Millerdf288022001-02-18 13:07:07 +1100520
Tim Rice1e1ef642003-09-11 22:19:31 -0700521dnl IRIX and Solaris 2.5.1 have dirname() in libgen
522AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
523 AC_CHECK_LIB(gen, dirname,[
524 AC_CACHE_CHECK([for broken dirname],
525 ac_cv_have_broken_dirname, [
526 save_LIBS="$LIBS"
527 LIBS="$LIBS -lgen"
528 AC_TRY_RUN(
529 [
530#include <libgen.h>
531#include <string.h>
532
533int main(int argc, char **argv) {
534 char *s, buf[32];
535
536 strncpy(buf,"/etc", 32);
537 s = dirname(buf);
538 if (!s || strncmp(s, "/", 32) != 0) {
539 exit(1);
540 } else {
541 exit(0);
542 }
543}
544 ],
545 [ ac_cv_have_broken_dirname="no" ],
546 [ ac_cv_have_broken_dirname="yes" ]
547 )
548 LIBS="$save_LIBS"
549 ])
550 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
551 LIBS="$LIBS -lgen"
552 AC_DEFINE(HAVE_DIRNAME)
553 AC_CHECK_HEADERS(libgen.h)
554 fi
555 ])
556])
557
558AC_CHECK_FUNC(getspnam, ,
559 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
560AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
561
Tim Rice13aae5e2001-10-21 17:53:58 -0700562dnl zlib is required
563AC_ARG_WITH(zlib,
564 [ --with-zlib=PATH Use zlib in PATH],
565 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000566 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100567 AC_MSG_ERROR([*** zlib is required ***])
568 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700569 if test -d "$withval/lib"; then
570 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700571 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700572 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700573 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700574 fi
575 else
576 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700577 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700578 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700579 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700580 fi
581 fi
582 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700583 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700584 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700585 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700586 fi
587 ]
588)
589
Tim Rice17b93e52001-10-23 22:36:54 -0700590AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100591
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000592dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100593AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000594 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
595)
Damien Millera8e06ce2003-11-21 23:48:55 +1100596AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700597 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
598 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000599)
Damien Millerab18c411999-11-11 10:40:23 +1100600
Tim Ricee589a292001-11-03 11:09:32 -0800601dnl Checks for libutil functions
602AC_CHECK_HEADERS(libutil.h)
603AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
604AC_CHECK_FUNCS(logout updwtmp logwtmp)
605
Ben Lindstrom8697e082001-02-24 21:41:10 +0000606AC_FUNC_STRFTIME
607
Damien Miller3c027682001-03-14 11:39:45 +1100608# Check for ALTDIRFUNC glob() extension
609AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
610AC_EGREP_CPP(FOUNDIT,
611 [
612 #include <glob.h>
613 #ifdef GLOB_ALTDIRFUNC
614 FOUNDIT
615 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100616 ],
Damien Miller3c027682001-03-14 11:39:45 +1100617 [
618 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
619 AC_MSG_RESULT(yes)
620 ],
621 [
622 AC_MSG_RESULT(no)
623 ]
624)
Damien Millerab18c411999-11-11 10:40:23 +1100625
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000626# Check for g.gl_matchc glob() extension
627AC_MSG_CHECKING(for gl_matchc field in glob_t)
628AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100629 [
630 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000631 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100632 ],
633 [
634 AC_DEFINE(GLOB_HAS_GL_MATCHC)
635 AC_MSG_RESULT(yes)
636 ],
637 [
638 AC_MSG_RESULT(no)
639 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000640)
641
Damien Miller18bb4732001-03-28 14:35:30 +1000642AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
643AC_TRY_RUN(
644 [
645#include <sys/types.h>
646#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700647int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000648 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100649 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000650 [
651 AC_MSG_RESULT(no)
652 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
653 ]
654)
655
Damien Millerc547bf12001-02-16 10:18:12 +1100656# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100657SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100658AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700659 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100660 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100661 [
662 if test "x$withval" != "xno" ; then
663
664 if test "x$withval" != "xyes" ; then
665 CPPFLAGS="$CPPFLAGS -I${withval}/include"
666 LDFLAGS="$LDFLAGS -L${withval}/lib"
667 fi
668
669 AC_DEFINE(SKEY)
670 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100671 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100672
Tim Rice4cec93f2002-02-26 08:40:48 -0800673 AC_MSG_CHECKING([for s/key support])
674 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100675 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800676#include <stdio.h>
677#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700678int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800679 ],
680 [AC_MSG_RESULT(yes)],
681 [
682 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100683 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
684 ])
685 fi
686 ]
687)
688
689# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700690TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100691AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700692 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100693 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100694 [
695 if test "x$withval" != "xno" ; then
696 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700697 saved_LDFLAGS="$LDFLAGS"
698 saved_CPPFLAGS="$CPPFLAGS"
699 if test -n "${withval}" -a "${withval}" != "yes"; then
700 if test -d "${withval}/lib"; then
701 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700702 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700703 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700704 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700705 fi
706 else
707 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700708 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700709 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700710 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700711 fi
712 fi
713 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700714 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700715 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700716 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700717 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700718 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800719 LIBWRAP="-lwrap"
720 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100721 AC_MSG_CHECKING(for libwrap)
722 AC_TRY_LINK(
723 [
724#include <tcpd.h>
725 int deny_severity = 0, allow_severity = 0;
726 ],
727 [hosts_access(0);],
728 [
729 AC_MSG_RESULT(yes)
730 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800731 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700732 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100733 ],
734 [
735 AC_MSG_ERROR([*** libwrap missing])
736 ]
737 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800738 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100739 fi
740 ]
741)
742
Damien Millerfe1f1432003-02-24 15:45:42 +1100743dnl Checks for library functions. Please keep in alphabetical order
744AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000745 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000746 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000747 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000748 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100749 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000750 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
751 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
752 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100753 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000754 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000755 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000756 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100757)
Tim Rice13aae5e2001-10-21 17:53:58 -0700758
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000759# IRIX has a const char return value for gai_strerror()
760AC_CHECK_FUNCS(gai_strerror,[
761 AC_DEFINE(HAVE_GAI_STRERROR)
762 AC_TRY_COMPILE([
763#include <sys/types.h>
764#include <sys/socket.h>
765#include <netdb.h>
766
767const char *gai_strerror(int);],[
768char *str;
769
770str = gai_strerror(0);],[
771 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
772 [Define if gai_strerror() returns const char *])])])
773
Damien Millercd6853c2003-01-28 11:33:42 +1100774AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
775
Darren Tuckerf1159b52003-07-07 19:44:01 +1000776dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000777AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000778AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000779
Darren Tuckerb2427c82003-09-10 15:22:44 +1000780dnl tcsendbreak might be a macro
781AC_CHECK_DECL(tcsendbreak,
782 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100783 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000784 [#include <termios.h>]
785)
786
Darren Tucker2a6b0292003-12-31 14:59:17 +1100787AC_CHECK_FUNCS(setresuid, [
788 dnl Some platorms have setresuid that isn't implemented, test for this
789 AC_MSG_CHECKING(if setresuid seems to work)
790 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100791#include <stdlib.h>
792#include <errno.h>
793int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100794 ],
795 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100796 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100797 AC_MSG_RESULT(not implemented)]
798 )
799])
Darren Tuckere937be32003-12-17 18:53:26 +1100800
Darren Tucker2a6b0292003-12-31 14:59:17 +1100801AC_CHECK_FUNCS(setresgid, [
802 dnl Some platorms have setresgid that isn't implemented, test for this
803 AC_MSG_CHECKING(if setresgid seems to work)
804 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100805#include <stdlib.h>
806#include <errno.h>
807int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100808 ],
809 [AC_MSG_RESULT(yes)],
810 [AC_DEFINE(BROKEN_SETRESGID)
811 AC_MSG_RESULT(not implemented)]
812 )
813])
Darren Tuckere937be32003-12-17 18:53:26 +1100814
Damien Millerad833b32000-08-23 10:46:23 +1000815dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000816AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000817dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000818AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000819AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000820dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000821AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000822AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100823
Damien Millera8e06ce2003-11-21 23:48:55 +1100824AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100825 [AC_DEFINE(HAVE_DAEMON)],
826 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
827)
828
Damien Millera8e06ce2003-11-21 23:48:55 +1100829AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100830 [AC_DEFINE(HAVE_GETPAGESIZE)],
831 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
832)
833
Damien Millercb170cb2000-07-01 16:52:55 +1000834# Check for broken snprintf
835if test "x$ac_cv_func_snprintf" = "xyes" ; then
836 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
837 AC_TRY_RUN(
838 [
839#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700840int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000841 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100842 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000843 [
844 AC_MSG_RESULT(no)
845 AC_DEFINE(BROKEN_SNPRINTF)
846 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
847 ]
848 )
849fi
850
Damien Millere8328192003-01-07 15:18:32 +1100851dnl see whether mkstemp() requires XXXXXX
852if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
853AC_MSG_CHECKING([for (overly) strict mkstemp])
854AC_TRY_RUN(
855 [
856#include <stdlib.h>
857main() { char template[]="conftest.mkstemp-test";
858if (mkstemp(template) == -1)
859 exit(1);
860unlink(template); exit(0);
861}
862 ],
863 [
864 AC_MSG_RESULT(no)
865 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100866 [
Damien Millere8328192003-01-07 15:18:32 +1100867 AC_MSG_RESULT(yes)
868 AC_DEFINE(HAVE_STRICT_MKSTEMP)
869 ],
870 [
871 AC_MSG_RESULT(yes)
872 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100873 ]
Damien Millere8328192003-01-07 15:18:32 +1100874)
875fi
876
Darren Tucker70a3d552003-08-21 17:58:29 +1000877dnl make sure that openpty does not reacquire controlling terminal
878if test ! -z "$check_for_openpty_ctty_bug"; then
879 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
880 AC_TRY_RUN(
881 [
882#include <stdio.h>
883#include <sys/fcntl.h>
884#include <sys/types.h>
885#include <sys/wait.h>
886
887int
888main()
889{
890 pid_t pid;
891 int fd, ptyfd, ttyfd, status;
892
893 pid = fork();
894 if (pid < 0) { /* failed */
895 exit(1);
896 } else if (pid > 0) { /* parent */
897 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100898 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000899 exit(WEXITSTATUS(status));
900 else
901 exit(2);
902 } else { /* child */
903 close(0); close(1); close(2);
904 setsid();
905 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
906 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
907 if (fd >= 0)
908 exit(3); /* Acquired ctty: broken */
909 else
910 exit(0); /* Did not acquire ctty: OK */
911 }
912}
913 ],
914 [
915 AC_MSG_RESULT(yes)
916 ],
917 [
918 AC_MSG_RESULT(no)
919 AC_DEFINE(SSHD_ACQUIRES_CTTY)
920 ]
921 )
922fi
923
Damien Miller606f8802000-09-16 15:39:56 +1100924AC_FUNC_GETPGRP
925
Damien Millera64b57a2001-01-17 10:44:13 +1100926# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000927PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100928AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100929 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100930 [
Damien Millera64b57a2001-01-17 10:44:13 +1100931 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100932 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
933 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100934 AC_MSG_ERROR([PAM headers not found])
935 fi
936
937 AC_CHECK_LIB(dl, dlopen, , )
938 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
939 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000940 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100941
Damien Millera64b57a2001-01-17 10:44:13 +1100942 PAM_MSG="yes"
943
944 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800945 if test $ac_cv_lib_dl_dlopen = yes; then
946 LIBPAM="-lpam -ldl"
947 else
948 LIBPAM="-lpam"
949 fi
950 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100951 fi
952 ]
953)
Damien Millera22ba012000-03-02 23:09:20 +1100954
Damien Millera64b57a2001-01-17 10:44:13 +1100955# Check for older PAM
956if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100957 # Check PAM strerror arguments (old PAM)
958 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
959 AC_TRY_COMPILE(
960 [
Damien Miller81171112000-04-23 11:14:01 +1000961#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +1100962#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +1000963#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +1100964#elif defined (HAVE_PAM_PAM_APPL_H)
965#include <pam/pam_appl.h>
966#endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100967 ],
968 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +1100969 [AC_MSG_RESULT(no)],
970 [
971 AC_DEFINE(HAVE_OLD_PAM)
972 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000973 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100974 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100975 )
Damien Millera22ba012000-03-02 23:09:20 +1100976fi
977
Damien Millerfc93d4b2002-09-04 23:26:29 +1000978# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
979# because the system crypt() is more featureful.
980if test "x$check_for_libcrypt_before" = "x1"; then
981 AC_CHECK_LIB(crypt, crypt)
982fi
983
Tim Riceaef73712002-05-11 13:17:42 -0700984# Search for OpenSSL
985saved_CPPFLAGS="$CPPFLAGS"
986saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100987AC_ARG_WITH(ssl-dir,
988 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
989 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000990 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700991 if test -d "$withval/lib"; then
992 if test -n "${need_dash_r}"; then
993 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
994 else
995 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
996 fi
997 else
998 if test -n "${need_dash_r}"; then
999 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1000 else
1001 LDFLAGS="-L${withval} ${LDFLAGS}"
1002 fi
1003 fi
1004 if test -d "$withval/include"; then
1005 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1006 else
1007 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1008 fi
Damien Millera22ba012000-03-02 23:09:20 +11001009 fi
1010 ]
1011)
Tim Riceaef73712002-05-11 13:17:42 -07001012LIBS="$LIBS -lcrypto"
1013AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001014 [
Tim Riceaef73712002-05-11 13:17:42 -07001015 dnl Check default openssl install dir
1016 if test -n "${need_dash_r}"; then
1017 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001018 else
Tim Riceaef73712002-05-11 13:17:42 -07001019 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001020 fi
Tim Riceaef73712002-05-11 13:17:42 -07001021 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1022 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1023 [
1024 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1025 ]
1026 )
1027 ]
1028)
1029
Tim Riced730b782002-08-13 18:52:10 -07001030# Determine OpenSSL header version
1031AC_MSG_CHECKING([OpenSSL header version])
1032AC_TRY_RUN(
1033 [
1034#include <stdio.h>
1035#include <string.h>
1036#include <openssl/opensslv.h>
1037#define DATA "conftest.sslincver"
1038int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001039 FILE *fd;
1040 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001041
Damien Millera8e06ce2003-11-21 23:48:55 +11001042 fd = fopen(DATA,"w");
1043 if(fd == NULL)
1044 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001045
1046 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1047 exit(1);
1048
1049 exit(0);
1050}
1051 ],
1052 [
1053 ssl_header_ver=`cat conftest.sslincver`
1054 AC_MSG_RESULT($ssl_header_ver)
1055 ],
1056 [
1057 AC_MSG_RESULT(not found)
1058 AC_MSG_ERROR(OpenSSL version header not found.)
1059 ]
1060)
1061
1062# Determine OpenSSL library version
1063AC_MSG_CHECKING([OpenSSL library version])
1064AC_TRY_RUN(
1065 [
1066#include <stdio.h>
1067#include <string.h>
1068#include <openssl/opensslv.h>
1069#include <openssl/crypto.h>
1070#define DATA "conftest.ssllibver"
1071int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001072 FILE *fd;
1073 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001074
Damien Millera8e06ce2003-11-21 23:48:55 +11001075 fd = fopen(DATA,"w");
1076 if(fd == NULL)
1077 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001078
1079 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1080 exit(1);
1081
1082 exit(0);
1083}
1084 ],
1085 [
1086 ssl_library_ver=`cat conftest.ssllibver`
1087 AC_MSG_RESULT($ssl_library_ver)
1088 ],
1089 [
1090 AC_MSG_RESULT(not found)
1091 AC_MSG_ERROR(OpenSSL library not found.)
1092 ]
1093)
Damien Millera22ba012000-03-02 23:09:20 +11001094
Damien Millerec932372002-01-22 22:16:03 +11001095# Sanity check OpenSSL headers
1096AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1097AC_TRY_RUN(
1098 [
1099#include <string.h>
1100#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001101int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001102 ],
1103 [
1104 AC_MSG_RESULT(yes)
1105 ],
1106 [
1107 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001108 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1109Check config.log for details.
1110Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001111 ]
1112)
1113
Damien Millera8e06ce2003-11-21 23:48:55 +11001114# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001115# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001116if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001117 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001118fi
1119
Damien Miller6c21c512002-01-22 21:57:53 +11001120
1121### Configure cryptographic random number support
1122
1123# Check wheter OpenSSL seeds itself
1124AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1125AC_TRY_RUN(
1126 [
1127#include <string.h>
1128#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001129int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001130 ],
1131 [
1132 OPENSSL_SEEDS_ITSELF=yes
1133 AC_MSG_RESULT(yes)
1134 ],
1135 [
1136 AC_MSG_RESULT(no)
1137 # Default to use of the rand helper if OpenSSL doesn't
1138 # seed itself
1139 USE_RAND_HELPER=yes
1140 ]
1141)
1142
1143
1144# Do we want to force the use of the rand helper?
1145AC_ARG_WITH(rand-helper,
1146 [ --with-rand-helper Use subprocess to gather strong randomness ],
1147 [
1148 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001149 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001150 # the previous test showed it to be unseeded.
1151 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1152 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1153 OPENSSL_SEEDS_ITSELF=yes
1154 USE_RAND_HELPER=""
1155 fi
1156 else
1157 USE_RAND_HELPER=yes
1158 fi
1159 ],
1160)
1161
1162# Which randomness source do we use?
1163if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1164 # OpenSSL only
1165 AC_DEFINE(OPENSSL_PRNG_ONLY)
1166 RAND_MSG="OpenSSL internal ONLY"
1167 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001168elif test ! -z "$USE_RAND_HELPER" ; then
1169 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001170 RAND_MSG="ssh-rand-helper"
1171 INSTALL_SSH_RAND_HELPER="yes"
1172fi
1173AC_SUBST(INSTALL_SSH_RAND_HELPER)
1174
1175### Configuration of ssh-rand-helper
1176
1177# PRNGD TCP socket
1178AC_ARG_WITH(prngd-port,
1179 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1180 [
Damien Millere996d722002-01-23 11:20:59 +11001181 case "$withval" in
1182 no)
1183 withval=""
1184 ;;
1185 [[0-9]]*)
1186 ;;
1187 *)
1188 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1189 ;;
1190 esac
1191 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001192 PRNGD_PORT="$withval"
1193 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1194 fi
1195 ]
1196)
1197
1198# PRNGD Unix domain socket
1199AC_ARG_WITH(prngd-socket,
1200 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1201 [
Damien Millere996d722002-01-23 11:20:59 +11001202 case "$withval" in
1203 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001204 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001205 ;;
1206 no)
1207 withval=""
1208 ;;
1209 /*)
1210 ;;
1211 *)
1212 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1213 ;;
1214 esac
1215
1216 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001217 if test ! -z "$PRNGD_PORT" ; then
1218 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1219 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001220 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001221 AC_MSG_WARN(Entropy socket is not readable)
1222 fi
1223 PRNGD_SOCKET="$withval"
1224 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1225 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001226 ],
1227 [
1228 # Check for existing socket only if we don't have a random device already
1229 if test "$USE_RAND_HELPER" = yes ; then
1230 AC_MSG_CHECKING(for PRNGD/EGD socket)
1231 # Insert other locations here
1232 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1233 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1234 PRNGD_SOCKET="$sock"
1235 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1236 break;
1237 fi
1238 done
1239 if test ! -z "$PRNGD_SOCKET" ; then
1240 AC_MSG_RESULT($PRNGD_SOCKET)
1241 else
1242 AC_MSG_RESULT(not found)
1243 fi
1244 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001245 ]
1246)
1247
1248# Change default command timeout for hashing entropy source
1249entropy_timeout=200
1250AC_ARG_WITH(entropy-timeout,
1251 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1252 [
1253 if test "x$withval" != "xno" ; then
1254 entropy_timeout=$withval
1255 fi
1256 ]
1257)
Damien Miller6c21c512002-01-22 21:57:53 +11001258AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1259
Damien Millerd3f6ad22002-06-25 10:24:47 +10001260SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001261AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001262 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001263 [
1264 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001265 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001266 fi
1267 ]
1268)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001269AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1270AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001271
Tim Rice88f2ab52002-03-17 12:17:34 -08001272# We do this little dance with the search path to insure
1273# that programs that we select for use by installed programs
1274# (which may be run by the super-user) come from trusted
1275# locations before they come from the user's private area.
1276# This should help avoid accidentally configuring some
1277# random version of a program in someone's personal bin.
1278
1279OPATH=$PATH
1280PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001281test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001282test -d /sbin && PATH=$PATH:/sbin
1283test -d /usr/sbin && PATH=$PATH:/usr/sbin
1284PATH=$PATH:/etc:$OPATH
1285
Damien Millera8e06ce2003-11-21 23:48:55 +11001286# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001287OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1288OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1289OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1290OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1291OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1292OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1293OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1294OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1295OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1296OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1297OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1298OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1299OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1300OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1301OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1302OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001303# restore PATH
1304PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001305
1306# Where does ssh-rand-helper get its randomness from?
1307INSTALL_SSH_PRNG_CMDS=""
1308if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1309 if test ! -z "$PRNGD_PORT" ; then
1310 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1311 elif test ! -z "$PRNGD_SOCKET" ; then
1312 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1313 else
1314 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1315 RAND_HELPER_CMDHASH=yes
1316 INSTALL_SSH_PRNG_CMDS="yes"
1317 fi
1318fi
1319AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1320
1321
Ben Lindstromb5628642000-10-18 00:02:25 +00001322# Cheap hack to ensure NEWS-OS libraries are arranged right.
1323if test ! -z "$SONY" ; then
1324 LIBS="$LIBS -liberty";
1325fi
1326
Damien Millera22ba012000-03-02 23:09:20 +11001327# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001328AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001329AC_CHECK_SIZEOF(short int, 2)
1330AC_CHECK_SIZEOF(int, 4)
1331AC_CHECK_SIZEOF(long int, 4)
1332AC_CHECK_SIZEOF(long long int, 8)
1333
Damien Millerfa2bb692002-04-23 23:22:25 +10001334# Sanity check long long for some platforms (AIX)
1335if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1336 ac_cv_sizeof_long_long_int=0
1337fi
1338
Damien Millera22ba012000-03-02 23:09:20 +11001339# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001340AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1341 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001342 [ #include <sys/types.h> ],
1343 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001344 [ ac_cv_have_u_int="yes" ],
1345 [ ac_cv_have_u_int="no" ]
1346 )
1347])
1348if test "x$ac_cv_have_u_int" = "xyes" ; then
1349 AC_DEFINE(HAVE_U_INT)
1350 have_u_int=1
1351fi
1352
Damien Miller61e50f12000-05-08 20:49:37 +10001353AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1354 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001355 [ #include <sys/types.h> ],
1356 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001357 [ ac_cv_have_intxx_t="yes" ],
1358 [ ac_cv_have_intxx_t="no" ]
1359 )
1360])
1361if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1362 AC_DEFINE(HAVE_INTXX_T)
1363 have_intxx_t=1
1364fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001365
1366if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001367 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001368then
1369 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1370 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001371 [ #include <stdint.h> ],
1372 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001373 [
1374 AC_DEFINE(HAVE_INTXX_T)
1375 AC_MSG_RESULT(yes)
1376 ],
1377 [ AC_MSG_RESULT(no) ]
1378 )
1379fi
1380
Damien Miller578783e2000-09-23 14:12:24 +11001381AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1382 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001383 [
1384#include <sys/types.h>
1385#ifdef HAVE_STDINT_H
1386# include <stdint.h>
1387#endif
1388#include <sys/socket.h>
1389#ifdef HAVE_SYS_BITYPES_H
1390# include <sys/bitypes.h>
1391#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001392 ],
1393 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001394 [ ac_cv_have_int64_t="yes" ],
1395 [ ac_cv_have_int64_t="no" ]
1396 )
1397])
1398if test "x$ac_cv_have_int64_t" = "xyes" ; then
1399 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001400fi
1401
Damien Miller61e50f12000-05-08 20:49:37 +10001402AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1403 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001404 [ #include <sys/types.h> ],
1405 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001406 [ ac_cv_have_u_intxx_t="yes" ],
1407 [ ac_cv_have_u_intxx_t="no" ]
1408 )
1409])
1410if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1411 AC_DEFINE(HAVE_U_INTXX_T)
1412 have_u_intxx_t=1
1413fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001414
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001415if test -z "$have_u_intxx_t" ; then
1416 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1417 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001418 [ #include <sys/socket.h> ],
1419 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001420 [
1421 AC_DEFINE(HAVE_U_INTXX_T)
1422 AC_MSG_RESULT(yes)
1423 ],
1424 [ AC_MSG_RESULT(no) ]
1425 )
1426fi
1427
Damien Miller578783e2000-09-23 14:12:24 +11001428AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1429 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001430 [ #include <sys/types.h> ],
1431 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001432 [ ac_cv_have_u_int64_t="yes" ],
1433 [ ac_cv_have_u_int64_t="no" ]
1434 )
1435])
1436if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1437 AC_DEFINE(HAVE_U_INT64_T)
1438 have_u_int64_t=1
1439fi
1440
Tim Rice4cec93f2002-02-26 08:40:48 -08001441if test -z "$have_u_int64_t" ; then
1442 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1443 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001444 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001445 [ u_int64_t a; a = 1],
1446 [
1447 AC_DEFINE(HAVE_U_INT64_T)
1448 AC_MSG_RESULT(yes)
1449 ],
1450 [ AC_MSG_RESULT(no) ]
1451 )
1452fi
1453
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001454if test -z "$have_u_intxx_t" ; then
1455 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1456 AC_TRY_COMPILE(
1457 [
1458#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001459 ],
1460 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001461 [ ac_cv_have_uintxx_t="yes" ],
1462 [ ac_cv_have_uintxx_t="no" ]
1463 )
1464 ])
1465 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1466 AC_DEFINE(HAVE_UINTXX_T)
1467 fi
1468fi
1469
1470if test -z "$have_uintxx_t" ; then
1471 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1472 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001473 [ #include <stdint.h> ],
1474 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001475 [
1476 AC_DEFINE(HAVE_UINTXX_T)
1477 AC_MSG_RESULT(yes)
1478 ],
1479 [ AC_MSG_RESULT(no) ]
1480 )
1481fi
1482
Damien Milleredb82922000-06-20 13:25:52 +10001483if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001484 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001485then
1486 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1487 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001488 [
1489#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001490 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001491 [
Damien Miller70494d12000-04-03 15:57:06 +10001492 int8_t a; int16_t b; int32_t c;
1493 u_int8_t e; u_int16_t f; u_int32_t g;
1494 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001495 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001496 [
1497 AC_DEFINE(HAVE_U_INTXX_T)
1498 AC_DEFINE(HAVE_INTXX_T)
1499 AC_MSG_RESULT(yes)
1500 ],
1501 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001502 )
Damien Millerb29ea912000-01-15 14:12:03 +11001503fi
1504
Damien Miller58be7382001-09-15 21:31:54 +10001505
1506AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1507 AC_TRY_COMPILE(
1508 [
1509#include <sys/types.h>
1510 ],
1511 [ u_char foo; foo = 125; ],
1512 [ ac_cv_have_u_char="yes" ],
1513 [ ac_cv_have_u_char="no" ]
1514 )
1515])
1516if test "x$ac_cv_have_u_char" = "xyes" ; then
1517 AC_DEFINE(HAVE_U_CHAR)
1518fi
1519
Tim Rice13aae5e2001-10-21 17:53:58 -07001520TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001521
Tim Rice200a5c02002-02-26 22:12:34 -08001522AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001523
Damien Miller61e50f12000-05-08 20:49:37 +10001524AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1525 AC_TRY_COMPILE(
1526 [
1527#include <sys/types.h>
1528 ],
1529 [ size_t foo; foo = 1235; ],
1530 [ ac_cv_have_size_t="yes" ],
1531 [ ac_cv_have_size_t="no" ]
1532 )
1533])
1534if test "x$ac_cv_have_size_t" = "xyes" ; then
1535 AC_DEFINE(HAVE_SIZE_T)
1536fi
Damien Miller95058511999-12-29 10:36:45 +11001537
Damien Miller615f9392000-05-17 22:53:33 +10001538AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1539 AC_TRY_COMPILE(
1540 [
1541#include <sys/types.h>
1542 ],
1543 [ ssize_t foo; foo = 1235; ],
1544 [ ac_cv_have_ssize_t="yes" ],
1545 [ ac_cv_have_ssize_t="no" ]
1546 )
1547])
1548if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1549 AC_DEFINE(HAVE_SSIZE_T)
1550fi
1551
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001552AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1553 AC_TRY_COMPILE(
1554 [
1555#include <time.h>
1556 ],
1557 [ clock_t foo; foo = 1235; ],
1558 [ ac_cv_have_clock_t="yes" ],
1559 [ ac_cv_have_clock_t="no" ]
1560 )
1561])
1562if test "x$ac_cv_have_clock_t" = "xyes" ; then
1563 AC_DEFINE(HAVE_CLOCK_T)
1564fi
1565
Damien Millerb54b40e2000-06-23 08:23:34 +10001566AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1567 AC_TRY_COMPILE(
1568 [
1569#include <sys/types.h>
1570#include <sys/socket.h>
1571 ],
1572 [ sa_family_t foo; foo = 1235; ],
1573 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001574 [ AC_TRY_COMPILE(
1575 [
1576#include <sys/types.h>
1577#include <sys/socket.h>
1578#include <netinet/in.h>
1579 ],
1580 [ sa_family_t foo; foo = 1235; ],
1581 [ ac_cv_have_sa_family_t="yes" ],
1582
Damien Millerb54b40e2000-06-23 08:23:34 +10001583 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001584 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001585 )
1586])
1587if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1588 AC_DEFINE(HAVE_SA_FAMILY_T)
1589fi
1590
Damien Miller0f91b4e2000-06-18 15:43:25 +10001591AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1592 AC_TRY_COMPILE(
1593 [
1594#include <sys/types.h>
1595 ],
1596 [ pid_t foo; foo = 1235; ],
1597 [ ac_cv_have_pid_t="yes" ],
1598 [ ac_cv_have_pid_t="no" ]
1599 )
1600])
1601if test "x$ac_cv_have_pid_t" = "xyes" ; then
1602 AC_DEFINE(HAVE_PID_T)
1603fi
1604
1605AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1606 AC_TRY_COMPILE(
1607 [
1608#include <sys/types.h>
1609 ],
1610 [ mode_t foo; foo = 1235; ],
1611 [ ac_cv_have_mode_t="yes" ],
1612 [ ac_cv_have_mode_t="no" ]
1613 )
1614])
1615if test "x$ac_cv_have_mode_t" = "xyes" ; then
1616 AC_DEFINE(HAVE_MODE_T)
1617fi
1618
Damien Miller61e50f12000-05-08 20:49:37 +10001619
1620AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1621 AC_TRY_COMPILE(
1622 [
Damien Miller81171112000-04-23 11:14:01 +10001623#include <sys/types.h>
1624#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001625 ],
1626 [ struct sockaddr_storage s; ],
1627 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1628 [ ac_cv_have_struct_sockaddr_storage="no" ]
1629 )
1630])
1631if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1632 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1633fi
Damien Miller34132e52000-01-14 15:45:46 +11001634
Damien Miller61e50f12000-05-08 20:49:37 +10001635AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1636 AC_TRY_COMPILE(
1637 [
Damien Miller7b22d652000-06-18 14:07:04 +10001638#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001639#include <netinet/in.h>
1640 ],
1641 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1642 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1643 [ ac_cv_have_struct_sockaddr_in6="no" ]
1644 )
1645])
1646if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1647 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1648fi
Damien Miller34132e52000-01-14 15:45:46 +11001649
Damien Miller61e50f12000-05-08 20:49:37 +10001650AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1651 AC_TRY_COMPILE(
1652 [
Damien Miller7b22d652000-06-18 14:07:04 +10001653#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001654#include <netinet/in.h>
1655 ],
1656 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1657 [ ac_cv_have_struct_in6_addr="yes" ],
1658 [ ac_cv_have_struct_in6_addr="no" ]
1659 )
1660])
1661if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1662 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1663fi
Damien Miller34132e52000-01-14 15:45:46 +11001664
Damien Miller61e50f12000-05-08 20:49:37 +10001665AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1666 AC_TRY_COMPILE(
1667 [
Damien Miller81171112000-04-23 11:14:01 +10001668#include <sys/types.h>
1669#include <sys/socket.h>
1670#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001671 ],
1672 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1673 [ ac_cv_have_struct_addrinfo="yes" ],
1674 [ ac_cv_have_struct_addrinfo="no" ]
1675 )
1676])
1677if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1678 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1679fi
1680
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001681AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1682 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001683 [ #include <sys/time.h> ],
1684 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001685 [ ac_cv_have_struct_timeval="yes" ],
1686 [ ac_cv_have_struct_timeval="no" ]
1687 )
1688])
1689if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1690 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1691 have_struct_timeval=1
1692fi
1693
Tim Rice4e4dc562003-03-18 10:21:40 -08001694AC_CHECK_TYPES(struct timespec)
1695
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001696# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001697if test "x$ac_cv_have_int64_t" = "xno" -a \
1698 "x$ac_cv_sizeof_long_int" != "x8" -a \
1699 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001700 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1701 echo "an alternative compiler (I.E., GCC) before continuing."
1702 echo ""
1703 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001704else
1705dnl test snprintf (broken on SCO w/gcc)
1706 AC_TRY_RUN(
1707 [
1708#include <stdio.h>
1709#include <string.h>
1710#ifdef HAVE_SNPRINTF
1711main()
1712{
1713 char buf[50];
1714 char expected_out[50];
1715 int mazsize = 50 ;
1716#if (SIZEOF_LONG_INT == 8)
1717 long int num = 0x7fffffffffffffff;
1718#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001719 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001720#endif
1721 strcpy(expected_out, "9223372036854775807");
1722 snprintf(buf, mazsize, "%lld", num);
1723 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001724 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001725 exit(0);
1726}
1727#else
1728main() { exit(0); }
1729#endif
1730 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1731 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001732fi
1733
Damien Miller78315eb2000-09-29 23:01:36 +11001734dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001735OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1736OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1737OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1738OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1739OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001740OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001741OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1742OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001743OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001744OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1745OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1746OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1747OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001748OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1749OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1750OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1751OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001752
1753AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001754
Damien Miller61e50f12000-05-08 20:49:37 +10001755AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1756 ac_cv_have_ss_family_in_struct_ss, [
1757 AC_TRY_COMPILE(
1758 [
Damien Miller81171112000-04-23 11:14:01 +10001759#include <sys/types.h>
1760#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001761 ],
1762 [ struct sockaddr_storage s; s.ss_family = 1; ],
1763 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1764 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1765 )
1766])
1767if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1768 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1769fi
1770
Damien Miller61e50f12000-05-08 20:49:37 +10001771AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1772 ac_cv_have___ss_family_in_struct_ss, [
1773 AC_TRY_COMPILE(
1774 [
Damien Miller81171112000-04-23 11:14:01 +10001775#include <sys/types.h>
1776#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001777 ],
1778 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1779 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1780 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1781 )
1782])
1783if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1784 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1785fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001786
Damien Millerad833b32000-08-23 10:46:23 +10001787AC_CACHE_CHECK([for pw_class field in struct passwd],
1788 ac_cv_have_pw_class_in_struct_passwd, [
1789 AC_TRY_COMPILE(
1790 [
Damien Millerad833b32000-08-23 10:46:23 +10001791#include <pwd.h>
1792 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001793 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001794 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1795 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1796 )
1797])
1798if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1799 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1800fi
1801
Kevin Steves82456952001-06-22 21:14:18 +00001802AC_CACHE_CHECK([for pw_expire field in struct passwd],
1803 ac_cv_have_pw_expire_in_struct_passwd, [
1804 AC_TRY_COMPILE(
1805 [
1806#include <pwd.h>
1807 ],
1808 [ struct passwd p; p.pw_expire = 0; ],
1809 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1810 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1811 )
1812])
1813if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1814 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1815fi
1816
1817AC_CACHE_CHECK([for pw_change field in struct passwd],
1818 ac_cv_have_pw_change_in_struct_passwd, [
1819 AC_TRY_COMPILE(
1820 [
1821#include <pwd.h>
1822 ],
1823 [ struct passwd p; p.pw_change = 0; ],
1824 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1825 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1826 )
1827])
1828if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1829 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1830fi
Damien Miller61e50f12000-05-08 20:49:37 +10001831
Tim Rice28bbb0c2002-05-27 17:37:32 -07001832dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001833AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1834 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001835 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001836 [
Tim Riceae49fe62002-04-12 10:26:21 -07001837#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001838#include <sys/socket.h>
1839#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001840int main() {
1841#ifdef msg_accrights
1842exit(1);
1843#endif
1844struct msghdr m;
1845m.msg_accrights = 0;
1846exit(0);
1847}
Kevin Steves939c9db2002-03-22 17:23:25 +00001848 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001849 [ ac_cv_have_accrights_in_msghdr="yes" ],
1850 [ ac_cv_have_accrights_in_msghdr="no" ]
1851 )
1852])
1853if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1854 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1855fi
1856
Kevin Stevesa44e0352002-04-07 16:18:03 +00001857AC_CACHE_CHECK([for msg_control field in struct msghdr],
1858 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001859 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001860 [
Tim Riceae49fe62002-04-12 10:26:21 -07001861#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001862#include <sys/socket.h>
1863#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001864int main() {
1865#ifdef msg_control
1866exit(1);
1867#endif
1868struct msghdr m;
1869m.msg_control = 0;
1870exit(0);
1871}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001872 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001873 [ ac_cv_have_control_in_msghdr="yes" ],
1874 [ ac_cv_have_control_in_msghdr="no" ]
1875 )
1876])
1877if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1878 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1879fi
1880
Damien Miller61e50f12000-05-08 20:49:37 +10001881AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001882 AC_TRY_LINK([],
1883 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001884 [ ac_cv_libc_defines___progname="yes" ],
1885 [ ac_cv_libc_defines___progname="no" ]
1886 )
1887])
1888if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1889 AC_DEFINE(HAVE___PROGNAME)
1890fi
1891
Kevin Steves4846f4a2002-03-22 18:19:53 +00001892AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1893 AC_TRY_LINK([
1894#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001895],
1896 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001897 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1898 [ ac_cv_cc_implements___FUNCTION__="no" ]
1899 )
1900])
1901if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1902 AC_DEFINE(HAVE___FUNCTION__)
1903fi
1904
1905AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1906 AC_TRY_LINK([
1907#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001908],
1909 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001910 [ ac_cv_cc_implements___func__="yes" ],
1911 [ ac_cv_cc_implements___func__="no" ]
1912 )
1913])
1914if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1915 AC_DEFINE(HAVE___func__)
1916fi
1917
Damien Miller4f8e6692001-07-14 13:22:53 +10001918AC_CACHE_CHECK([whether getopt has optreset support],
1919 ac_cv_have_getopt_optreset, [
1920 AC_TRY_LINK(
1921 [
1922#include <getopt.h>
1923 ],
1924 [ extern int optreset; optreset = 0; ],
1925 [ ac_cv_have_getopt_optreset="yes" ],
1926 [ ac_cv_have_getopt_optreset="no" ]
1927 )
1928])
1929if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1930 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1931fi
Damien Millera22ba012000-03-02 23:09:20 +11001932
Damien Millerecbb26d2000-07-15 14:59:14 +10001933AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001934 AC_TRY_LINK([],
1935 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001936 [ ac_cv_libc_defines_sys_errlist="yes" ],
1937 [ ac_cv_libc_defines_sys_errlist="no" ]
1938 )
1939])
1940if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1941 AC_DEFINE(HAVE_SYS_ERRLIST)
1942fi
1943
1944
Damien Miller11fa2cc2000-08-16 10:35:58 +10001945AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001946 AC_TRY_LINK([],
1947 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001948 [ ac_cv_libc_defines_sys_nerr="yes" ],
1949 [ ac_cv_libc_defines_sys_nerr="no" ]
1950 )
1951])
1952if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1953 AC_DEFINE(HAVE_SYS_NERR)
1954fi
1955
Damien Millera8e06ce2003-11-21 23:48:55 +11001956SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001957# Check whether user wants sectok support
1958AC_ARG_WITH(sectok,
1959 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001960 [
1961 if test "x$withval" != "xno" ; then
1962 if test "x$withval" != "xyes" ; then
1963 CPPFLAGS="$CPPFLAGS -I${withval}"
1964 LDFLAGS="$LDFLAGS -L${withval}"
1965 if test ! -z "$need_dash_r" ; then
1966 LDFLAGS="$LDFLAGS -R${withval}"
1967 fi
1968 if test ! -z "$blibpath" ; then
1969 blibpath="$blibpath:${withval}"
1970 fi
1971 fi
1972 AC_CHECK_HEADERS(sectok.h)
1973 if test "$ac_cv_header_sectok_h" != yes; then
1974 AC_MSG_ERROR(Can't find sectok.h)
1975 fi
1976 AC_CHECK_LIB(sectok, sectok_open)
1977 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1978 AC_MSG_ERROR(Can't find libsectok)
1979 fi
1980 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001981 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11001982 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001983 fi
1984 ]
1985)
1986
1987# Check whether user wants OpenSC support
1988AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001989 AC_HELP_STRING([--with-opensc=PFX],
1990 [Enable smartcard support using OpenSC]),
1991 opensc_config_prefix="$withval", opensc_config_prefix="")
1992if test x$opensc_config_prefix != x ; then
1993 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1994 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1995 if test "$OPENSC_CONFIG" != "no"; then
1996 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1997 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1998 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1999 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2000 AC_DEFINE(SMARTCARD)
2001 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002002 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002003 fi
2004fi
Damien Miller85de5802001-09-18 14:01:11 +10002005
Darren Tucker5f88d342003-10-15 16:57:57 +10002006# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002007AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002008 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002009 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002010 # Needed by our getrrsetbyname()
2011 AC_SEARCH_LIBS(res_query, resolv)
2012 AC_SEARCH_LIBS(dn_expand, resolv)
2013 AC_CHECK_FUNCS(_getshort _getlong)
2014 AC_CHECK_MEMBER(HEADER.ad,
2015 [AC_DEFINE(HAVE_HEADER_AD)],,
2016 [#include <arpa/nameser.h>])
2017 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002018
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002019# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002020KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002021AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002022 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002023 [ if test "x$withval" != "xno" ; then
2024 if test "x$withval" = "xyes" ; then
2025 KRB5ROOT="/usr/local"
2026 else
2027 KRB5ROOT=${withval}
2028 fi
2029
2030 AC_DEFINE(KRB5)
2031 KRB5_MSG="yes"
2032
2033 AC_MSG_CHECKING(for krb5-config)
2034 if test -x $KRB5ROOT/bin/krb5-config ; then
2035 KRB5CONF=$KRB5ROOT/bin/krb5-config
2036 AC_MSG_RESULT($KRB5CONF)
2037
2038 AC_MSG_CHECKING(for gssapi support)
2039 if $KRB5CONF | grep gssapi >/dev/null ; then
2040 AC_MSG_RESULT(yes)
2041 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
2042 dnl m4 quadragraphs: "sed 's/-l[^- ]*//g'"
2043 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
2044 K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002045 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002046 AC_MSG_RESULT(no)
2047 K5CFLAGS="`$KRB5CONF --cflags`"
2048 K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
2049 K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002050 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002051 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2052 LDFLAGS="$LDFLAGS $K5LDFLAGS"
2053 AC_MSG_CHECKING(whether we are using Heimdal)
2054 AC_TRY_COMPILE([ #include <krb5.h> ],
2055 [ char *tmp = heimdal_version; ],
2056 [ AC_MSG_RESULT(yes)
2057 AC_DEFINE(HEIMDAL) ],
2058 AC_MSG_RESULT(no)
2059 )
2060 else
2061 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002062 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002063 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002064 AC_MSG_CHECKING(whether we are using Heimdal)
2065 AC_TRY_COMPILE([ #include <krb5.h> ],
2066 [ char *tmp = heimdal_version; ],
2067 [ AC_MSG_RESULT(yes)
2068 AC_DEFINE(HEIMDAL)
2069 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2070 ],
2071 [ AC_MSG_RESULT(no)
2072 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2073 ]
2074 )
Damien Miller200d0a72003-06-30 19:21:36 +10002075 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002076
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002077 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2078 [ AC_DEFINE(GSSAPI)
2079 K5LIBS="-lgssapi $K5LIBS" ],
2080 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2081 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002082 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002083 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2084 $K5LIBS)
2085 ],
2086 $K5LIBS)
2087
2088 AC_CHECK_HEADER(gssapi.h, ,
2089 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002090 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002091 AC_CHECK_HEADERS(gssapi.h, ,
2092 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002093 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002094 ]
2095 )
2096
2097 oldCPP="$CPPFLAGS"
2098 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2099 AC_CHECK_HEADER(gssapi_krb5.h, ,
2100 [ CPPFLAGS="$oldCPP" ])
2101
Damien Millera8e06ce2003-11-21 23:48:55 +11002102 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002103 if test ! -z "$need_dash_r" ; then
2104 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2105 fi
2106 if test ! -z "$blibpath" ; then
2107 blibpath="$blibpath:${KRB5ROOT}/lib"
2108 fi
2109 fi ]
2110 AC_SEARCH_LIBS(k_hasafs, kafs,
2111 [ AC_DEFINE(AFS)
2112 K5LIBS="-lkafs $K5LIBS"
2113 ]
2114 )
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002115)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002116LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002117
Damien Millera22ba012000-03-02 23:09:20 +11002118# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002119
Damien Millerf58c6722002-05-13 13:15:42 +10002120PRIVSEP_PATH=/var/empty
2121AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002122 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002123 [
2124 if test "x$withval" != "$no" ; then
2125 PRIVSEP_PATH=$withval
2126 fi
2127 ]
2128)
2129AC_SUBST(PRIVSEP_PATH)
2130
Damien Millera22ba012000-03-02 23:09:20 +11002131AC_ARG_WITH(xauth,
2132 [ --with-xauth=PATH Specify path to xauth program ],
2133 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002134 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002135 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002136 fi
2137 ],
2138 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002139 TestPath="$PATH"
2140 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2141 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2142 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2143 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2144 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002145 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002146 xauth_path="/usr/openwin/bin/xauth"
2147 fi
2148 ]
2149)
2150
Damien Miller7d901272003-01-13 16:55:22 +11002151STRIP_OPT=-s
2152AC_ARG_ENABLE(strip,
2153 [ --disable-strip Disable calling strip(1) on install],
2154 [
2155 if test "x$enableval" = "xno" ; then
2156 STRIP_OPT=
2157 fi
2158 ]
2159)
2160AC_SUBST(STRIP_OPT)
2161
Damien Millera19cf472000-11-29 13:28:50 +11002162if test -z "$xauth_path" ; then
2163 XAUTH_PATH="undefined"
2164 AC_SUBST(XAUTH_PATH)
2165else
Damien Millera22ba012000-03-02 23:09:20 +11002166 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002167 XAUTH_PATH=$xauth_path
2168 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002169fi
Damien Millera22ba012000-03-02 23:09:20 +11002170
2171# Check for mail directory (last resort if we cannot get it from headers)
2172if test ! -z "$MAIL" ; then
2173 maildir=`dirname $MAIL`
2174 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2175fi
2176
Damien Millera22ba012000-03-02 23:09:20 +11002177if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002178 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002179 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002180 [
2181 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2182 have_dev_ptmx=1
2183 ]
2184 )
2185 fi
Damien Millera22ba012000-03-02 23:09:20 +11002186fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002187AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002188 [
2189 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2190 have_dev_ptc=1
2191 ]
2192)
2193
Damien Millera22ba012000-03-02 23:09:20 +11002194# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002195AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002196 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002197 [
Damien Miller897741e2001-04-16 10:41:46 +10002198 case "$withval" in
2199 man|cat|doc)
2200 MANTYPE=$withval
2201 ;;
2202 *)
2203 AC_MSG_ERROR(invalid man type: $withval)
2204 ;;
2205 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002206 ]
2207)
Ben Lindstrombc709922001-04-18 18:04:21 +00002208if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002209 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2210 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002211 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2212 MANTYPE=doc
2213 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2214 MANTYPE=man
2215 else
2216 MANTYPE=cat
2217 fi
2218fi
Damien Miller670a4b82000-01-22 13:53:11 +11002219AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002220if test "$MANTYPE" = "doc"; then
2221 mansubdir=man;
2222else
2223 mansubdir=$MANTYPE;
2224fi
2225AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002226
Damien Millera22ba012000-03-02 23:09:20 +11002227# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002228MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002229AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002230 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002231 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002232 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002233 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002234 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002235 fi
2236 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002237)
2238
Damien Millera22ba012000-03-02 23:09:20 +11002239# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002240AC_ARG_WITH(shadow,
2241 [ --without-shadow Disable shadow password support],
2242 [
2243 if test "x$withval" = "xno" ; then
2244 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002245 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002246 fi
2247 ]
2248)
2249
Damien Miller1f335fb2000-06-26 11:31:33 +10002250if test -z "$disable_shadow" ; then
2251 AC_MSG_CHECKING([if the systems has expire shadow information])
2252 AC_TRY_COMPILE(
2253 [
2254#include <sys/types.h>
2255#include <shadow.h>
2256 struct spwd sp;
2257 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2258 [ sp_expire_available=yes ], []
2259 )
2260
2261 if test "x$sp_expire_available" = "xyes" ; then
2262 AC_MSG_RESULT(yes)
2263 AC_DEFINE(HAS_SHADOW_EXPIRE)
2264 else
2265 AC_MSG_RESULT(no)
2266 fi
2267fi
2268
Damien Millera22ba012000-03-02 23:09:20 +11002269# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002270if test ! -z "$IPADDR_IN_DISPLAY" ; then
2271 DISPLAY_HACK_MSG="yes"
2272 AC_DEFINE(IPADDR_IN_DISPLAY)
2273else
Damien Millera8e06ce2003-11-21 23:48:55 +11002274 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002275 AC_ARG_WITH(ipaddr-display,
2276 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2277 [
2278 if test "x$withval" != "xno" ; then
2279 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002280 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002281 fi
2282 ]
2283 )
2284fi
Damien Miller76112de1999-12-21 11:18:08 +11002285
Darren Tuckere1a790d2003-09-16 11:52:19 +10002286# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002287AC_ARG_ENABLE(etc-default-login,
2288 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2289[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002290AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2291
2292if test "x$external_path_file" = "x/etc/default/login"; then
2293 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2294fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002295])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002296
Tim Rice43a1c132002-04-17 21:19:14 -07002297dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2298if test $ac_cv_func_login_getcapbool = "yes" -a \
2299 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002300 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002301fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002302
Damien Millera22ba012000-03-02 23:09:20 +11002303# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002304SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002305AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002306 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002307 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002308 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002309 AC_MSG_WARN([
2310--with-default-path=PATH has no effect on this system.
2311Edit /etc/login.conf instead.])
2312 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002313 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002314 AC_MSG_WARN([
2315--with-default-path=PATH will only be used if PATH is not defined in
2316$external_path_file .])
2317 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002318 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002319 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002320 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002321 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002322 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2323 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002324 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002325 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002326 AC_MSG_WARN([
2327If PATH is defined in $external_path_file, ensure the path to scp is included,
2328otherwise scp will not work.])
2329 fi
2330 AC_TRY_RUN(
2331 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002332/* find out what STDPATH is */
2333#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002334#ifdef HAVE_PATHS_H
2335# include <paths.h>
2336#endif
2337#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002338# ifdef _PATH_USERPATH /* Irix */
2339# define _PATH_STDPATH _PATH_USERPATH
2340# else
2341# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2342# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002343#endif
2344#include <sys/types.h>
2345#include <sys/stat.h>
2346#include <fcntl.h>
2347#define DATA "conftest.stdpath"
2348
2349main()
2350{
2351 FILE *fd;
2352 int rc;
2353
2354 fd = fopen(DATA,"w");
2355 if(fd == NULL)
2356 exit(1);
2357
2358 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2359 exit(1);
2360
2361 exit(0);
2362}
2363 ], [ user_path=`cat conftest.stdpath` ],
2364 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2365 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2366 )
2367# make sure $bindir is in USER_PATH so scp will work
2368 t_bindir=`eval echo ${bindir}`
2369 case $t_bindir in
2370 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2371 esac
2372 case $t_bindir in
2373 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2374 esac
2375 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2376 if test $? -ne 0 ; then
2377 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2378 if test $? -ne 0 ; then
2379 user_path=$user_path:$t_bindir
2380 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2381 fi
2382 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002383 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002384)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002385if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002386 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2387 AC_SUBST(user_path)
2388fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002389
Damien Millera18bbd32002-05-13 10:48:57 +10002390# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002391AC_ARG_WITH(superuser-path,
2392 [ --with-superuser-path= Specify different path for super-user],
2393 [
2394 if test "x$withval" != "xno" ; then
2395 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2396 superuser_path=$withval
2397 fi
2398 ]
2399)
2400
2401
Damien Miller61e50f12000-05-08 20:49:37 +10002402AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002403IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002404AC_ARG_WITH(4in6,
2405 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2406 [
2407 if test "x$withval" != "xno" ; then
2408 AC_MSG_RESULT(yes)
2409 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002410 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002411 else
2412 AC_MSG_RESULT(no)
2413 fi
2414 ],[
2415 if test "x$inet6_default_4in6" = "xyes"; then
2416 AC_MSG_RESULT([yes (default)])
2417 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002418 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002419 else
2420 AC_MSG_RESULT([no (default)])
2421 fi
2422 ]
2423)
2424
Damien Miller60396b02001-02-18 17:01:00 +11002425# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002426BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002427AC_ARG_WITH(bsd-auth,
2428 [ --with-bsd-auth Enable BSD auth support],
2429 [
2430 if test "x$withval" != "xno" ; then
2431 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002432 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002433 fi
2434 ]
2435)
2436
Damien Millera22ba012000-03-02 23:09:20 +11002437# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002438piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002439# make sure the directory exists
2440if test ! -d $piddir ; then
2441 piddir=`eval echo ${sysconfdir}`
2442 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002443 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002444 esac
2445fi
2446
Tim Rice88f2ab52002-03-17 12:17:34 -08002447AC_ARG_WITH(pid-dir,
2448 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2449 [
2450 if test "x$withval" != "xno" ; then
2451 piddir=$withval
2452 if test ! -d $piddir ; then
2453 AC_MSG_WARN([** no $piddir directory on this system **])
2454 fi
2455 fi
2456 ]
2457)
2458
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002459AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002460AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002461
andre2ff7b5d2000-06-03 14:57:40 +00002462dnl allow user to disable some login recording features
2463AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002464 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002465 [
2466 if test "x$enableval" = "xno" ; then
2467 AC_DEFINE(DISABLE_LASTLOG)
2468 fi
2469 ]
andre2ff7b5d2000-06-03 14:57:40 +00002470)
2471AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002472 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002473 [
2474 if test "x$enableval" = "xno" ; then
2475 AC_DEFINE(DISABLE_UTMP)
2476 fi
2477 ]
andre2ff7b5d2000-06-03 14:57:40 +00002478)
2479AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002480 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002481 [
2482 if test "x$enableval" = "xno" ; then
2483 AC_DEFINE(DISABLE_UTMPX)
2484 fi
2485 ]
andre2ff7b5d2000-06-03 14:57:40 +00002486)
2487AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002488 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002489 [
2490 if test "x$enableval" = "xno" ; then
2491 AC_DEFINE(DISABLE_WTMP)
2492 fi
2493 ]
andre2ff7b5d2000-06-03 14:57:40 +00002494)
2495AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002496 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002497 [
2498 if test "x$enableval" = "xno" ; then
2499 AC_DEFINE(DISABLE_WTMPX)
2500 fi
2501 ]
andre2ff7b5d2000-06-03 14:57:40 +00002502)
2503AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002504 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002505 [
2506 if test "x$enableval" = "xno" ; then
2507 AC_DEFINE(DISABLE_LOGIN)
2508 fi
2509 ]
andre2ff7b5d2000-06-03 14:57:40 +00002510)
2511AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002512 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002513 [
2514 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002515 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002516 fi
2517 ]
andre2ff7b5d2000-06-03 14:57:40 +00002518)
2519AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002520 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002521 [
2522 if test "x$enableval" = "xno" ; then
2523 AC_DEFINE(DISABLE_PUTUTXLINE)
2524 fi
2525 ]
andre2ff7b5d2000-06-03 14:57:40 +00002526)
2527AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002528 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002529 [
2530 if test "x$withval" = "xno" ; then
2531 AC_DEFINE(DISABLE_LASTLOG)
2532 else
2533 conf_lastlog_location=$withval
2534 fi
2535 ]
2536)
andre2ff7b5d2000-06-03 14:57:40 +00002537
2538dnl lastlog, [uw]tmpx? detection
2539dnl NOTE: set the paths in the platform section to avoid the
2540dnl need for command-line parameters
2541dnl lastlog and [uw]tmp are subject to a file search if all else fails
2542
2543dnl lastlog detection
2544dnl NOTE: the code itself will detect if lastlog is a directory
2545AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2546AC_TRY_COMPILE([
2547#include <sys/types.h>
2548#include <utmp.h>
2549#ifdef HAVE_LASTLOG_H
2550# include <lastlog.h>
2551#endif
Damien Miller2994e082000-06-04 15:51:47 +10002552#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002553# include <paths.h>
2554#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002555#ifdef HAVE_LOGIN_H
2556# include <login.h>
2557#endif
andre2ff7b5d2000-06-03 14:57:40 +00002558 ],
2559 [ char *lastlog = LASTLOG_FILE; ],
2560 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002561 [
2562 AC_MSG_RESULT(no)
2563 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2564 AC_TRY_COMPILE([
2565#include <sys/types.h>
2566#include <utmp.h>
2567#ifdef HAVE_LASTLOG_H
2568# include <lastlog.h>
2569#endif
2570#ifdef HAVE_PATHS_H
2571# include <paths.h>
2572#endif
2573 ],
2574 [ char *lastlog = _PATH_LASTLOG; ],
2575 [ AC_MSG_RESULT(yes) ],
2576 [
andree441aa32000-06-12 22:34:38 +00002577 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002578 system_lastlog_path=no
2579 ])
2580 ]
andre2ff7b5d2000-06-03 14:57:40 +00002581)
Damien Miller2994e082000-06-04 15:51:47 +10002582
andre2ff7b5d2000-06-03 14:57:40 +00002583if test -z "$conf_lastlog_location"; then
2584 if test x"$system_lastlog_path" = x"no" ; then
2585 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002586 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002587 conf_lastlog_location=$f
2588 fi
2589 done
2590 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002591 AC_MSG_WARN([** Cannot find lastlog **])
2592 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002593 fi
2594 fi
2595fi
2596
2597if test -n "$conf_lastlog_location"; then
2598 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2599fi
2600
2601dnl utmp detection
2602AC_MSG_CHECKING([if your system defines UTMP_FILE])
2603AC_TRY_COMPILE([
2604#include <sys/types.h>
2605#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002606#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002607# include <paths.h>
2608#endif
2609 ],
2610 [ char *utmp = UTMP_FILE; ],
2611 [ AC_MSG_RESULT(yes) ],
2612 [ AC_MSG_RESULT(no)
2613 system_utmp_path=no ]
2614)
2615if test -z "$conf_utmp_location"; then
2616 if test x"$system_utmp_path" = x"no" ; then
2617 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2618 if test -f $f ; then
2619 conf_utmp_location=$f
2620 fi
2621 done
2622 if test -z "$conf_utmp_location"; then
2623 AC_DEFINE(DISABLE_UTMP)
2624 fi
2625 fi
2626fi
2627if test -n "$conf_utmp_location"; then
2628 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2629fi
2630
2631dnl wtmp detection
2632AC_MSG_CHECKING([if your system defines WTMP_FILE])
2633AC_TRY_COMPILE([
2634#include <sys/types.h>
2635#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002636#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002637# include <paths.h>
2638#endif
2639 ],
2640 [ char *wtmp = WTMP_FILE; ],
2641 [ AC_MSG_RESULT(yes) ],
2642 [ AC_MSG_RESULT(no)
2643 system_wtmp_path=no ]
2644)
2645if test -z "$conf_wtmp_location"; then
2646 if test x"$system_wtmp_path" = x"no" ; then
2647 for f in /usr/adm/wtmp /var/log/wtmp; do
2648 if test -f $f ; then
2649 conf_wtmp_location=$f
2650 fi
2651 done
2652 if test -z "$conf_wtmp_location"; then
2653 AC_DEFINE(DISABLE_WTMP)
2654 fi
2655 fi
2656fi
2657if test -n "$conf_wtmp_location"; then
2658 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2659fi
2660
2661
2662dnl utmpx detection - I don't know any system so perverse as to require
2663dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2664dnl there, though.
2665AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2666AC_TRY_COMPILE([
2667#include <sys/types.h>
2668#include <utmp.h>
2669#ifdef HAVE_UTMPX_H
2670#include <utmpx.h>
2671#endif
Damien Miller2994e082000-06-04 15:51:47 +10002672#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002673# include <paths.h>
2674#endif
2675 ],
2676 [ char *utmpx = UTMPX_FILE; ],
2677 [ AC_MSG_RESULT(yes) ],
2678 [ AC_MSG_RESULT(no)
2679 system_utmpx_path=no ]
2680)
2681if test -z "$conf_utmpx_location"; then
2682 if test x"$system_utmpx_path" = x"no" ; then
2683 AC_DEFINE(DISABLE_UTMPX)
2684 fi
2685else
2686 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2687fi
2688
2689dnl wtmpx detection
2690AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2691AC_TRY_COMPILE([
2692#include <sys/types.h>
2693#include <utmp.h>
2694#ifdef HAVE_UTMPX_H
2695#include <utmpx.h>
2696#endif
Damien Miller2994e082000-06-04 15:51:47 +10002697#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002698# include <paths.h>
2699#endif
2700 ],
2701 [ char *wtmpx = WTMPX_FILE; ],
2702 [ AC_MSG_RESULT(yes) ],
2703 [ AC_MSG_RESULT(no)
2704 system_wtmpx_path=no ]
2705)
2706if test -z "$conf_wtmpx_location"; then
2707 if test x"$system_wtmpx_path" = x"no" ; then
2708 AC_DEFINE(DISABLE_WTMPX)
2709 fi
2710else
2711 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2712fi
2713
Damien Miller4018c192000-04-30 09:30:44 +10002714
Damien Miller29ea30d2000-03-17 10:54:15 +11002715if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002716 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2717 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002718fi
2719
Tim Rice4cec93f2002-02-26 08:40:48 -08002720dnl remove pam and dl because they are in $LIBPAM
2721if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002722 LIBS=`echo $LIBS | sed 's/-lpam //'`
2723fi
2724if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2725 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002726fi
2727
Damien Millerbac2d8a2000-09-05 16:13:06 +11002728AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002729AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2730AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002731
Damien Miller7b22d652000-06-18 14:07:04 +10002732# Print summary of options
2733
Damien Miller7b22d652000-06-18 14:07:04 +10002734# Someone please show me a better way :)
2735A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2736B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2737C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2738D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002739E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002740F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002741G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002742H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2743I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2744J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002745
2746echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002747echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002748echo " User binaries: $B"
2749echo " System binaries: $C"
2750echo " Configuration files: $D"
2751echo " Askpass program: $E"
2752echo " Manual pages: $F"
2753echo " PID file: $G"
2754echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002755if test "x$external_path_file" = "x/etc/login.conf" ; then
2756echo " At runtime, sshd will use the path defined in $external_path_file"
2757echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002758else
Damien Millerf58c6722002-05-13 13:15:42 +10002759echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002760 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002761echo " (If PATH is set in $external_path_file it will be used instead. If"
2762echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2763 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002764fi
Damien Millera18bbd32002-05-13 10:48:57 +10002765if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002766echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002767fi
Damien Millerf58c6722002-05-13 13:15:42 +10002768echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002769echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002770echo " KerberosV support: $KRB5_MSG"
2771echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002772echo " S/KEY support: $SKEY_MSG"
2773echo " TCP Wrappers support: $TCPW_MSG"
2774echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002775echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002776echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2777echo " BSD Auth support: $BSD_AUTH_MSG"
2778echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002779if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002780echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002781fi
2782
Damien Miller7b22d652000-06-18 14:07:04 +10002783echo ""
2784
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002785echo " Host: ${host}"
2786echo " Compiler: ${CC}"
2787echo " Compiler flags: ${CFLAGS}"
2788echo "Preprocessor flags: ${CPPFLAGS}"
2789echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002790echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002791
2792echo ""
2793
Damien Miller82cf0ce2000-12-20 13:34:48 +11002794if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002795 echo "PAM is enabled. You may need to install a PAM control file "
2796 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002797 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002798 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002799 echo ""
2800fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002801
Damien Miller6c21c512002-01-22 21:57:53 +11002802if test ! -z "$RAND_HELPER_CMDHASH" ; then
2803 echo "WARNING: you are using the builtin random number collection "
2804 echo "service. Please read WARNING.RNG and request that your OS "
2805 echo "vendor includes kernel-based random number collection in "
2806 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002807 echo ""
2808fi
Damien Miller60396b02001-02-18 17:01:00 +11002809