blob: c98332ac237dc77b0967062fcdc25872a9dda131 [file] [log] [blame]
Darren Tucker2dcd2392004-01-23 17:13:33 +11001# $Id: configure.ac,v 1.186 2004/01/23 06:13:33 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 ***]))
Darren Tucker2dcd2392004-01-23 17:13:33 +1100591AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
592AC_MSG_CHECKING(for zlib 1.1.4 or greater)
593AC_TRY_RUN([
594#include <zlib.h>
595int main()
596{
597 int a, b, c, v;
598 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
599 exit(1);
600 v = a*1000000 + b*1000 + c;
601 if (v >= 1001004)
602 exit(0);
603 exit(2);
604}
605 ],
606 AC_MSG_RESULT(yes),
607 [ AC_MSG_RESULT(no)
608 AC_MSG_ERROR([*** zlib too old - check config.log ***]) ]
609)
610
Damien Miller6f9c3372000-10-25 10:06:04 +1100611
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000612dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100613AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000614 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
615)
Damien Millera8e06ce2003-11-21 23:48:55 +1100616AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700617 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
618 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000619)
Damien Millerab18c411999-11-11 10:40:23 +1100620
Tim Ricee589a292001-11-03 11:09:32 -0800621dnl Checks for libutil functions
622AC_CHECK_HEADERS(libutil.h)
623AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
624AC_CHECK_FUNCS(logout updwtmp logwtmp)
625
Ben Lindstrom8697e082001-02-24 21:41:10 +0000626AC_FUNC_STRFTIME
627
Damien Miller3c027682001-03-14 11:39:45 +1100628# Check for ALTDIRFUNC glob() extension
629AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
630AC_EGREP_CPP(FOUNDIT,
631 [
632 #include <glob.h>
633 #ifdef GLOB_ALTDIRFUNC
634 FOUNDIT
635 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100636 ],
Damien Miller3c027682001-03-14 11:39:45 +1100637 [
638 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
639 AC_MSG_RESULT(yes)
640 ],
641 [
642 AC_MSG_RESULT(no)
643 ]
644)
Damien Millerab18c411999-11-11 10:40:23 +1100645
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000646# Check for g.gl_matchc glob() extension
647AC_MSG_CHECKING(for gl_matchc field in glob_t)
648AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100649 [
650 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000651 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100652 ],
653 [
654 AC_DEFINE(GLOB_HAS_GL_MATCHC)
655 AC_MSG_RESULT(yes)
656 ],
657 [
658 AC_MSG_RESULT(no)
659 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000660)
661
Damien Miller18bb4732001-03-28 14:35:30 +1000662AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
663AC_TRY_RUN(
664 [
665#include <sys/types.h>
666#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700667int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000668 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100669 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000670 [
671 AC_MSG_RESULT(no)
672 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
673 ]
674)
675
Damien Millerc547bf12001-02-16 10:18:12 +1100676# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100677SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100678AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700679 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100680 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100681 [
682 if test "x$withval" != "xno" ; then
683
684 if test "x$withval" != "xyes" ; then
685 CPPFLAGS="$CPPFLAGS -I${withval}/include"
686 LDFLAGS="$LDFLAGS -L${withval}/lib"
687 fi
688
689 AC_DEFINE(SKEY)
690 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100691 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100692
Tim Rice4cec93f2002-02-26 08:40:48 -0800693 AC_MSG_CHECKING([for s/key support])
694 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100695 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800696#include <stdio.h>
697#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700698int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800699 ],
700 [AC_MSG_RESULT(yes)],
701 [
702 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100703 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
704 ])
705 fi
706 ]
707)
708
709# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700710TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100711AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700712 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100713 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100714 [
715 if test "x$withval" != "xno" ; then
716 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700717 saved_LDFLAGS="$LDFLAGS"
718 saved_CPPFLAGS="$CPPFLAGS"
719 if test -n "${withval}" -a "${withval}" != "yes"; then
720 if test -d "${withval}/lib"; then
721 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700722 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700723 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700724 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700725 fi
726 else
727 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700728 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700729 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700730 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700731 fi
732 fi
733 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700734 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700735 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700736 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700737 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700738 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800739 LIBWRAP="-lwrap"
740 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100741 AC_MSG_CHECKING(for libwrap)
742 AC_TRY_LINK(
743 [
744#include <tcpd.h>
745 int deny_severity = 0, allow_severity = 0;
746 ],
747 [hosts_access(0);],
748 [
749 AC_MSG_RESULT(yes)
750 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800751 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700752 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100753 ],
754 [
755 AC_MSG_ERROR([*** libwrap missing])
756 ]
757 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800758 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100759 fi
760 ]
761)
762
Damien Millerfe1f1432003-02-24 15:45:42 +1100763dnl Checks for library functions. Please keep in alphabetical order
764AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000765 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000766 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000767 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000768 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100769 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000770 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
771 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
772 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100773 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000774 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000775 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000776 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100777)
Tim Rice13aae5e2001-10-21 17:53:58 -0700778
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000779# IRIX has a const char return value for gai_strerror()
780AC_CHECK_FUNCS(gai_strerror,[
781 AC_DEFINE(HAVE_GAI_STRERROR)
782 AC_TRY_COMPILE([
783#include <sys/types.h>
784#include <sys/socket.h>
785#include <netdb.h>
786
787const char *gai_strerror(int);],[
788char *str;
789
790str = gai_strerror(0);],[
791 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
792 [Define if gai_strerror() returns const char *])])])
793
Damien Millercd6853c2003-01-28 11:33:42 +1100794AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
795
Darren Tuckerf1159b52003-07-07 19:44:01 +1000796dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000797AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000798AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000799
Darren Tuckerb2427c82003-09-10 15:22:44 +1000800dnl tcsendbreak might be a macro
801AC_CHECK_DECL(tcsendbreak,
802 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100803 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000804 [#include <termios.h>]
805)
806
Darren Tucker2a6b0292003-12-31 14:59:17 +1100807AC_CHECK_FUNCS(setresuid, [
808 dnl Some platorms have setresuid that isn't implemented, test for this
809 AC_MSG_CHECKING(if setresuid seems to work)
810 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100811#include <stdlib.h>
812#include <errno.h>
813int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100814 ],
815 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100816 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100817 AC_MSG_RESULT(not implemented)]
818 )
819])
Darren Tuckere937be32003-12-17 18:53:26 +1100820
Darren Tucker2a6b0292003-12-31 14:59:17 +1100821AC_CHECK_FUNCS(setresgid, [
822 dnl Some platorms have setresgid that isn't implemented, test for this
823 AC_MSG_CHECKING(if setresgid seems to work)
824 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100825#include <stdlib.h>
826#include <errno.h>
827int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100828 ],
829 [AC_MSG_RESULT(yes)],
830 [AC_DEFINE(BROKEN_SETRESGID)
831 AC_MSG_RESULT(not implemented)]
832 )
833])
Darren Tuckere937be32003-12-17 18:53:26 +1100834
Damien Millerad833b32000-08-23 10:46:23 +1000835dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000836AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000837dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000838AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000839AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000840dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000841AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000842AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100843
Damien Millera8e06ce2003-11-21 23:48:55 +1100844AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100845 [AC_DEFINE(HAVE_DAEMON)],
846 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
847)
848
Damien Millera8e06ce2003-11-21 23:48:55 +1100849AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100850 [AC_DEFINE(HAVE_GETPAGESIZE)],
851 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
852)
853
Damien Millercb170cb2000-07-01 16:52:55 +1000854# Check for broken snprintf
855if test "x$ac_cv_func_snprintf" = "xyes" ; then
856 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
857 AC_TRY_RUN(
858 [
859#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700860int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000861 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100862 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000863 [
864 AC_MSG_RESULT(no)
865 AC_DEFINE(BROKEN_SNPRINTF)
866 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
867 ]
868 )
869fi
870
Damien Millere8328192003-01-07 15:18:32 +1100871dnl see whether mkstemp() requires XXXXXX
872if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
873AC_MSG_CHECKING([for (overly) strict mkstemp])
874AC_TRY_RUN(
875 [
876#include <stdlib.h>
877main() { char template[]="conftest.mkstemp-test";
878if (mkstemp(template) == -1)
879 exit(1);
880unlink(template); exit(0);
881}
882 ],
883 [
884 AC_MSG_RESULT(no)
885 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100886 [
Damien Millere8328192003-01-07 15:18:32 +1100887 AC_MSG_RESULT(yes)
888 AC_DEFINE(HAVE_STRICT_MKSTEMP)
889 ],
890 [
891 AC_MSG_RESULT(yes)
892 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100893 ]
Damien Millere8328192003-01-07 15:18:32 +1100894)
895fi
896
Darren Tucker70a3d552003-08-21 17:58:29 +1000897dnl make sure that openpty does not reacquire controlling terminal
898if test ! -z "$check_for_openpty_ctty_bug"; then
899 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
900 AC_TRY_RUN(
901 [
902#include <stdio.h>
903#include <sys/fcntl.h>
904#include <sys/types.h>
905#include <sys/wait.h>
906
907int
908main()
909{
910 pid_t pid;
911 int fd, ptyfd, ttyfd, status;
912
913 pid = fork();
914 if (pid < 0) { /* failed */
915 exit(1);
916 } else if (pid > 0) { /* parent */
917 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100918 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000919 exit(WEXITSTATUS(status));
920 else
921 exit(2);
922 } else { /* child */
923 close(0); close(1); close(2);
924 setsid();
925 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
926 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
927 if (fd >= 0)
928 exit(3); /* Acquired ctty: broken */
929 else
930 exit(0); /* Did not acquire ctty: OK */
931 }
932}
933 ],
934 [
935 AC_MSG_RESULT(yes)
936 ],
937 [
938 AC_MSG_RESULT(no)
939 AC_DEFINE(SSHD_ACQUIRES_CTTY)
940 ]
941 )
942fi
943
Damien Miller606f8802000-09-16 15:39:56 +1100944AC_FUNC_GETPGRP
945
Damien Millera64b57a2001-01-17 10:44:13 +1100946# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000947PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100948AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100949 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100950 [
Damien Millera64b57a2001-01-17 10:44:13 +1100951 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100952 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
953 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100954 AC_MSG_ERROR([PAM headers not found])
955 fi
956
957 AC_CHECK_LIB(dl, dlopen, , )
958 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
959 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000960 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100961
Damien Millera64b57a2001-01-17 10:44:13 +1100962 PAM_MSG="yes"
963
964 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800965 if test $ac_cv_lib_dl_dlopen = yes; then
966 LIBPAM="-lpam -ldl"
967 else
968 LIBPAM="-lpam"
969 fi
970 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100971 fi
972 ]
973)
Damien Millera22ba012000-03-02 23:09:20 +1100974
Damien Millera64b57a2001-01-17 10:44:13 +1100975# Check for older PAM
976if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100977 # Check PAM strerror arguments (old PAM)
978 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
979 AC_TRY_COMPILE(
980 [
Damien Miller81171112000-04-23 11:14:01 +1000981#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +1100982#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +1000983#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +1100984#elif defined (HAVE_PAM_PAM_APPL_H)
985#include <pam/pam_appl.h>
986#endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100987 ],
988 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +1100989 [AC_MSG_RESULT(no)],
990 [
991 AC_DEFINE(HAVE_OLD_PAM)
992 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000993 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100994 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100995 )
Damien Millera22ba012000-03-02 23:09:20 +1100996fi
997
Damien Millerfc93d4b2002-09-04 23:26:29 +1000998# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
999# because the system crypt() is more featureful.
1000if test "x$check_for_libcrypt_before" = "x1"; then
1001 AC_CHECK_LIB(crypt, crypt)
1002fi
1003
Tim Riceaef73712002-05-11 13:17:42 -07001004# Search for OpenSSL
1005saved_CPPFLAGS="$CPPFLAGS"
1006saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001007AC_ARG_WITH(ssl-dir,
1008 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1009 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001010 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001011 if test -d "$withval/lib"; then
1012 if test -n "${need_dash_r}"; then
1013 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1014 else
1015 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1016 fi
1017 else
1018 if test -n "${need_dash_r}"; then
1019 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1020 else
1021 LDFLAGS="-L${withval} ${LDFLAGS}"
1022 fi
1023 fi
1024 if test -d "$withval/include"; then
1025 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1026 else
1027 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1028 fi
Damien Millera22ba012000-03-02 23:09:20 +11001029 fi
1030 ]
1031)
Tim Riceaef73712002-05-11 13:17:42 -07001032LIBS="$LIBS -lcrypto"
1033AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001034 [
Tim Riceaef73712002-05-11 13:17:42 -07001035 dnl Check default openssl install dir
1036 if test -n "${need_dash_r}"; then
1037 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001038 else
Tim Riceaef73712002-05-11 13:17:42 -07001039 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001040 fi
Tim Riceaef73712002-05-11 13:17:42 -07001041 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1042 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1043 [
1044 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1045 ]
1046 )
1047 ]
1048)
1049
Tim Riced730b782002-08-13 18:52:10 -07001050# Determine OpenSSL header version
1051AC_MSG_CHECKING([OpenSSL header version])
1052AC_TRY_RUN(
1053 [
1054#include <stdio.h>
1055#include <string.h>
1056#include <openssl/opensslv.h>
1057#define DATA "conftest.sslincver"
1058int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001059 FILE *fd;
1060 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001061
Damien Millera8e06ce2003-11-21 23:48:55 +11001062 fd = fopen(DATA,"w");
1063 if(fd == NULL)
1064 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001065
1066 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1067 exit(1);
1068
1069 exit(0);
1070}
1071 ],
1072 [
1073 ssl_header_ver=`cat conftest.sslincver`
1074 AC_MSG_RESULT($ssl_header_ver)
1075 ],
1076 [
1077 AC_MSG_RESULT(not found)
1078 AC_MSG_ERROR(OpenSSL version header not found.)
1079 ]
1080)
1081
1082# Determine OpenSSL library version
1083AC_MSG_CHECKING([OpenSSL library version])
1084AC_TRY_RUN(
1085 [
1086#include <stdio.h>
1087#include <string.h>
1088#include <openssl/opensslv.h>
1089#include <openssl/crypto.h>
1090#define DATA "conftest.ssllibver"
1091int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001092 FILE *fd;
1093 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001094
Damien Millera8e06ce2003-11-21 23:48:55 +11001095 fd = fopen(DATA,"w");
1096 if(fd == NULL)
1097 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001098
1099 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1100 exit(1);
1101
1102 exit(0);
1103}
1104 ],
1105 [
1106 ssl_library_ver=`cat conftest.ssllibver`
1107 AC_MSG_RESULT($ssl_library_ver)
1108 ],
1109 [
1110 AC_MSG_RESULT(not found)
1111 AC_MSG_ERROR(OpenSSL library not found.)
1112 ]
1113)
Damien Millera22ba012000-03-02 23:09:20 +11001114
Damien Millerec932372002-01-22 22:16:03 +11001115# Sanity check OpenSSL headers
1116AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1117AC_TRY_RUN(
1118 [
1119#include <string.h>
1120#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001121int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001122 ],
1123 [
1124 AC_MSG_RESULT(yes)
1125 ],
1126 [
1127 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001128 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1129Check config.log for details.
1130Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001131 ]
1132)
1133
Damien Millera8e06ce2003-11-21 23:48:55 +11001134# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001135# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001136if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001137 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001138fi
1139
Damien Miller6c21c512002-01-22 21:57:53 +11001140
1141### Configure cryptographic random number support
1142
1143# Check wheter OpenSSL seeds itself
1144AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1145AC_TRY_RUN(
1146 [
1147#include <string.h>
1148#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001149int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001150 ],
1151 [
1152 OPENSSL_SEEDS_ITSELF=yes
1153 AC_MSG_RESULT(yes)
1154 ],
1155 [
1156 AC_MSG_RESULT(no)
1157 # Default to use of the rand helper if OpenSSL doesn't
1158 # seed itself
1159 USE_RAND_HELPER=yes
1160 ]
1161)
1162
1163
1164# Do we want to force the use of the rand helper?
1165AC_ARG_WITH(rand-helper,
1166 [ --with-rand-helper Use subprocess to gather strong randomness ],
1167 [
1168 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001169 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001170 # the previous test showed it to be unseeded.
1171 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1172 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1173 OPENSSL_SEEDS_ITSELF=yes
1174 USE_RAND_HELPER=""
1175 fi
1176 else
1177 USE_RAND_HELPER=yes
1178 fi
1179 ],
1180)
1181
1182# Which randomness source do we use?
1183if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1184 # OpenSSL only
1185 AC_DEFINE(OPENSSL_PRNG_ONLY)
1186 RAND_MSG="OpenSSL internal ONLY"
1187 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001188elif test ! -z "$USE_RAND_HELPER" ; then
1189 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001190 RAND_MSG="ssh-rand-helper"
1191 INSTALL_SSH_RAND_HELPER="yes"
1192fi
1193AC_SUBST(INSTALL_SSH_RAND_HELPER)
1194
1195### Configuration of ssh-rand-helper
1196
1197# PRNGD TCP socket
1198AC_ARG_WITH(prngd-port,
1199 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1200 [
Damien Millere996d722002-01-23 11:20:59 +11001201 case "$withval" in
1202 no)
1203 withval=""
1204 ;;
1205 [[0-9]]*)
1206 ;;
1207 *)
1208 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1209 ;;
1210 esac
1211 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001212 PRNGD_PORT="$withval"
1213 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1214 fi
1215 ]
1216)
1217
1218# PRNGD Unix domain socket
1219AC_ARG_WITH(prngd-socket,
1220 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1221 [
Damien Millere996d722002-01-23 11:20:59 +11001222 case "$withval" in
1223 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001224 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001225 ;;
1226 no)
1227 withval=""
1228 ;;
1229 /*)
1230 ;;
1231 *)
1232 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1233 ;;
1234 esac
1235
1236 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001237 if test ! -z "$PRNGD_PORT" ; then
1238 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1239 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001240 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001241 AC_MSG_WARN(Entropy socket is not readable)
1242 fi
1243 PRNGD_SOCKET="$withval"
1244 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1245 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001246 ],
1247 [
1248 # Check for existing socket only if we don't have a random device already
1249 if test "$USE_RAND_HELPER" = yes ; then
1250 AC_MSG_CHECKING(for PRNGD/EGD socket)
1251 # Insert other locations here
1252 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1253 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1254 PRNGD_SOCKET="$sock"
1255 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1256 break;
1257 fi
1258 done
1259 if test ! -z "$PRNGD_SOCKET" ; then
1260 AC_MSG_RESULT($PRNGD_SOCKET)
1261 else
1262 AC_MSG_RESULT(not found)
1263 fi
1264 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001265 ]
1266)
1267
1268# Change default command timeout for hashing entropy source
1269entropy_timeout=200
1270AC_ARG_WITH(entropy-timeout,
1271 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1272 [
1273 if test "x$withval" != "xno" ; then
1274 entropy_timeout=$withval
1275 fi
1276 ]
1277)
Damien Miller6c21c512002-01-22 21:57:53 +11001278AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1279
Damien Millerd3f6ad22002-06-25 10:24:47 +10001280SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001281AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001282 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001283 [
1284 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001285 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001286 fi
1287 ]
1288)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001289AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1290AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001291
Tim Rice88f2ab52002-03-17 12:17:34 -08001292# We do this little dance with the search path to insure
1293# that programs that we select for use by installed programs
1294# (which may be run by the super-user) come from trusted
1295# locations before they come from the user's private area.
1296# This should help avoid accidentally configuring some
1297# random version of a program in someone's personal bin.
1298
1299OPATH=$PATH
1300PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001301test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001302test -d /sbin && PATH=$PATH:/sbin
1303test -d /usr/sbin && PATH=$PATH:/usr/sbin
1304PATH=$PATH:/etc:$OPATH
1305
Damien Millera8e06ce2003-11-21 23:48:55 +11001306# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001307OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1308OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1309OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1310OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1311OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1312OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1313OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1314OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1315OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1316OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1317OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1318OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1319OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1320OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1321OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1322OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001323# restore PATH
1324PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001325
1326# Where does ssh-rand-helper get its randomness from?
1327INSTALL_SSH_PRNG_CMDS=""
1328if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1329 if test ! -z "$PRNGD_PORT" ; then
1330 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1331 elif test ! -z "$PRNGD_SOCKET" ; then
1332 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1333 else
1334 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1335 RAND_HELPER_CMDHASH=yes
1336 INSTALL_SSH_PRNG_CMDS="yes"
1337 fi
1338fi
1339AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1340
1341
Ben Lindstromb5628642000-10-18 00:02:25 +00001342# Cheap hack to ensure NEWS-OS libraries are arranged right.
1343if test ! -z "$SONY" ; then
1344 LIBS="$LIBS -liberty";
1345fi
1346
Damien Millera22ba012000-03-02 23:09:20 +11001347# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001348AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001349AC_CHECK_SIZEOF(short int, 2)
1350AC_CHECK_SIZEOF(int, 4)
1351AC_CHECK_SIZEOF(long int, 4)
1352AC_CHECK_SIZEOF(long long int, 8)
1353
Damien Millerfa2bb692002-04-23 23:22:25 +10001354# Sanity check long long for some platforms (AIX)
1355if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1356 ac_cv_sizeof_long_long_int=0
1357fi
1358
Damien Millera22ba012000-03-02 23:09:20 +11001359# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001360AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1361 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001362 [ #include <sys/types.h> ],
1363 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001364 [ ac_cv_have_u_int="yes" ],
1365 [ ac_cv_have_u_int="no" ]
1366 )
1367])
1368if test "x$ac_cv_have_u_int" = "xyes" ; then
1369 AC_DEFINE(HAVE_U_INT)
1370 have_u_int=1
1371fi
1372
Damien Miller61e50f12000-05-08 20:49:37 +10001373AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1374 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001375 [ #include <sys/types.h> ],
1376 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001377 [ ac_cv_have_intxx_t="yes" ],
1378 [ ac_cv_have_intxx_t="no" ]
1379 )
1380])
1381if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1382 AC_DEFINE(HAVE_INTXX_T)
1383 have_intxx_t=1
1384fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001385
1386if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001387 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001388then
1389 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1390 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001391 [ #include <stdint.h> ],
1392 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001393 [
1394 AC_DEFINE(HAVE_INTXX_T)
1395 AC_MSG_RESULT(yes)
1396 ],
1397 [ AC_MSG_RESULT(no) ]
1398 )
1399fi
1400
Damien Miller578783e2000-09-23 14:12:24 +11001401AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1402 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001403 [
1404#include <sys/types.h>
1405#ifdef HAVE_STDINT_H
1406# include <stdint.h>
1407#endif
1408#include <sys/socket.h>
1409#ifdef HAVE_SYS_BITYPES_H
1410# include <sys/bitypes.h>
1411#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001412 ],
1413 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001414 [ ac_cv_have_int64_t="yes" ],
1415 [ ac_cv_have_int64_t="no" ]
1416 )
1417])
1418if test "x$ac_cv_have_int64_t" = "xyes" ; then
1419 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001420fi
1421
Damien Miller61e50f12000-05-08 20:49:37 +10001422AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1423 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001424 [ #include <sys/types.h> ],
1425 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001426 [ ac_cv_have_u_intxx_t="yes" ],
1427 [ ac_cv_have_u_intxx_t="no" ]
1428 )
1429])
1430if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1431 AC_DEFINE(HAVE_U_INTXX_T)
1432 have_u_intxx_t=1
1433fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001434
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001435if test -z "$have_u_intxx_t" ; then
1436 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1437 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001438 [ #include <sys/socket.h> ],
1439 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001440 [
1441 AC_DEFINE(HAVE_U_INTXX_T)
1442 AC_MSG_RESULT(yes)
1443 ],
1444 [ AC_MSG_RESULT(no) ]
1445 )
1446fi
1447
Damien Miller578783e2000-09-23 14:12:24 +11001448AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1449 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001450 [ #include <sys/types.h> ],
1451 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001452 [ ac_cv_have_u_int64_t="yes" ],
1453 [ ac_cv_have_u_int64_t="no" ]
1454 )
1455])
1456if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1457 AC_DEFINE(HAVE_U_INT64_T)
1458 have_u_int64_t=1
1459fi
1460
Tim Rice4cec93f2002-02-26 08:40:48 -08001461if test -z "$have_u_int64_t" ; then
1462 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1463 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001464 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001465 [ u_int64_t a; a = 1],
1466 [
1467 AC_DEFINE(HAVE_U_INT64_T)
1468 AC_MSG_RESULT(yes)
1469 ],
1470 [ AC_MSG_RESULT(no) ]
1471 )
1472fi
1473
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001474if test -z "$have_u_intxx_t" ; then
1475 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1476 AC_TRY_COMPILE(
1477 [
1478#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001479 ],
1480 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001481 [ ac_cv_have_uintxx_t="yes" ],
1482 [ ac_cv_have_uintxx_t="no" ]
1483 )
1484 ])
1485 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1486 AC_DEFINE(HAVE_UINTXX_T)
1487 fi
1488fi
1489
1490if test -z "$have_uintxx_t" ; then
1491 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1492 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001493 [ #include <stdint.h> ],
1494 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001495 [
1496 AC_DEFINE(HAVE_UINTXX_T)
1497 AC_MSG_RESULT(yes)
1498 ],
1499 [ AC_MSG_RESULT(no) ]
1500 )
1501fi
1502
Damien Milleredb82922000-06-20 13:25:52 +10001503if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001504 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001505then
1506 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1507 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001508 [
1509#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001510 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001511 [
Damien Miller70494d12000-04-03 15:57:06 +10001512 int8_t a; int16_t b; int32_t c;
1513 u_int8_t e; u_int16_t f; u_int32_t g;
1514 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001515 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001516 [
1517 AC_DEFINE(HAVE_U_INTXX_T)
1518 AC_DEFINE(HAVE_INTXX_T)
1519 AC_MSG_RESULT(yes)
1520 ],
1521 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001522 )
Damien Millerb29ea912000-01-15 14:12:03 +11001523fi
1524
Damien Miller58be7382001-09-15 21:31:54 +10001525
1526AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1527 AC_TRY_COMPILE(
1528 [
1529#include <sys/types.h>
1530 ],
1531 [ u_char foo; foo = 125; ],
1532 [ ac_cv_have_u_char="yes" ],
1533 [ ac_cv_have_u_char="no" ]
1534 )
1535])
1536if test "x$ac_cv_have_u_char" = "xyes" ; then
1537 AC_DEFINE(HAVE_U_CHAR)
1538fi
1539
Tim Rice13aae5e2001-10-21 17:53:58 -07001540TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001541
Tim Rice200a5c02002-02-26 22:12:34 -08001542AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001543
Damien Miller61e50f12000-05-08 20:49:37 +10001544AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1545 AC_TRY_COMPILE(
1546 [
1547#include <sys/types.h>
1548 ],
1549 [ size_t foo; foo = 1235; ],
1550 [ ac_cv_have_size_t="yes" ],
1551 [ ac_cv_have_size_t="no" ]
1552 )
1553])
1554if test "x$ac_cv_have_size_t" = "xyes" ; then
1555 AC_DEFINE(HAVE_SIZE_T)
1556fi
Damien Miller95058511999-12-29 10:36:45 +11001557
Damien Miller615f9392000-05-17 22:53:33 +10001558AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1559 AC_TRY_COMPILE(
1560 [
1561#include <sys/types.h>
1562 ],
1563 [ ssize_t foo; foo = 1235; ],
1564 [ ac_cv_have_ssize_t="yes" ],
1565 [ ac_cv_have_ssize_t="no" ]
1566 )
1567])
1568if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1569 AC_DEFINE(HAVE_SSIZE_T)
1570fi
1571
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001572AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1573 AC_TRY_COMPILE(
1574 [
1575#include <time.h>
1576 ],
1577 [ clock_t foo; foo = 1235; ],
1578 [ ac_cv_have_clock_t="yes" ],
1579 [ ac_cv_have_clock_t="no" ]
1580 )
1581])
1582if test "x$ac_cv_have_clock_t" = "xyes" ; then
1583 AC_DEFINE(HAVE_CLOCK_T)
1584fi
1585
Damien Millerb54b40e2000-06-23 08:23:34 +10001586AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1587 AC_TRY_COMPILE(
1588 [
1589#include <sys/types.h>
1590#include <sys/socket.h>
1591 ],
1592 [ sa_family_t foo; foo = 1235; ],
1593 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001594 [ AC_TRY_COMPILE(
1595 [
1596#include <sys/types.h>
1597#include <sys/socket.h>
1598#include <netinet/in.h>
1599 ],
1600 [ sa_family_t foo; foo = 1235; ],
1601 [ ac_cv_have_sa_family_t="yes" ],
1602
Damien Millerb54b40e2000-06-23 08:23:34 +10001603 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001604 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001605 )
1606])
1607if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1608 AC_DEFINE(HAVE_SA_FAMILY_T)
1609fi
1610
Damien Miller0f91b4e2000-06-18 15:43:25 +10001611AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1612 AC_TRY_COMPILE(
1613 [
1614#include <sys/types.h>
1615 ],
1616 [ pid_t foo; foo = 1235; ],
1617 [ ac_cv_have_pid_t="yes" ],
1618 [ ac_cv_have_pid_t="no" ]
1619 )
1620])
1621if test "x$ac_cv_have_pid_t" = "xyes" ; then
1622 AC_DEFINE(HAVE_PID_T)
1623fi
1624
1625AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1626 AC_TRY_COMPILE(
1627 [
1628#include <sys/types.h>
1629 ],
1630 [ mode_t foo; foo = 1235; ],
1631 [ ac_cv_have_mode_t="yes" ],
1632 [ ac_cv_have_mode_t="no" ]
1633 )
1634])
1635if test "x$ac_cv_have_mode_t" = "xyes" ; then
1636 AC_DEFINE(HAVE_MODE_T)
1637fi
1638
Damien Miller61e50f12000-05-08 20:49:37 +10001639
1640AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1641 AC_TRY_COMPILE(
1642 [
Damien Miller81171112000-04-23 11:14:01 +10001643#include <sys/types.h>
1644#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001645 ],
1646 [ struct sockaddr_storage s; ],
1647 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1648 [ ac_cv_have_struct_sockaddr_storage="no" ]
1649 )
1650])
1651if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1652 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1653fi
Damien Miller34132e52000-01-14 15:45:46 +11001654
Damien Miller61e50f12000-05-08 20:49:37 +10001655AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1656 AC_TRY_COMPILE(
1657 [
Damien Miller7b22d652000-06-18 14:07:04 +10001658#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001659#include <netinet/in.h>
1660 ],
1661 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1662 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1663 [ ac_cv_have_struct_sockaddr_in6="no" ]
1664 )
1665])
1666if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1667 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1668fi
Damien Miller34132e52000-01-14 15:45:46 +11001669
Damien Miller61e50f12000-05-08 20:49:37 +10001670AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1671 AC_TRY_COMPILE(
1672 [
Damien Miller7b22d652000-06-18 14:07:04 +10001673#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001674#include <netinet/in.h>
1675 ],
1676 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1677 [ ac_cv_have_struct_in6_addr="yes" ],
1678 [ ac_cv_have_struct_in6_addr="no" ]
1679 )
1680])
1681if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1682 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1683fi
Damien Miller34132e52000-01-14 15:45:46 +11001684
Damien Miller61e50f12000-05-08 20:49:37 +10001685AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1686 AC_TRY_COMPILE(
1687 [
Damien Miller81171112000-04-23 11:14:01 +10001688#include <sys/types.h>
1689#include <sys/socket.h>
1690#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001691 ],
1692 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1693 [ ac_cv_have_struct_addrinfo="yes" ],
1694 [ ac_cv_have_struct_addrinfo="no" ]
1695 )
1696])
1697if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1698 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1699fi
1700
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001701AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1702 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001703 [ #include <sys/time.h> ],
1704 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001705 [ ac_cv_have_struct_timeval="yes" ],
1706 [ ac_cv_have_struct_timeval="no" ]
1707 )
1708])
1709if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1710 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1711 have_struct_timeval=1
1712fi
1713
Tim Rice4e4dc562003-03-18 10:21:40 -08001714AC_CHECK_TYPES(struct timespec)
1715
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001716# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001717if test "x$ac_cv_have_int64_t" = "xno" -a \
1718 "x$ac_cv_sizeof_long_int" != "x8" -a \
1719 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001720 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1721 echo "an alternative compiler (I.E., GCC) before continuing."
1722 echo ""
1723 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001724else
1725dnl test snprintf (broken on SCO w/gcc)
1726 AC_TRY_RUN(
1727 [
1728#include <stdio.h>
1729#include <string.h>
1730#ifdef HAVE_SNPRINTF
1731main()
1732{
1733 char buf[50];
1734 char expected_out[50];
1735 int mazsize = 50 ;
1736#if (SIZEOF_LONG_INT == 8)
1737 long int num = 0x7fffffffffffffff;
1738#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001739 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001740#endif
1741 strcpy(expected_out, "9223372036854775807");
1742 snprintf(buf, mazsize, "%lld", num);
1743 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001744 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001745 exit(0);
1746}
1747#else
1748main() { exit(0); }
1749#endif
1750 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1751 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001752fi
1753
Damien Miller78315eb2000-09-29 23:01:36 +11001754dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001755OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1756OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1757OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1758OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1759OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001760OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001761OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1762OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001763OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001764OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1765OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1766OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1767OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001768OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1769OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1770OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1771OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001772
1773AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001774
Damien Miller61e50f12000-05-08 20:49:37 +10001775AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1776 ac_cv_have_ss_family_in_struct_ss, [
1777 AC_TRY_COMPILE(
1778 [
Damien Miller81171112000-04-23 11:14:01 +10001779#include <sys/types.h>
1780#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001781 ],
1782 [ struct sockaddr_storage s; s.ss_family = 1; ],
1783 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1784 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1785 )
1786])
1787if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1788 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1789fi
1790
Damien Miller61e50f12000-05-08 20:49:37 +10001791AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1792 ac_cv_have___ss_family_in_struct_ss, [
1793 AC_TRY_COMPILE(
1794 [
Damien Miller81171112000-04-23 11:14:01 +10001795#include <sys/types.h>
1796#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001797 ],
1798 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1799 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1800 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1801 )
1802])
1803if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1804 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1805fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001806
Damien Millerad833b32000-08-23 10:46:23 +10001807AC_CACHE_CHECK([for pw_class field in struct passwd],
1808 ac_cv_have_pw_class_in_struct_passwd, [
1809 AC_TRY_COMPILE(
1810 [
Damien Millerad833b32000-08-23 10:46:23 +10001811#include <pwd.h>
1812 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001813 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001814 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1815 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1816 )
1817])
1818if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1819 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1820fi
1821
Kevin Steves82456952001-06-22 21:14:18 +00001822AC_CACHE_CHECK([for pw_expire field in struct passwd],
1823 ac_cv_have_pw_expire_in_struct_passwd, [
1824 AC_TRY_COMPILE(
1825 [
1826#include <pwd.h>
1827 ],
1828 [ struct passwd p; p.pw_expire = 0; ],
1829 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1830 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1831 )
1832])
1833if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1834 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1835fi
1836
1837AC_CACHE_CHECK([for pw_change field in struct passwd],
1838 ac_cv_have_pw_change_in_struct_passwd, [
1839 AC_TRY_COMPILE(
1840 [
1841#include <pwd.h>
1842 ],
1843 [ struct passwd p; p.pw_change = 0; ],
1844 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1845 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1846 )
1847])
1848if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1849 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1850fi
Damien Miller61e50f12000-05-08 20:49:37 +10001851
Tim Rice28bbb0c2002-05-27 17:37:32 -07001852dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001853AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1854 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001855 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001856 [
Tim Riceae49fe62002-04-12 10:26:21 -07001857#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001858#include <sys/socket.h>
1859#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001860int main() {
1861#ifdef msg_accrights
1862exit(1);
1863#endif
1864struct msghdr m;
1865m.msg_accrights = 0;
1866exit(0);
1867}
Kevin Steves939c9db2002-03-22 17:23:25 +00001868 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001869 [ ac_cv_have_accrights_in_msghdr="yes" ],
1870 [ ac_cv_have_accrights_in_msghdr="no" ]
1871 )
1872])
1873if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1874 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1875fi
1876
Kevin Stevesa44e0352002-04-07 16:18:03 +00001877AC_CACHE_CHECK([for msg_control field in struct msghdr],
1878 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001879 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001880 [
Tim Riceae49fe62002-04-12 10:26:21 -07001881#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001882#include <sys/socket.h>
1883#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001884int main() {
1885#ifdef msg_control
1886exit(1);
1887#endif
1888struct msghdr m;
1889m.msg_control = 0;
1890exit(0);
1891}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001892 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001893 [ ac_cv_have_control_in_msghdr="yes" ],
1894 [ ac_cv_have_control_in_msghdr="no" ]
1895 )
1896])
1897if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1898 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1899fi
1900
Damien Miller61e50f12000-05-08 20:49:37 +10001901AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001902 AC_TRY_LINK([],
1903 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001904 [ ac_cv_libc_defines___progname="yes" ],
1905 [ ac_cv_libc_defines___progname="no" ]
1906 )
1907])
1908if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1909 AC_DEFINE(HAVE___PROGNAME)
1910fi
1911
Kevin Steves4846f4a2002-03-22 18:19:53 +00001912AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1913 AC_TRY_LINK([
1914#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001915],
1916 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001917 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1918 [ ac_cv_cc_implements___FUNCTION__="no" ]
1919 )
1920])
1921if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1922 AC_DEFINE(HAVE___FUNCTION__)
1923fi
1924
1925AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1926 AC_TRY_LINK([
1927#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001928],
1929 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001930 [ ac_cv_cc_implements___func__="yes" ],
1931 [ ac_cv_cc_implements___func__="no" ]
1932 )
1933])
1934if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1935 AC_DEFINE(HAVE___func__)
1936fi
1937
Damien Miller4f8e6692001-07-14 13:22:53 +10001938AC_CACHE_CHECK([whether getopt has optreset support],
1939 ac_cv_have_getopt_optreset, [
1940 AC_TRY_LINK(
1941 [
1942#include <getopt.h>
1943 ],
1944 [ extern int optreset; optreset = 0; ],
1945 [ ac_cv_have_getopt_optreset="yes" ],
1946 [ ac_cv_have_getopt_optreset="no" ]
1947 )
1948])
1949if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1950 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1951fi
Damien Millera22ba012000-03-02 23:09:20 +11001952
Damien Millerecbb26d2000-07-15 14:59:14 +10001953AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001954 AC_TRY_LINK([],
1955 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001956 [ ac_cv_libc_defines_sys_errlist="yes" ],
1957 [ ac_cv_libc_defines_sys_errlist="no" ]
1958 )
1959])
1960if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1961 AC_DEFINE(HAVE_SYS_ERRLIST)
1962fi
1963
1964
Damien Miller11fa2cc2000-08-16 10:35:58 +10001965AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001966 AC_TRY_LINK([],
1967 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001968 [ ac_cv_libc_defines_sys_nerr="yes" ],
1969 [ ac_cv_libc_defines_sys_nerr="no" ]
1970 )
1971])
1972if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1973 AC_DEFINE(HAVE_SYS_NERR)
1974fi
1975
Damien Millera8e06ce2003-11-21 23:48:55 +11001976SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001977# Check whether user wants sectok support
1978AC_ARG_WITH(sectok,
1979 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001980 [
1981 if test "x$withval" != "xno" ; then
1982 if test "x$withval" != "xyes" ; then
1983 CPPFLAGS="$CPPFLAGS -I${withval}"
1984 LDFLAGS="$LDFLAGS -L${withval}"
1985 if test ! -z "$need_dash_r" ; then
1986 LDFLAGS="$LDFLAGS -R${withval}"
1987 fi
1988 if test ! -z "$blibpath" ; then
1989 blibpath="$blibpath:${withval}"
1990 fi
1991 fi
1992 AC_CHECK_HEADERS(sectok.h)
1993 if test "$ac_cv_header_sectok_h" != yes; then
1994 AC_MSG_ERROR(Can't find sectok.h)
1995 fi
1996 AC_CHECK_LIB(sectok, sectok_open)
1997 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1998 AC_MSG_ERROR(Can't find libsectok)
1999 fi
2000 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002001 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002002 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002003 fi
2004 ]
2005)
2006
2007# Check whether user wants OpenSC support
2008AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002009 AC_HELP_STRING([--with-opensc=PFX],
2010 [Enable smartcard support using OpenSC]),
2011 opensc_config_prefix="$withval", opensc_config_prefix="")
2012if test x$opensc_config_prefix != x ; then
2013 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2014 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2015 if test "$OPENSC_CONFIG" != "no"; then
2016 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2017 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2018 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2019 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2020 AC_DEFINE(SMARTCARD)
2021 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002022 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002023 fi
2024fi
Damien Miller85de5802001-09-18 14:01:11 +10002025
Darren Tucker5f88d342003-10-15 16:57:57 +10002026# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002027AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002028 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002029 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002030 # Needed by our getrrsetbyname()
2031 AC_SEARCH_LIBS(res_query, resolv)
2032 AC_SEARCH_LIBS(dn_expand, resolv)
2033 AC_CHECK_FUNCS(_getshort _getlong)
2034 AC_CHECK_MEMBER(HEADER.ad,
2035 [AC_DEFINE(HAVE_HEADER_AD)],,
2036 [#include <arpa/nameser.h>])
2037 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002038
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002039# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002040KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002041AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002042 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002043 [ if test "x$withval" != "xno" ; then
2044 if test "x$withval" = "xyes" ; then
2045 KRB5ROOT="/usr/local"
2046 else
2047 KRB5ROOT=${withval}
2048 fi
2049
2050 AC_DEFINE(KRB5)
2051 KRB5_MSG="yes"
2052
2053 AC_MSG_CHECKING(for krb5-config)
2054 if test -x $KRB5ROOT/bin/krb5-config ; then
2055 KRB5CONF=$KRB5ROOT/bin/krb5-config
2056 AC_MSG_RESULT($KRB5CONF)
2057
2058 AC_MSG_CHECKING(for gssapi support)
2059 if $KRB5CONF | grep gssapi >/dev/null ; then
2060 AC_MSG_RESULT(yes)
2061 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
2062 dnl m4 quadragraphs: "sed 's/-l[^- ]*//g'"
2063 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
2064 K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002065 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002066 AC_MSG_RESULT(no)
2067 K5CFLAGS="`$KRB5CONF --cflags`"
2068 K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
2069 K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002070 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002071 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2072 LDFLAGS="$LDFLAGS $K5LDFLAGS"
2073 AC_MSG_CHECKING(whether we are using Heimdal)
2074 AC_TRY_COMPILE([ #include <krb5.h> ],
2075 [ char *tmp = heimdal_version; ],
2076 [ AC_MSG_RESULT(yes)
2077 AC_DEFINE(HEIMDAL) ],
2078 AC_MSG_RESULT(no)
2079 )
2080 else
2081 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002082 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002083 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002084 AC_MSG_CHECKING(whether we are using Heimdal)
2085 AC_TRY_COMPILE([ #include <krb5.h> ],
2086 [ char *tmp = heimdal_version; ],
2087 [ AC_MSG_RESULT(yes)
2088 AC_DEFINE(HEIMDAL)
2089 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2090 ],
2091 [ AC_MSG_RESULT(no)
2092 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2093 ]
2094 )
Damien Miller200d0a72003-06-30 19:21:36 +10002095 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002096
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002097 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2098 [ AC_DEFINE(GSSAPI)
2099 K5LIBS="-lgssapi $K5LIBS" ],
2100 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2101 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002102 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002103 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2104 $K5LIBS)
2105 ],
2106 $K5LIBS)
2107
2108 AC_CHECK_HEADER(gssapi.h, ,
2109 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002110 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002111 AC_CHECK_HEADERS(gssapi.h, ,
2112 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002113 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002114 ]
2115 )
2116
2117 oldCPP="$CPPFLAGS"
2118 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2119 AC_CHECK_HEADER(gssapi_krb5.h, ,
2120 [ CPPFLAGS="$oldCPP" ])
2121
Damien Millera8e06ce2003-11-21 23:48:55 +11002122 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002123 if test ! -z "$need_dash_r" ; then
2124 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2125 fi
2126 if test ! -z "$blibpath" ; then
2127 blibpath="$blibpath:${KRB5ROOT}/lib"
2128 fi
2129 fi ]
2130 AC_SEARCH_LIBS(k_hasafs, kafs,
2131 [ AC_DEFINE(AFS)
2132 K5LIBS="-lkafs $K5LIBS"
2133 ]
2134 )
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002135)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002136LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002137
Damien Millera22ba012000-03-02 23:09:20 +11002138# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002139
Damien Millerf58c6722002-05-13 13:15:42 +10002140PRIVSEP_PATH=/var/empty
2141AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002142 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002143 [
2144 if test "x$withval" != "$no" ; then
2145 PRIVSEP_PATH=$withval
2146 fi
2147 ]
2148)
2149AC_SUBST(PRIVSEP_PATH)
2150
Damien Millera22ba012000-03-02 23:09:20 +11002151AC_ARG_WITH(xauth,
2152 [ --with-xauth=PATH Specify path to xauth program ],
2153 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002154 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002155 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002156 fi
2157 ],
2158 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002159 TestPath="$PATH"
2160 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2161 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2162 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2163 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2164 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002165 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002166 xauth_path="/usr/openwin/bin/xauth"
2167 fi
2168 ]
2169)
2170
Damien Miller7d901272003-01-13 16:55:22 +11002171STRIP_OPT=-s
2172AC_ARG_ENABLE(strip,
2173 [ --disable-strip Disable calling strip(1) on install],
2174 [
2175 if test "x$enableval" = "xno" ; then
2176 STRIP_OPT=
2177 fi
2178 ]
2179)
2180AC_SUBST(STRIP_OPT)
2181
Damien Millera19cf472000-11-29 13:28:50 +11002182if test -z "$xauth_path" ; then
2183 XAUTH_PATH="undefined"
2184 AC_SUBST(XAUTH_PATH)
2185else
Damien Millera22ba012000-03-02 23:09:20 +11002186 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002187 XAUTH_PATH=$xauth_path
2188 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002189fi
Damien Millera22ba012000-03-02 23:09:20 +11002190
2191# Check for mail directory (last resort if we cannot get it from headers)
2192if test ! -z "$MAIL" ; then
2193 maildir=`dirname $MAIL`
2194 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2195fi
2196
Damien Millera22ba012000-03-02 23:09:20 +11002197if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002198 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002199 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002200 [
2201 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2202 have_dev_ptmx=1
2203 ]
2204 )
2205 fi
Damien Millera22ba012000-03-02 23:09:20 +11002206fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002207AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002208 [
2209 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2210 have_dev_ptc=1
2211 ]
2212)
2213
Damien Millera22ba012000-03-02 23:09:20 +11002214# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002215AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002216 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002217 [
Damien Miller897741e2001-04-16 10:41:46 +10002218 case "$withval" in
2219 man|cat|doc)
2220 MANTYPE=$withval
2221 ;;
2222 *)
2223 AC_MSG_ERROR(invalid man type: $withval)
2224 ;;
2225 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002226 ]
2227)
Ben Lindstrombc709922001-04-18 18:04:21 +00002228if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002229 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2230 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002231 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2232 MANTYPE=doc
2233 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2234 MANTYPE=man
2235 else
2236 MANTYPE=cat
2237 fi
2238fi
Damien Miller670a4b82000-01-22 13:53:11 +11002239AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002240if test "$MANTYPE" = "doc"; then
2241 mansubdir=man;
2242else
2243 mansubdir=$MANTYPE;
2244fi
2245AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002246
Damien Millera22ba012000-03-02 23:09:20 +11002247# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002248MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002249AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002250 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002251 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002252 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002253 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002254 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002255 fi
2256 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002257)
2258
Damien Millera22ba012000-03-02 23:09:20 +11002259# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002260AC_ARG_WITH(shadow,
2261 [ --without-shadow Disable shadow password support],
2262 [
2263 if test "x$withval" = "xno" ; then
2264 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002265 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002266 fi
2267 ]
2268)
2269
Damien Miller1f335fb2000-06-26 11:31:33 +10002270if test -z "$disable_shadow" ; then
2271 AC_MSG_CHECKING([if the systems has expire shadow information])
2272 AC_TRY_COMPILE(
2273 [
2274#include <sys/types.h>
2275#include <shadow.h>
2276 struct spwd sp;
2277 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2278 [ sp_expire_available=yes ], []
2279 )
2280
2281 if test "x$sp_expire_available" = "xyes" ; then
2282 AC_MSG_RESULT(yes)
2283 AC_DEFINE(HAS_SHADOW_EXPIRE)
2284 else
2285 AC_MSG_RESULT(no)
2286 fi
2287fi
2288
Damien Millera22ba012000-03-02 23:09:20 +11002289# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002290if test ! -z "$IPADDR_IN_DISPLAY" ; then
2291 DISPLAY_HACK_MSG="yes"
2292 AC_DEFINE(IPADDR_IN_DISPLAY)
2293else
Damien Millera8e06ce2003-11-21 23:48:55 +11002294 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002295 AC_ARG_WITH(ipaddr-display,
2296 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2297 [
2298 if test "x$withval" != "xno" ; then
2299 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002300 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002301 fi
2302 ]
2303 )
2304fi
Damien Miller76112de1999-12-21 11:18:08 +11002305
Darren Tuckere1a790d2003-09-16 11:52:19 +10002306# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002307AC_ARG_ENABLE(etc-default-login,
2308 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2309[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002310AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2311
2312if test "x$external_path_file" = "x/etc/default/login"; then
2313 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2314fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002315])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002316
Tim Rice43a1c132002-04-17 21:19:14 -07002317dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2318if test $ac_cv_func_login_getcapbool = "yes" -a \
2319 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002320 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002321fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002322
Damien Millera22ba012000-03-02 23:09:20 +11002323# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002324SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002325AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002326 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002327 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002328 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002329 AC_MSG_WARN([
2330--with-default-path=PATH has no effect on this system.
2331Edit /etc/login.conf instead.])
2332 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002333 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002334 AC_MSG_WARN([
2335--with-default-path=PATH will only be used if PATH is not defined in
2336$external_path_file .])
2337 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002338 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002339 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002340 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002341 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002342 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2343 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002344 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002345 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002346 AC_MSG_WARN([
2347If PATH is defined in $external_path_file, ensure the path to scp is included,
2348otherwise scp will not work.])
2349 fi
2350 AC_TRY_RUN(
2351 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002352/* find out what STDPATH is */
2353#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002354#ifdef HAVE_PATHS_H
2355# include <paths.h>
2356#endif
2357#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002358# ifdef _PATH_USERPATH /* Irix */
2359# define _PATH_STDPATH _PATH_USERPATH
2360# else
2361# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2362# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002363#endif
2364#include <sys/types.h>
2365#include <sys/stat.h>
2366#include <fcntl.h>
2367#define DATA "conftest.stdpath"
2368
2369main()
2370{
2371 FILE *fd;
2372 int rc;
2373
2374 fd = fopen(DATA,"w");
2375 if(fd == NULL)
2376 exit(1);
2377
2378 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2379 exit(1);
2380
2381 exit(0);
2382}
2383 ], [ user_path=`cat conftest.stdpath` ],
2384 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2385 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2386 )
2387# make sure $bindir is in USER_PATH so scp will work
2388 t_bindir=`eval echo ${bindir}`
2389 case $t_bindir in
2390 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2391 esac
2392 case $t_bindir in
2393 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2394 esac
2395 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2396 if test $? -ne 0 ; then
2397 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2398 if test $? -ne 0 ; then
2399 user_path=$user_path:$t_bindir
2400 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2401 fi
2402 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002403 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002404)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002405if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002406 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2407 AC_SUBST(user_path)
2408fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002409
Damien Millera18bbd32002-05-13 10:48:57 +10002410# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002411AC_ARG_WITH(superuser-path,
2412 [ --with-superuser-path= Specify different path for super-user],
2413 [
2414 if test "x$withval" != "xno" ; then
2415 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2416 superuser_path=$withval
2417 fi
2418 ]
2419)
2420
2421
Damien Miller61e50f12000-05-08 20:49:37 +10002422AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002423IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002424AC_ARG_WITH(4in6,
2425 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2426 [
2427 if test "x$withval" != "xno" ; then
2428 AC_MSG_RESULT(yes)
2429 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002430 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002431 else
2432 AC_MSG_RESULT(no)
2433 fi
2434 ],[
2435 if test "x$inet6_default_4in6" = "xyes"; then
2436 AC_MSG_RESULT([yes (default)])
2437 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002438 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002439 else
2440 AC_MSG_RESULT([no (default)])
2441 fi
2442 ]
2443)
2444
Damien Miller60396b02001-02-18 17:01:00 +11002445# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002446BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002447AC_ARG_WITH(bsd-auth,
2448 [ --with-bsd-auth Enable BSD auth support],
2449 [
2450 if test "x$withval" != "xno" ; then
2451 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002452 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002453 fi
2454 ]
2455)
2456
Damien Millera22ba012000-03-02 23:09:20 +11002457# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002458piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002459# make sure the directory exists
2460if test ! -d $piddir ; then
2461 piddir=`eval echo ${sysconfdir}`
2462 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002463 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002464 esac
2465fi
2466
Tim Rice88f2ab52002-03-17 12:17:34 -08002467AC_ARG_WITH(pid-dir,
2468 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2469 [
2470 if test "x$withval" != "xno" ; then
2471 piddir=$withval
2472 if test ! -d $piddir ; then
2473 AC_MSG_WARN([** no $piddir directory on this system **])
2474 fi
2475 fi
2476 ]
2477)
2478
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002479AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002480AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002481
andre2ff7b5d2000-06-03 14:57:40 +00002482dnl allow user to disable some login recording features
2483AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002484 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002485 [
2486 if test "x$enableval" = "xno" ; then
2487 AC_DEFINE(DISABLE_LASTLOG)
2488 fi
2489 ]
andre2ff7b5d2000-06-03 14:57:40 +00002490)
2491AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002492 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002493 [
2494 if test "x$enableval" = "xno" ; then
2495 AC_DEFINE(DISABLE_UTMP)
2496 fi
2497 ]
andre2ff7b5d2000-06-03 14:57:40 +00002498)
2499AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002500 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002501 [
2502 if test "x$enableval" = "xno" ; then
2503 AC_DEFINE(DISABLE_UTMPX)
2504 fi
2505 ]
andre2ff7b5d2000-06-03 14:57:40 +00002506)
2507AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002508 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002509 [
2510 if test "x$enableval" = "xno" ; then
2511 AC_DEFINE(DISABLE_WTMP)
2512 fi
2513 ]
andre2ff7b5d2000-06-03 14:57:40 +00002514)
2515AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002516 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002517 [
2518 if test "x$enableval" = "xno" ; then
2519 AC_DEFINE(DISABLE_WTMPX)
2520 fi
2521 ]
andre2ff7b5d2000-06-03 14:57:40 +00002522)
2523AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002524 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002525 [
2526 if test "x$enableval" = "xno" ; then
2527 AC_DEFINE(DISABLE_LOGIN)
2528 fi
2529 ]
andre2ff7b5d2000-06-03 14:57:40 +00002530)
2531AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002532 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002533 [
2534 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002535 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002536 fi
2537 ]
andre2ff7b5d2000-06-03 14:57:40 +00002538)
2539AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002540 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002541 [
2542 if test "x$enableval" = "xno" ; then
2543 AC_DEFINE(DISABLE_PUTUTXLINE)
2544 fi
2545 ]
andre2ff7b5d2000-06-03 14:57:40 +00002546)
2547AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002548 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002549 [
2550 if test "x$withval" = "xno" ; then
2551 AC_DEFINE(DISABLE_LASTLOG)
2552 else
2553 conf_lastlog_location=$withval
2554 fi
2555 ]
2556)
andre2ff7b5d2000-06-03 14:57:40 +00002557
2558dnl lastlog, [uw]tmpx? detection
2559dnl NOTE: set the paths in the platform section to avoid the
2560dnl need for command-line parameters
2561dnl lastlog and [uw]tmp are subject to a file search if all else fails
2562
2563dnl lastlog detection
2564dnl NOTE: the code itself will detect if lastlog is a directory
2565AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2566AC_TRY_COMPILE([
2567#include <sys/types.h>
2568#include <utmp.h>
2569#ifdef HAVE_LASTLOG_H
2570# include <lastlog.h>
2571#endif
Damien Miller2994e082000-06-04 15:51:47 +10002572#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002573# include <paths.h>
2574#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002575#ifdef HAVE_LOGIN_H
2576# include <login.h>
2577#endif
andre2ff7b5d2000-06-03 14:57:40 +00002578 ],
2579 [ char *lastlog = LASTLOG_FILE; ],
2580 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002581 [
2582 AC_MSG_RESULT(no)
2583 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2584 AC_TRY_COMPILE([
2585#include <sys/types.h>
2586#include <utmp.h>
2587#ifdef HAVE_LASTLOG_H
2588# include <lastlog.h>
2589#endif
2590#ifdef HAVE_PATHS_H
2591# include <paths.h>
2592#endif
2593 ],
2594 [ char *lastlog = _PATH_LASTLOG; ],
2595 [ AC_MSG_RESULT(yes) ],
2596 [
andree441aa32000-06-12 22:34:38 +00002597 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002598 system_lastlog_path=no
2599 ])
2600 ]
andre2ff7b5d2000-06-03 14:57:40 +00002601)
Damien Miller2994e082000-06-04 15:51:47 +10002602
andre2ff7b5d2000-06-03 14:57:40 +00002603if test -z "$conf_lastlog_location"; then
2604 if test x"$system_lastlog_path" = x"no" ; then
2605 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002606 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002607 conf_lastlog_location=$f
2608 fi
2609 done
2610 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002611 AC_MSG_WARN([** Cannot find lastlog **])
2612 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002613 fi
2614 fi
2615fi
2616
2617if test -n "$conf_lastlog_location"; then
2618 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2619fi
2620
2621dnl utmp detection
2622AC_MSG_CHECKING([if your system defines UTMP_FILE])
2623AC_TRY_COMPILE([
2624#include <sys/types.h>
2625#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002626#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002627# include <paths.h>
2628#endif
2629 ],
2630 [ char *utmp = UTMP_FILE; ],
2631 [ AC_MSG_RESULT(yes) ],
2632 [ AC_MSG_RESULT(no)
2633 system_utmp_path=no ]
2634)
2635if test -z "$conf_utmp_location"; then
2636 if test x"$system_utmp_path" = x"no" ; then
2637 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2638 if test -f $f ; then
2639 conf_utmp_location=$f
2640 fi
2641 done
2642 if test -z "$conf_utmp_location"; then
2643 AC_DEFINE(DISABLE_UTMP)
2644 fi
2645 fi
2646fi
2647if test -n "$conf_utmp_location"; then
2648 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2649fi
2650
2651dnl wtmp detection
2652AC_MSG_CHECKING([if your system defines WTMP_FILE])
2653AC_TRY_COMPILE([
2654#include <sys/types.h>
2655#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002656#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002657# include <paths.h>
2658#endif
2659 ],
2660 [ char *wtmp = WTMP_FILE; ],
2661 [ AC_MSG_RESULT(yes) ],
2662 [ AC_MSG_RESULT(no)
2663 system_wtmp_path=no ]
2664)
2665if test -z "$conf_wtmp_location"; then
2666 if test x"$system_wtmp_path" = x"no" ; then
2667 for f in /usr/adm/wtmp /var/log/wtmp; do
2668 if test -f $f ; then
2669 conf_wtmp_location=$f
2670 fi
2671 done
2672 if test -z "$conf_wtmp_location"; then
2673 AC_DEFINE(DISABLE_WTMP)
2674 fi
2675 fi
2676fi
2677if test -n "$conf_wtmp_location"; then
2678 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2679fi
2680
2681
2682dnl utmpx detection - I don't know any system so perverse as to require
2683dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2684dnl there, though.
2685AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2686AC_TRY_COMPILE([
2687#include <sys/types.h>
2688#include <utmp.h>
2689#ifdef HAVE_UTMPX_H
2690#include <utmpx.h>
2691#endif
Damien Miller2994e082000-06-04 15:51:47 +10002692#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002693# include <paths.h>
2694#endif
2695 ],
2696 [ char *utmpx = UTMPX_FILE; ],
2697 [ AC_MSG_RESULT(yes) ],
2698 [ AC_MSG_RESULT(no)
2699 system_utmpx_path=no ]
2700)
2701if test -z "$conf_utmpx_location"; then
2702 if test x"$system_utmpx_path" = x"no" ; then
2703 AC_DEFINE(DISABLE_UTMPX)
2704 fi
2705else
2706 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2707fi
2708
2709dnl wtmpx detection
2710AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2711AC_TRY_COMPILE([
2712#include <sys/types.h>
2713#include <utmp.h>
2714#ifdef HAVE_UTMPX_H
2715#include <utmpx.h>
2716#endif
Damien Miller2994e082000-06-04 15:51:47 +10002717#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002718# include <paths.h>
2719#endif
2720 ],
2721 [ char *wtmpx = WTMPX_FILE; ],
2722 [ AC_MSG_RESULT(yes) ],
2723 [ AC_MSG_RESULT(no)
2724 system_wtmpx_path=no ]
2725)
2726if test -z "$conf_wtmpx_location"; then
2727 if test x"$system_wtmpx_path" = x"no" ; then
2728 AC_DEFINE(DISABLE_WTMPX)
2729 fi
2730else
2731 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2732fi
2733
Damien Miller4018c192000-04-30 09:30:44 +10002734
Damien Miller29ea30d2000-03-17 10:54:15 +11002735if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002736 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2737 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002738fi
2739
Tim Rice4cec93f2002-02-26 08:40:48 -08002740dnl remove pam and dl because they are in $LIBPAM
2741if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002742 LIBS=`echo $LIBS | sed 's/-lpam //'`
2743fi
2744if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2745 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002746fi
2747
Damien Millerbac2d8a2000-09-05 16:13:06 +11002748AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002749AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2750AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002751
Damien Miller7b22d652000-06-18 14:07:04 +10002752# Print summary of options
2753
Damien Miller7b22d652000-06-18 14:07:04 +10002754# Someone please show me a better way :)
2755A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2756B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2757C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2758D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002759E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002760F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002761G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002762H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2763I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2764J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002765
2766echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002767echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002768echo " User binaries: $B"
2769echo " System binaries: $C"
2770echo " Configuration files: $D"
2771echo " Askpass program: $E"
2772echo " Manual pages: $F"
2773echo " PID file: $G"
2774echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002775if test "x$external_path_file" = "x/etc/login.conf" ; then
2776echo " At runtime, sshd will use the path defined in $external_path_file"
2777echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002778else
Damien Millerf58c6722002-05-13 13:15:42 +10002779echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002780 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002781echo " (If PATH is set in $external_path_file it will be used instead. If"
2782echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2783 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002784fi
Damien Millera18bbd32002-05-13 10:48:57 +10002785if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002786echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002787fi
Damien Millerf58c6722002-05-13 13:15:42 +10002788echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002789echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002790echo " KerberosV support: $KRB5_MSG"
2791echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002792echo " S/KEY support: $SKEY_MSG"
2793echo " TCP Wrappers support: $TCPW_MSG"
2794echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002795echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002796echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2797echo " BSD Auth support: $BSD_AUTH_MSG"
2798echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002799if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002800echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002801fi
2802
Damien Miller7b22d652000-06-18 14:07:04 +10002803echo ""
2804
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002805echo " Host: ${host}"
2806echo " Compiler: ${CC}"
2807echo " Compiler flags: ${CFLAGS}"
2808echo "Preprocessor flags: ${CPPFLAGS}"
2809echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002810echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002811
2812echo ""
2813
Damien Miller82cf0ce2000-12-20 13:34:48 +11002814if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002815 echo "PAM is enabled. You may need to install a PAM control file "
2816 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002817 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002818 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002819 echo ""
2820fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002821
Damien Miller6c21c512002-01-22 21:57:53 +11002822if test ! -z "$RAND_HELPER_CMDHASH" ; then
2823 echo "WARNING: you are using the builtin random number collection "
2824 echo "service. Please read WARNING.RNG and request that your OS "
2825 echo "vendor includes kernel-based random number collection in "
2826 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002827 echo ""
2828fi
Damien Miller60396b02001-02-18 17:01:00 +11002829