blob: 6c8621ce56bcac93ed4d4bd5d73a04720f05eec8 [file] [log] [blame]
Darren Tucker454da0b2003-12-18 12:52:19 +11001# $Id: configure.ac,v 1.178 2003/12/18 01:52:19 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)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000153 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000154*-*-hpux10.26)
155 if test -z "$GCC"; then
156 CFLAGS="$CFLAGS -Ae"
157 fi
158 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
159 IPADDR_IN_DISPLAY=yes
160 AC_DEFINE(HAVE_SECUREWARE)
161 AC_DEFINE(USE_PIPES)
162 AC_DEFINE(LOGIN_NO_ENDOPT)
163 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000164 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000165 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000166 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700167 LIBS="$LIBS -lsec -lsecpw"
168 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000169 disable_ptmx_check=yes
170 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100171*-*-hpux10*)
172 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000173 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100174 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000175 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100176 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000177 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000178 AC_DEFINE(LOGIN_NO_ENDOPT)
179 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100180 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000181 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000182 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700183 LIBS="$LIBS -lsec"
184 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100185 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000186*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000187 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100188 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100189 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100190 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000191 AC_DEFINE(LOGIN_NO_ENDOPT)
192 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100193 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000194 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000195 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700196 LIBS="$LIBS -lsec"
197 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000198 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100199*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000200 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000201 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100202 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000203 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000204 AC_DEFINE(SETEUID_BREAKS_SETUID)
205 AC_DEFINE(BROKEN_SETREUID)
206 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000207 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000208 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100209 ;;
210*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000211 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000212 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100213 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000214 AC_DEFINE(WITH_IRIX_ARRAY)
215 AC_DEFINE(WITH_IRIX_PROJECT)
216 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000217 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000218 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000219 AC_DEFINE(SETEUID_BREAKS_SETUID)
220 AC_DEFINE(BROKEN_SETREUID)
221 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000222 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000223 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100224 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100225*-*-linux*)
226 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100227 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000228 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100229 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000230 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000231 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000232 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100233 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000234 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000235 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000236 AC_DEFINE(BROKEN_CMSG_TYPE)
237 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000238 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100239 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000240mips-sony-bsd|mips-sony-newsos4)
241 AC_DEFINE(HAVE_NEWS4)
242 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000243 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100244*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000245 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800246 if test "x$withval" != "xno" ; then
247 need_dash_r=1
248 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100249 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100250*-*-freebsd*)
251 check_for_libcrypt_later=1
252 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000253*-*-bsdi*)
254 AC_DEFINE(SETEUID_BREAKS_SETUID)
255 AC_DEFINE(BROKEN_SETREUID)
256 AC_DEFINE(BROKEN_SETREGID)
257 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000258*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000259 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100260 conf_utmp_location=/etc/utmp
261 conf_wtmp_location=/usr/adm/wtmp
262 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000263 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000264 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000265 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100266 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000267 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000268 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000269 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100270*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000271 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Rice88368a32003-12-08 12:35:59 -0800272 if test "x$withval" = "xno" ; then
273 LDFLAGS="$LDFLAGS -L/usr/local/lib"
274 else
275 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
276 need_dash_r=1
277 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100278 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000279 AC_DEFINE(LOGIN_NEEDS_UTMPX)
280 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000281 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000282 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000283 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
284 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000285 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000286 # hardwire lastlog location (can't detect it on some versions)
287 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000288 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
289 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
290 if test "$sol2ver" -ge 8; then
291 AC_MSG_RESULT(yes)
292 AC_DEFINE(DISABLE_UTMP)
293 AC_DEFINE(DISABLE_WTMP)
294 else
295 AC_MSG_RESULT(no)
296 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100297 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000298*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000299 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000300 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100301 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000302 conf_utmp_location=/etc/utmp
303 conf_wtmp_location=/var/adm/wtmp
304 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000305 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000306 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000307*-ncr-sysv*)
308 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
309 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700310 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000311 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000312 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000313 AC_DEFINE(SETEUID_BREAKS_SETUID)
314 AC_DEFINE(BROKEN_SETREUID)
315 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000316 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000317*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000318 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700319 # /usr/ucblib MUST NOT be searched on ReliantUNIX
320 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Darren Tucker89df7a32003-10-07 20:35:57 +1000321 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100322 IPADDR_IN_DISPLAY=yes
323 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000324 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000325 AC_DEFINE(SETEUID_BREAKS_SETUID)
326 AC_DEFINE(BROKEN_SETREUID)
327 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000328 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000329 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700330 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
331 # Attention: always take care to bind libsocket and libnsl before libc,
332 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000333 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100334*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000335 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100336 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100337 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700338 AC_DEFINE(SETEUID_BREAKS_SETUID)
339 AC_DEFINE(BROKEN_SETREUID)
340 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100341 ;;
342*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000343 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100344 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100345 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700346 AC_DEFINE(SETEUID_BREAKS_SETUID)
347 AC_DEFINE(BROKEN_SETREUID)
348 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100349 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100350*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000351 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100352 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100353 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100354*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000355 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100356 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700357 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100358 RANLIB=true
359 no_dev_ptmx=1
360 AC_DEFINE(BROKEN_SYS_TERMIO_H)
361 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000362 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000363 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100364 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700365 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100366 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700367 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700368 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100369 ;;
370*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800371 if test -z "$GCC"; then
372 CFLAGS="$CFLAGS -belf"
373 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000374 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000375 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100376 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000377 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100378 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000379 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000380 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700381 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700382 AC_DEFINE(SETEUID_BREAKS_SETUID)
383 AC_DEFINE(BROKEN_SETREUID)
384 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700385 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100386 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700387 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000388 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000389*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000390 AC_DEFINE(USE_PIPES)
391 AC_DEFINE(DISABLE_FD_PASSING)
392 LDFLAGS="$LDFLAGS"
393 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
394 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000395 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000396*-*-unicosmp*)
397 AC_DEFINE(WITH_ABBREV_NO_TTY)
398 AC_DEFINE(USE_PIPES)
399 AC_DEFINE(DISABLE_FD_PASSING)
400 LDFLAGS="$LDFLAGS"
401 LIBS="$LIBS -lgen -lacid"
402 MANTYPE=cat
403 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000404*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000405 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700406 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700407 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000408 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
409 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
410 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700411 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000412*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000413 AC_MSG_CHECKING(for Digital Unix SIA)
414 no_osfsia=""
415 AC_ARG_WITH(osfsia,
416 [ --with-osfsia Enable Digital Unix SIA],
417 [
418 if test "x$withval" = "xno" ; then
419 AC_MSG_RESULT(disabled)
420 no_osfsia=1
421 fi
422 ],
423 )
424 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000425 if test -f /etc/sia/matrix.conf; then
426 AC_MSG_RESULT(yes)
427 AC_DEFINE(HAVE_OSF_SIA)
428 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000429 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000430 LIBS="$LIBS -lsecurity -ldb -lm -laud"
431 else
432 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100433 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000434 fi
435 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000436 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700437 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000438 AC_DEFINE(BROKEN_SETREUID)
439 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000440 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000441
442*-*-nto-qnx)
443 AC_DEFINE(USE_PIPES)
444 AC_DEFINE(NO_X11_UNIX_SOCKETS)
445 AC_DEFINE(MISSING_NFDBITS)
446 AC_DEFINE(MISSING_HOWMANY)
447 AC_DEFINE(MISSING_FD_MASK)
448 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100449esac
450
Damien Millere37bfc12000-06-05 09:37:43 +1000451# Allow user to specify flags
452AC_ARG_WITH(cflags,
453 [ --with-cflags Specify additional flags to pass to compiler],
454 [
455 if test "x$withval" != "xno" ; then
456 CFLAGS="$CFLAGS $withval"
457 fi
458 ]
459)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000460AC_ARG_WITH(cppflags,
461 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
462 [
463 if test "x$withval" != "xno"; then
464 CPPFLAGS="$CPPFLAGS $withval"
465 fi
466 ]
467)
Damien Millere37bfc12000-06-05 09:37:43 +1000468AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000469 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000470 [
471 if test "x$withval" != "xno" ; then
472 LDFLAGS="$LDFLAGS $withval"
473 fi
474 ]
475)
476AC_ARG_WITH(libs,
477 [ --with-libs Specify additional libraries to link with],
478 [
479 if test "x$withval" != "xno" ; then
480 LIBS="$LIBS $withval"
481 fi
482 ]
483)
484
Darren Tucker6eb93042003-06-29 21:30:41 +1000485AC_MSG_CHECKING(compiler and flags for sanity)
486AC_TRY_RUN([
487#include <stdio.h>
488int main(){exit(0);}
489 ],
490 [ AC_MSG_RESULT(yes) ],
491 [
492 AC_MSG_RESULT(no)
493 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
494 ]
495)
496
Tim Rice4cec93f2002-02-26 08:40:48 -0800497# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000498AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000499 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800500 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000501 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000502 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000503 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
504 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000505 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700506 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Damien Miller5c3a5582003-09-23 22:12:38 +1000507 util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800508
Damien Millera22ba012000-03-02 23:09:20 +1100509# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700510AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
511AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000512
Damien Millerdf288022001-02-18 13:07:07 +1100513dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700514if test "x$with_tcp_wrappers" != "xno" ; then
515 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
516 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
517 fi
518fi
Damien Millerdf288022001-02-18 13:07:07 +1100519
Tim Rice1e1ef642003-09-11 22:19:31 -0700520dnl IRIX and Solaris 2.5.1 have dirname() in libgen
521AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
522 AC_CHECK_LIB(gen, dirname,[
523 AC_CACHE_CHECK([for broken dirname],
524 ac_cv_have_broken_dirname, [
525 save_LIBS="$LIBS"
526 LIBS="$LIBS -lgen"
527 AC_TRY_RUN(
528 [
529#include <libgen.h>
530#include <string.h>
531
532int main(int argc, char **argv) {
533 char *s, buf[32];
534
535 strncpy(buf,"/etc", 32);
536 s = dirname(buf);
537 if (!s || strncmp(s, "/", 32) != 0) {
538 exit(1);
539 } else {
540 exit(0);
541 }
542}
543 ],
544 [ ac_cv_have_broken_dirname="no" ],
545 [ ac_cv_have_broken_dirname="yes" ]
546 )
547 LIBS="$save_LIBS"
548 ])
549 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
550 LIBS="$LIBS -lgen"
551 AC_DEFINE(HAVE_DIRNAME)
552 AC_CHECK_HEADERS(libgen.h)
553 fi
554 ])
555])
556
557AC_CHECK_FUNC(getspnam, ,
558 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
559AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
560
Tim Rice13aae5e2001-10-21 17:53:58 -0700561dnl zlib is required
562AC_ARG_WITH(zlib,
563 [ --with-zlib=PATH Use zlib in PATH],
564 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000565 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100566 AC_MSG_ERROR([*** zlib is required ***])
567 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700568 if test -d "$withval/lib"; then
569 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700570 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700571 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700572 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700573 fi
574 else
575 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700576 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700577 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700578 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700579 fi
580 fi
581 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700582 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700583 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700584 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700585 fi
586 ]
587)
588
Tim Rice17b93e52001-10-23 22:36:54 -0700589AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100590
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000591dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100592AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000593 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
594)
Damien Millera8e06ce2003-11-21 23:48:55 +1100595AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700596 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
597 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000598)
Damien Millerab18c411999-11-11 10:40:23 +1100599
Tim Ricee589a292001-11-03 11:09:32 -0800600dnl Checks for libutil functions
601AC_CHECK_HEADERS(libutil.h)
602AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
603AC_CHECK_FUNCS(logout updwtmp logwtmp)
604
Ben Lindstrom8697e082001-02-24 21:41:10 +0000605AC_FUNC_STRFTIME
606
Damien Miller3c027682001-03-14 11:39:45 +1100607# Check for ALTDIRFUNC glob() extension
608AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
609AC_EGREP_CPP(FOUNDIT,
610 [
611 #include <glob.h>
612 #ifdef GLOB_ALTDIRFUNC
613 FOUNDIT
614 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100615 ],
Damien Miller3c027682001-03-14 11:39:45 +1100616 [
617 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
618 AC_MSG_RESULT(yes)
619 ],
620 [
621 AC_MSG_RESULT(no)
622 ]
623)
Damien Millerab18c411999-11-11 10:40:23 +1100624
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000625# Check for g.gl_matchc glob() extension
626AC_MSG_CHECKING(for gl_matchc field in glob_t)
627AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100628 [
629 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000630 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100631 ],
632 [
633 AC_DEFINE(GLOB_HAS_GL_MATCHC)
634 AC_MSG_RESULT(yes)
635 ],
636 [
637 AC_MSG_RESULT(no)
638 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000639)
640
Damien Miller18bb4732001-03-28 14:35:30 +1000641AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
642AC_TRY_RUN(
643 [
644#include <sys/types.h>
645#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700646int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000647 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100648 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000649 [
650 AC_MSG_RESULT(no)
651 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
652 ]
653)
654
Damien Millerc547bf12001-02-16 10:18:12 +1100655# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100656SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100657AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700658 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100659 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100660 [
661 if test "x$withval" != "xno" ; then
662
663 if test "x$withval" != "xyes" ; then
664 CPPFLAGS="$CPPFLAGS -I${withval}/include"
665 LDFLAGS="$LDFLAGS -L${withval}/lib"
666 fi
667
668 AC_DEFINE(SKEY)
669 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100670 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100671
Tim Rice4cec93f2002-02-26 08:40:48 -0800672 AC_MSG_CHECKING([for s/key support])
673 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100674 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800675#include <stdio.h>
676#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700677int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800678 ],
679 [AC_MSG_RESULT(yes)],
680 [
681 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100682 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
683 ])
684 fi
685 ]
686)
687
688# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700689TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100690AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700691 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100692 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100693 [
694 if test "x$withval" != "xno" ; then
695 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700696 saved_LDFLAGS="$LDFLAGS"
697 saved_CPPFLAGS="$CPPFLAGS"
698 if test -n "${withval}" -a "${withval}" != "yes"; then
699 if test -d "${withval}/lib"; then
700 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700701 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700702 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700703 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700704 fi
705 else
706 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700707 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700708 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700709 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700710 fi
711 fi
712 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700713 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700714 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700715 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700716 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700717 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800718 LIBWRAP="-lwrap"
719 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100720 AC_MSG_CHECKING(for libwrap)
721 AC_TRY_LINK(
722 [
723#include <tcpd.h>
724 int deny_severity = 0, allow_severity = 0;
725 ],
726 [hosts_access(0);],
727 [
728 AC_MSG_RESULT(yes)
729 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800730 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700731 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100732 ],
733 [
734 AC_MSG_ERROR([*** libwrap missing])
735 ]
736 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800737 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100738 fi
739 ]
740)
741
Damien Millerfe1f1432003-02-24 15:45:42 +1100742dnl Checks for library functions. Please keep in alphabetical order
743AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000744 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000745 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000746 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000747 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100748 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000749 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
750 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
751 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000752 setproctitle setregid setresgid setresuid setreuid setrlimit \
753 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000754 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000755 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100756)
Tim Rice13aae5e2001-10-21 17:53:58 -0700757
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000758# IRIX has a const char return value for gai_strerror()
759AC_CHECK_FUNCS(gai_strerror,[
760 AC_DEFINE(HAVE_GAI_STRERROR)
761 AC_TRY_COMPILE([
762#include <sys/types.h>
763#include <sys/socket.h>
764#include <netdb.h>
765
766const char *gai_strerror(int);],[
767char *str;
768
769str = gai_strerror(0);],[
770 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
771 [Define if gai_strerror() returns const char *])])])
772
Damien Millercd6853c2003-01-28 11:33:42 +1100773AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
774
Darren Tuckerf1159b52003-07-07 19:44:01 +1000775dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000776AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000777AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000778
Darren Tuckerb2427c82003-09-10 15:22:44 +1000779dnl tcsendbreak might be a macro
780AC_CHECK_DECL(tcsendbreak,
781 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100782 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000783 [#include <termios.h>]
784)
785
Darren Tuckere937be32003-12-17 18:53:26 +1100786dnl Some platorms have setresuid that isn't implemented
787AC_MSG_CHECKING(if setresuid seems to work)
788AC_TRY_RUN([
789#include <stdlib.h>
790#include <errno.h>
791int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
792 ],
793 [AC_MSG_RESULT(yes)],
794 [AC_DEFINE(BROKEN_SETRESUID),
795 AC_MSG_RESULT(not implemented)]
796)
797
798dnl Some platorms have setresgid that isn't implemented
799AC_MSG_CHECKING(if setresgid seems to work)
800AC_TRY_RUN([
801#include <stdlib.h>
802#include <errno.h>
803int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
804 ],
805 [AC_MSG_RESULT(yes)],
806 [AC_DEFINE(BROKEN_SETRESGID)
807 AC_MSG_RESULT(not implemented)]
808)
809
Damien Millerad833b32000-08-23 10:46:23 +1000810dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000811AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000812dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000813AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000814AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000815dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000816AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000817AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100818
Damien Millera8e06ce2003-11-21 23:48:55 +1100819AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100820 [AC_DEFINE(HAVE_DAEMON)],
821 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
822)
823
Damien Millera8e06ce2003-11-21 23:48:55 +1100824AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100825 [AC_DEFINE(HAVE_GETPAGESIZE)],
826 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
827)
828
Damien Millercb170cb2000-07-01 16:52:55 +1000829# Check for broken snprintf
830if test "x$ac_cv_func_snprintf" = "xyes" ; then
831 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
832 AC_TRY_RUN(
833 [
834#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700835int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000836 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100837 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000838 [
839 AC_MSG_RESULT(no)
840 AC_DEFINE(BROKEN_SNPRINTF)
841 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
842 ]
843 )
844fi
845
Damien Millere8328192003-01-07 15:18:32 +1100846dnl see whether mkstemp() requires XXXXXX
847if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
848AC_MSG_CHECKING([for (overly) strict mkstemp])
849AC_TRY_RUN(
850 [
851#include <stdlib.h>
852main() { char template[]="conftest.mkstemp-test";
853if (mkstemp(template) == -1)
854 exit(1);
855unlink(template); exit(0);
856}
857 ],
858 [
859 AC_MSG_RESULT(no)
860 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100861 [
Damien Millere8328192003-01-07 15:18:32 +1100862 AC_MSG_RESULT(yes)
863 AC_DEFINE(HAVE_STRICT_MKSTEMP)
864 ],
865 [
866 AC_MSG_RESULT(yes)
867 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100868 ]
Damien Millere8328192003-01-07 15:18:32 +1100869)
870fi
871
Darren Tucker70a3d552003-08-21 17:58:29 +1000872dnl make sure that openpty does not reacquire controlling terminal
873if test ! -z "$check_for_openpty_ctty_bug"; then
874 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
875 AC_TRY_RUN(
876 [
877#include <stdio.h>
878#include <sys/fcntl.h>
879#include <sys/types.h>
880#include <sys/wait.h>
881
882int
883main()
884{
885 pid_t pid;
886 int fd, ptyfd, ttyfd, status;
887
888 pid = fork();
889 if (pid < 0) { /* failed */
890 exit(1);
891 } else if (pid > 0) { /* parent */
892 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100893 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000894 exit(WEXITSTATUS(status));
895 else
896 exit(2);
897 } else { /* child */
898 close(0); close(1); close(2);
899 setsid();
900 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
901 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
902 if (fd >= 0)
903 exit(3); /* Acquired ctty: broken */
904 else
905 exit(0); /* Did not acquire ctty: OK */
906 }
907}
908 ],
909 [
910 AC_MSG_RESULT(yes)
911 ],
912 [
913 AC_MSG_RESULT(no)
914 AC_DEFINE(SSHD_ACQUIRES_CTTY)
915 ]
916 )
917fi
918
Damien Miller606f8802000-09-16 15:39:56 +1100919AC_FUNC_GETPGRP
920
Damien Millera64b57a2001-01-17 10:44:13 +1100921# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000922PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100923AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100924 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100925 [
Damien Millera64b57a2001-01-17 10:44:13 +1100926 if test "x$withval" != "xno" ; then
927 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
928 AC_MSG_ERROR([PAM headers not found])
929 fi
930
931 AC_CHECK_LIB(dl, dlopen, , )
932 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
933 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000934 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100935
Damien Millera64b57a2001-01-17 10:44:13 +1100936 PAM_MSG="yes"
937
938 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800939 if test $ac_cv_lib_dl_dlopen = yes; then
940 LIBPAM="-lpam -ldl"
941 else
942 LIBPAM="-lpam"
943 fi
944 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100945 fi
946 ]
947)
Damien Millera22ba012000-03-02 23:09:20 +1100948
Damien Millera64b57a2001-01-17 10:44:13 +1100949# Check for older PAM
950if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100951 # Check PAM strerror arguments (old PAM)
952 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
953 AC_TRY_COMPILE(
954 [
Damien Miller81171112000-04-23 11:14:01 +1000955#include <stdlib.h>
956#include <security/pam_appl.h>
Damien Millera8e06ce2003-11-21 23:48:55 +1100957 ],
958 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +1100959 [AC_MSG_RESULT(no)],
960 [
961 AC_DEFINE(HAVE_OLD_PAM)
962 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000963 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100964 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100965 )
Damien Millera22ba012000-03-02 23:09:20 +1100966fi
967
Damien Millerfc93d4b2002-09-04 23:26:29 +1000968# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
969# because the system crypt() is more featureful.
970if test "x$check_for_libcrypt_before" = "x1"; then
971 AC_CHECK_LIB(crypt, crypt)
972fi
973
Tim Riceaef73712002-05-11 13:17:42 -0700974# Search for OpenSSL
975saved_CPPFLAGS="$CPPFLAGS"
976saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100977AC_ARG_WITH(ssl-dir,
978 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
979 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000980 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700981 if test -d "$withval/lib"; then
982 if test -n "${need_dash_r}"; then
983 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
984 else
985 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
986 fi
987 else
988 if test -n "${need_dash_r}"; then
989 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
990 else
991 LDFLAGS="-L${withval} ${LDFLAGS}"
992 fi
993 fi
994 if test -d "$withval/include"; then
995 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
996 else
997 CPPFLAGS="-I${withval} ${CPPFLAGS}"
998 fi
Damien Millera22ba012000-03-02 23:09:20 +1100999 fi
1000 ]
1001)
Tim Riceaef73712002-05-11 13:17:42 -07001002LIBS="$LIBS -lcrypto"
1003AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001004 [
Tim Riceaef73712002-05-11 13:17:42 -07001005 dnl Check default openssl install dir
1006 if test -n "${need_dash_r}"; then
1007 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001008 else
Tim Riceaef73712002-05-11 13:17:42 -07001009 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001010 fi
Tim Riceaef73712002-05-11 13:17:42 -07001011 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1012 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1013 [
1014 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1015 ]
1016 )
1017 ]
1018)
1019
Tim Riced730b782002-08-13 18:52:10 -07001020# Determine OpenSSL header version
1021AC_MSG_CHECKING([OpenSSL header version])
1022AC_TRY_RUN(
1023 [
1024#include <stdio.h>
1025#include <string.h>
1026#include <openssl/opensslv.h>
1027#define DATA "conftest.sslincver"
1028int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001029 FILE *fd;
1030 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001031
Damien Millera8e06ce2003-11-21 23:48:55 +11001032 fd = fopen(DATA,"w");
1033 if(fd == NULL)
1034 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001035
1036 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1037 exit(1);
1038
1039 exit(0);
1040}
1041 ],
1042 [
1043 ssl_header_ver=`cat conftest.sslincver`
1044 AC_MSG_RESULT($ssl_header_ver)
1045 ],
1046 [
1047 AC_MSG_RESULT(not found)
1048 AC_MSG_ERROR(OpenSSL version header not found.)
1049 ]
1050)
1051
1052# Determine OpenSSL library version
1053AC_MSG_CHECKING([OpenSSL library version])
1054AC_TRY_RUN(
1055 [
1056#include <stdio.h>
1057#include <string.h>
1058#include <openssl/opensslv.h>
1059#include <openssl/crypto.h>
1060#define DATA "conftest.ssllibver"
1061int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001062 FILE *fd;
1063 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001064
Damien Millera8e06ce2003-11-21 23:48:55 +11001065 fd = fopen(DATA,"w");
1066 if(fd == NULL)
1067 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001068
1069 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1070 exit(1);
1071
1072 exit(0);
1073}
1074 ],
1075 [
1076 ssl_library_ver=`cat conftest.ssllibver`
1077 AC_MSG_RESULT($ssl_library_ver)
1078 ],
1079 [
1080 AC_MSG_RESULT(not found)
1081 AC_MSG_ERROR(OpenSSL library not found.)
1082 ]
1083)
Damien Millera22ba012000-03-02 23:09:20 +11001084
Damien Millerec932372002-01-22 22:16:03 +11001085# Sanity check OpenSSL headers
1086AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1087AC_TRY_RUN(
1088 [
1089#include <string.h>
1090#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001091int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001092 ],
1093 [
1094 AC_MSG_RESULT(yes)
1095 ],
1096 [
1097 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001098 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1099Check config.log for details.
1100Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001101 ]
1102)
1103
Damien Millera8e06ce2003-11-21 23:48:55 +11001104# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001105# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001106if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001107 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001108fi
1109
Damien Miller6c21c512002-01-22 21:57:53 +11001110
1111### Configure cryptographic random number support
1112
1113# Check wheter OpenSSL seeds itself
1114AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1115AC_TRY_RUN(
1116 [
1117#include <string.h>
1118#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001119int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001120 ],
1121 [
1122 OPENSSL_SEEDS_ITSELF=yes
1123 AC_MSG_RESULT(yes)
1124 ],
1125 [
1126 AC_MSG_RESULT(no)
1127 # Default to use of the rand helper if OpenSSL doesn't
1128 # seed itself
1129 USE_RAND_HELPER=yes
1130 ]
1131)
1132
1133
1134# Do we want to force the use of the rand helper?
1135AC_ARG_WITH(rand-helper,
1136 [ --with-rand-helper Use subprocess to gather strong randomness ],
1137 [
1138 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001139 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001140 # the previous test showed it to be unseeded.
1141 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1142 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1143 OPENSSL_SEEDS_ITSELF=yes
1144 USE_RAND_HELPER=""
1145 fi
1146 else
1147 USE_RAND_HELPER=yes
1148 fi
1149 ],
1150)
1151
1152# Which randomness source do we use?
1153if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1154 # OpenSSL only
1155 AC_DEFINE(OPENSSL_PRNG_ONLY)
1156 RAND_MSG="OpenSSL internal ONLY"
1157 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001158elif test ! -z "$USE_RAND_HELPER" ; then
1159 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001160 RAND_MSG="ssh-rand-helper"
1161 INSTALL_SSH_RAND_HELPER="yes"
1162fi
1163AC_SUBST(INSTALL_SSH_RAND_HELPER)
1164
1165### Configuration of ssh-rand-helper
1166
1167# PRNGD TCP socket
1168AC_ARG_WITH(prngd-port,
1169 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1170 [
Damien Millere996d722002-01-23 11:20:59 +11001171 case "$withval" in
1172 no)
1173 withval=""
1174 ;;
1175 [[0-9]]*)
1176 ;;
1177 *)
1178 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1179 ;;
1180 esac
1181 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001182 PRNGD_PORT="$withval"
1183 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1184 fi
1185 ]
1186)
1187
1188# PRNGD Unix domain socket
1189AC_ARG_WITH(prngd-socket,
1190 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1191 [
Damien Millere996d722002-01-23 11:20:59 +11001192 case "$withval" in
1193 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001194 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001195 ;;
1196 no)
1197 withval=""
1198 ;;
1199 /*)
1200 ;;
1201 *)
1202 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1203 ;;
1204 esac
1205
1206 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001207 if test ! -z "$PRNGD_PORT" ; then
1208 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1209 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001210 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001211 AC_MSG_WARN(Entropy socket is not readable)
1212 fi
1213 PRNGD_SOCKET="$withval"
1214 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1215 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001216 ],
1217 [
1218 # Check for existing socket only if we don't have a random device already
1219 if test "$USE_RAND_HELPER" = yes ; then
1220 AC_MSG_CHECKING(for PRNGD/EGD socket)
1221 # Insert other locations here
1222 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1223 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1224 PRNGD_SOCKET="$sock"
1225 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1226 break;
1227 fi
1228 done
1229 if test ! -z "$PRNGD_SOCKET" ; then
1230 AC_MSG_RESULT($PRNGD_SOCKET)
1231 else
1232 AC_MSG_RESULT(not found)
1233 fi
1234 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001235 ]
1236)
1237
1238# Change default command timeout for hashing entropy source
1239entropy_timeout=200
1240AC_ARG_WITH(entropy-timeout,
1241 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1242 [
1243 if test "x$withval" != "xno" ; then
1244 entropy_timeout=$withval
1245 fi
1246 ]
1247)
Damien Miller6c21c512002-01-22 21:57:53 +11001248AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1249
Damien Millerd3f6ad22002-06-25 10:24:47 +10001250SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001251AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001252 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001253 [
1254 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001255 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001256 fi
1257 ]
1258)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001259AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1260AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001261
Tim Rice88f2ab52002-03-17 12:17:34 -08001262# We do this little dance with the search path to insure
1263# that programs that we select for use by installed programs
1264# (which may be run by the super-user) come from trusted
1265# locations before they come from the user's private area.
1266# This should help avoid accidentally configuring some
1267# random version of a program in someone's personal bin.
1268
1269OPATH=$PATH
1270PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001271test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001272test -d /sbin && PATH=$PATH:/sbin
1273test -d /usr/sbin && PATH=$PATH:/usr/sbin
1274PATH=$PATH:/etc:$OPATH
1275
Damien Millera8e06ce2003-11-21 23:48:55 +11001276# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001277OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1278OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1279OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1280OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1281OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1282OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1283OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1284OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1285OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1286OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1287OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1288OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1289OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1290OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1291OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1292OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001293# restore PATH
1294PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001295
1296# Where does ssh-rand-helper get its randomness from?
1297INSTALL_SSH_PRNG_CMDS=""
1298if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1299 if test ! -z "$PRNGD_PORT" ; then
1300 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1301 elif test ! -z "$PRNGD_SOCKET" ; then
1302 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1303 else
1304 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1305 RAND_HELPER_CMDHASH=yes
1306 INSTALL_SSH_PRNG_CMDS="yes"
1307 fi
1308fi
1309AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1310
1311
Ben Lindstromb5628642000-10-18 00:02:25 +00001312# Cheap hack to ensure NEWS-OS libraries are arranged right.
1313if test ! -z "$SONY" ; then
1314 LIBS="$LIBS -liberty";
1315fi
1316
Damien Millera22ba012000-03-02 23:09:20 +11001317# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001318AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001319AC_CHECK_SIZEOF(short int, 2)
1320AC_CHECK_SIZEOF(int, 4)
1321AC_CHECK_SIZEOF(long int, 4)
1322AC_CHECK_SIZEOF(long long int, 8)
1323
Damien Millerfa2bb692002-04-23 23:22:25 +10001324# Sanity check long long for some platforms (AIX)
1325if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1326 ac_cv_sizeof_long_long_int=0
1327fi
1328
Damien Millera22ba012000-03-02 23:09:20 +11001329# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001330AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1331 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001332 [ #include <sys/types.h> ],
1333 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001334 [ ac_cv_have_u_int="yes" ],
1335 [ ac_cv_have_u_int="no" ]
1336 )
1337])
1338if test "x$ac_cv_have_u_int" = "xyes" ; then
1339 AC_DEFINE(HAVE_U_INT)
1340 have_u_int=1
1341fi
1342
Damien Miller61e50f12000-05-08 20:49:37 +10001343AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1344 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001345 [ #include <sys/types.h> ],
1346 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001347 [ ac_cv_have_intxx_t="yes" ],
1348 [ ac_cv_have_intxx_t="no" ]
1349 )
1350])
1351if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1352 AC_DEFINE(HAVE_INTXX_T)
1353 have_intxx_t=1
1354fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001355
1356if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001357 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001358then
1359 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1360 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001361 [ #include <stdint.h> ],
1362 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001363 [
1364 AC_DEFINE(HAVE_INTXX_T)
1365 AC_MSG_RESULT(yes)
1366 ],
1367 [ AC_MSG_RESULT(no) ]
1368 )
1369fi
1370
Damien Miller578783e2000-09-23 14:12:24 +11001371AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1372 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001373 [
1374#include <sys/types.h>
1375#ifdef HAVE_STDINT_H
1376# include <stdint.h>
1377#endif
1378#include <sys/socket.h>
1379#ifdef HAVE_SYS_BITYPES_H
1380# include <sys/bitypes.h>
1381#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001382 ],
1383 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001384 [ ac_cv_have_int64_t="yes" ],
1385 [ ac_cv_have_int64_t="no" ]
1386 )
1387])
1388if test "x$ac_cv_have_int64_t" = "xyes" ; then
1389 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001390fi
1391
Damien Miller61e50f12000-05-08 20:49:37 +10001392AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1393 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001394 [ #include <sys/types.h> ],
1395 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001396 [ ac_cv_have_u_intxx_t="yes" ],
1397 [ ac_cv_have_u_intxx_t="no" ]
1398 )
1399])
1400if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1401 AC_DEFINE(HAVE_U_INTXX_T)
1402 have_u_intxx_t=1
1403fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001404
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001405if test -z "$have_u_intxx_t" ; then
1406 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1407 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001408 [ #include <sys/socket.h> ],
1409 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001410 [
1411 AC_DEFINE(HAVE_U_INTXX_T)
1412 AC_MSG_RESULT(yes)
1413 ],
1414 [ AC_MSG_RESULT(no) ]
1415 )
1416fi
1417
Damien Miller578783e2000-09-23 14:12:24 +11001418AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1419 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001420 [ #include <sys/types.h> ],
1421 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001422 [ ac_cv_have_u_int64_t="yes" ],
1423 [ ac_cv_have_u_int64_t="no" ]
1424 )
1425])
1426if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1427 AC_DEFINE(HAVE_U_INT64_T)
1428 have_u_int64_t=1
1429fi
1430
Tim Rice4cec93f2002-02-26 08:40:48 -08001431if test -z "$have_u_int64_t" ; then
1432 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1433 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001434 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001435 [ u_int64_t a; a = 1],
1436 [
1437 AC_DEFINE(HAVE_U_INT64_T)
1438 AC_MSG_RESULT(yes)
1439 ],
1440 [ AC_MSG_RESULT(no) ]
1441 )
1442fi
1443
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001444if test -z "$have_u_intxx_t" ; then
1445 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1446 AC_TRY_COMPILE(
1447 [
1448#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001449 ],
1450 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001451 [ ac_cv_have_uintxx_t="yes" ],
1452 [ ac_cv_have_uintxx_t="no" ]
1453 )
1454 ])
1455 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1456 AC_DEFINE(HAVE_UINTXX_T)
1457 fi
1458fi
1459
1460if test -z "$have_uintxx_t" ; then
1461 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1462 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001463 [ #include <stdint.h> ],
1464 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001465 [
1466 AC_DEFINE(HAVE_UINTXX_T)
1467 AC_MSG_RESULT(yes)
1468 ],
1469 [ AC_MSG_RESULT(no) ]
1470 )
1471fi
1472
Damien Milleredb82922000-06-20 13:25:52 +10001473if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001474 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001475then
1476 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1477 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001478 [
1479#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001480 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001481 [
Damien Miller70494d12000-04-03 15:57:06 +10001482 int8_t a; int16_t b; int32_t c;
1483 u_int8_t e; u_int16_t f; u_int32_t g;
1484 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001485 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001486 [
1487 AC_DEFINE(HAVE_U_INTXX_T)
1488 AC_DEFINE(HAVE_INTXX_T)
1489 AC_MSG_RESULT(yes)
1490 ],
1491 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001492 )
Damien Millerb29ea912000-01-15 14:12:03 +11001493fi
1494
Damien Miller58be7382001-09-15 21:31:54 +10001495
1496AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1497 AC_TRY_COMPILE(
1498 [
1499#include <sys/types.h>
1500 ],
1501 [ u_char foo; foo = 125; ],
1502 [ ac_cv_have_u_char="yes" ],
1503 [ ac_cv_have_u_char="no" ]
1504 )
1505])
1506if test "x$ac_cv_have_u_char" = "xyes" ; then
1507 AC_DEFINE(HAVE_U_CHAR)
1508fi
1509
Tim Rice13aae5e2001-10-21 17:53:58 -07001510TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001511
Tim Rice200a5c02002-02-26 22:12:34 -08001512AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001513
Damien Miller61e50f12000-05-08 20:49:37 +10001514AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1515 AC_TRY_COMPILE(
1516 [
1517#include <sys/types.h>
1518 ],
1519 [ size_t foo; foo = 1235; ],
1520 [ ac_cv_have_size_t="yes" ],
1521 [ ac_cv_have_size_t="no" ]
1522 )
1523])
1524if test "x$ac_cv_have_size_t" = "xyes" ; then
1525 AC_DEFINE(HAVE_SIZE_T)
1526fi
Damien Miller95058511999-12-29 10:36:45 +11001527
Damien Miller615f9392000-05-17 22:53:33 +10001528AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1529 AC_TRY_COMPILE(
1530 [
1531#include <sys/types.h>
1532 ],
1533 [ ssize_t foo; foo = 1235; ],
1534 [ ac_cv_have_ssize_t="yes" ],
1535 [ ac_cv_have_ssize_t="no" ]
1536 )
1537])
1538if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1539 AC_DEFINE(HAVE_SSIZE_T)
1540fi
1541
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001542AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1543 AC_TRY_COMPILE(
1544 [
1545#include <time.h>
1546 ],
1547 [ clock_t foo; foo = 1235; ],
1548 [ ac_cv_have_clock_t="yes" ],
1549 [ ac_cv_have_clock_t="no" ]
1550 )
1551])
1552if test "x$ac_cv_have_clock_t" = "xyes" ; then
1553 AC_DEFINE(HAVE_CLOCK_T)
1554fi
1555
Damien Millerb54b40e2000-06-23 08:23:34 +10001556AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1557 AC_TRY_COMPILE(
1558 [
1559#include <sys/types.h>
1560#include <sys/socket.h>
1561 ],
1562 [ sa_family_t foo; foo = 1235; ],
1563 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001564 [ AC_TRY_COMPILE(
1565 [
1566#include <sys/types.h>
1567#include <sys/socket.h>
1568#include <netinet/in.h>
1569 ],
1570 [ sa_family_t foo; foo = 1235; ],
1571 [ ac_cv_have_sa_family_t="yes" ],
1572
Damien Millerb54b40e2000-06-23 08:23:34 +10001573 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001574 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001575 )
1576])
1577if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1578 AC_DEFINE(HAVE_SA_FAMILY_T)
1579fi
1580
Damien Miller0f91b4e2000-06-18 15:43:25 +10001581AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1582 AC_TRY_COMPILE(
1583 [
1584#include <sys/types.h>
1585 ],
1586 [ pid_t foo; foo = 1235; ],
1587 [ ac_cv_have_pid_t="yes" ],
1588 [ ac_cv_have_pid_t="no" ]
1589 )
1590])
1591if test "x$ac_cv_have_pid_t" = "xyes" ; then
1592 AC_DEFINE(HAVE_PID_T)
1593fi
1594
1595AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1596 AC_TRY_COMPILE(
1597 [
1598#include <sys/types.h>
1599 ],
1600 [ mode_t foo; foo = 1235; ],
1601 [ ac_cv_have_mode_t="yes" ],
1602 [ ac_cv_have_mode_t="no" ]
1603 )
1604])
1605if test "x$ac_cv_have_mode_t" = "xyes" ; then
1606 AC_DEFINE(HAVE_MODE_T)
1607fi
1608
Damien Miller61e50f12000-05-08 20:49:37 +10001609
1610AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1611 AC_TRY_COMPILE(
1612 [
Damien Miller81171112000-04-23 11:14:01 +10001613#include <sys/types.h>
1614#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001615 ],
1616 [ struct sockaddr_storage s; ],
1617 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1618 [ ac_cv_have_struct_sockaddr_storage="no" ]
1619 )
1620])
1621if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1622 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1623fi
Damien Miller34132e52000-01-14 15:45:46 +11001624
Damien Miller61e50f12000-05-08 20:49:37 +10001625AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1626 AC_TRY_COMPILE(
1627 [
Damien Miller7b22d652000-06-18 14:07:04 +10001628#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001629#include <netinet/in.h>
1630 ],
1631 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1632 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1633 [ ac_cv_have_struct_sockaddr_in6="no" ]
1634 )
1635])
1636if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1637 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1638fi
Damien Miller34132e52000-01-14 15:45:46 +11001639
Damien Miller61e50f12000-05-08 20:49:37 +10001640AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1641 AC_TRY_COMPILE(
1642 [
Damien Miller7b22d652000-06-18 14:07:04 +10001643#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001644#include <netinet/in.h>
1645 ],
1646 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1647 [ ac_cv_have_struct_in6_addr="yes" ],
1648 [ ac_cv_have_struct_in6_addr="no" ]
1649 )
1650])
1651if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1652 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1653fi
Damien Miller34132e52000-01-14 15:45:46 +11001654
Damien Miller61e50f12000-05-08 20:49:37 +10001655AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1656 AC_TRY_COMPILE(
1657 [
Damien Miller81171112000-04-23 11:14:01 +10001658#include <sys/types.h>
1659#include <sys/socket.h>
1660#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001661 ],
1662 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1663 [ ac_cv_have_struct_addrinfo="yes" ],
1664 [ ac_cv_have_struct_addrinfo="no" ]
1665 )
1666])
1667if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1668 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1669fi
1670
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001671AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1672 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001673 [ #include <sys/time.h> ],
1674 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001675 [ ac_cv_have_struct_timeval="yes" ],
1676 [ ac_cv_have_struct_timeval="no" ]
1677 )
1678])
1679if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1680 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1681 have_struct_timeval=1
1682fi
1683
Tim Rice4e4dc562003-03-18 10:21:40 -08001684AC_CHECK_TYPES(struct timespec)
1685
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001686# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001687if test "x$ac_cv_have_int64_t" = "xno" -a \
1688 "x$ac_cv_sizeof_long_int" != "x8" -a \
1689 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001690 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1691 echo "an alternative compiler (I.E., GCC) before continuing."
1692 echo ""
1693 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001694else
1695dnl test snprintf (broken on SCO w/gcc)
1696 AC_TRY_RUN(
1697 [
1698#include <stdio.h>
1699#include <string.h>
1700#ifdef HAVE_SNPRINTF
1701main()
1702{
1703 char buf[50];
1704 char expected_out[50];
1705 int mazsize = 50 ;
1706#if (SIZEOF_LONG_INT == 8)
1707 long int num = 0x7fffffffffffffff;
1708#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001709 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001710#endif
1711 strcpy(expected_out, "9223372036854775807");
1712 snprintf(buf, mazsize, "%lld", num);
1713 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001714 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001715 exit(0);
1716}
1717#else
1718main() { exit(0); }
1719#endif
1720 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1721 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001722fi
1723
Damien Miller78315eb2000-09-29 23:01:36 +11001724dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001725OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1726OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1727OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1728OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1729OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001730OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001731OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1732OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001733OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001734OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1735OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1736OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1737OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001738OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1739OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1740OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1741OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001742
1743AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001744
Damien Miller61e50f12000-05-08 20:49:37 +10001745AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1746 ac_cv_have_ss_family_in_struct_ss, [
1747 AC_TRY_COMPILE(
1748 [
Damien Miller81171112000-04-23 11:14:01 +10001749#include <sys/types.h>
1750#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001751 ],
1752 [ struct sockaddr_storage s; s.ss_family = 1; ],
1753 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1754 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1755 )
1756])
1757if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1758 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1759fi
1760
Damien Miller61e50f12000-05-08 20:49:37 +10001761AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1762 ac_cv_have___ss_family_in_struct_ss, [
1763 AC_TRY_COMPILE(
1764 [
Damien Miller81171112000-04-23 11:14:01 +10001765#include <sys/types.h>
1766#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001767 ],
1768 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1769 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1770 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1771 )
1772])
1773if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1774 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1775fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001776
Damien Millerad833b32000-08-23 10:46:23 +10001777AC_CACHE_CHECK([for pw_class field in struct passwd],
1778 ac_cv_have_pw_class_in_struct_passwd, [
1779 AC_TRY_COMPILE(
1780 [
Damien Millerad833b32000-08-23 10:46:23 +10001781#include <pwd.h>
1782 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001783 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001784 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1785 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1786 )
1787])
1788if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1789 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1790fi
1791
Kevin Steves82456952001-06-22 21:14:18 +00001792AC_CACHE_CHECK([for pw_expire field in struct passwd],
1793 ac_cv_have_pw_expire_in_struct_passwd, [
1794 AC_TRY_COMPILE(
1795 [
1796#include <pwd.h>
1797 ],
1798 [ struct passwd p; p.pw_expire = 0; ],
1799 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1800 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1801 )
1802])
1803if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1804 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1805fi
1806
1807AC_CACHE_CHECK([for pw_change field in struct passwd],
1808 ac_cv_have_pw_change_in_struct_passwd, [
1809 AC_TRY_COMPILE(
1810 [
1811#include <pwd.h>
1812 ],
1813 [ struct passwd p; p.pw_change = 0; ],
1814 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1815 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1816 )
1817])
1818if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1819 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1820fi
Damien Miller61e50f12000-05-08 20:49:37 +10001821
Tim Rice28bbb0c2002-05-27 17:37:32 -07001822dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001823AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1824 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001825 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001826 [
Tim Riceae49fe62002-04-12 10:26:21 -07001827#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001828#include <sys/socket.h>
1829#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001830int main() {
1831#ifdef msg_accrights
1832exit(1);
1833#endif
1834struct msghdr m;
1835m.msg_accrights = 0;
1836exit(0);
1837}
Kevin Steves939c9db2002-03-22 17:23:25 +00001838 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001839 [ ac_cv_have_accrights_in_msghdr="yes" ],
1840 [ ac_cv_have_accrights_in_msghdr="no" ]
1841 )
1842])
1843if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1844 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1845fi
1846
Kevin Stevesa44e0352002-04-07 16:18:03 +00001847AC_CACHE_CHECK([for msg_control field in struct msghdr],
1848 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001849 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001850 [
Tim Riceae49fe62002-04-12 10:26:21 -07001851#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001852#include <sys/socket.h>
1853#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001854int main() {
1855#ifdef msg_control
1856exit(1);
1857#endif
1858struct msghdr m;
1859m.msg_control = 0;
1860exit(0);
1861}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001862 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001863 [ ac_cv_have_control_in_msghdr="yes" ],
1864 [ ac_cv_have_control_in_msghdr="no" ]
1865 )
1866])
1867if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1868 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1869fi
1870
Damien Miller61e50f12000-05-08 20:49:37 +10001871AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001872 AC_TRY_LINK([],
1873 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001874 [ ac_cv_libc_defines___progname="yes" ],
1875 [ ac_cv_libc_defines___progname="no" ]
1876 )
1877])
1878if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1879 AC_DEFINE(HAVE___PROGNAME)
1880fi
1881
Kevin Steves4846f4a2002-03-22 18:19:53 +00001882AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1883 AC_TRY_LINK([
1884#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001885],
1886 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001887 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1888 [ ac_cv_cc_implements___FUNCTION__="no" ]
1889 )
1890])
1891if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1892 AC_DEFINE(HAVE___FUNCTION__)
1893fi
1894
1895AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1896 AC_TRY_LINK([
1897#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001898],
1899 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001900 [ ac_cv_cc_implements___func__="yes" ],
1901 [ ac_cv_cc_implements___func__="no" ]
1902 )
1903])
1904if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1905 AC_DEFINE(HAVE___func__)
1906fi
1907
Damien Miller4f8e6692001-07-14 13:22:53 +10001908AC_CACHE_CHECK([whether getopt has optreset support],
1909 ac_cv_have_getopt_optreset, [
1910 AC_TRY_LINK(
1911 [
1912#include <getopt.h>
1913 ],
1914 [ extern int optreset; optreset = 0; ],
1915 [ ac_cv_have_getopt_optreset="yes" ],
1916 [ ac_cv_have_getopt_optreset="no" ]
1917 )
1918])
1919if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1920 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1921fi
Damien Millera22ba012000-03-02 23:09:20 +11001922
Damien Millerecbb26d2000-07-15 14:59:14 +10001923AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001924 AC_TRY_LINK([],
1925 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001926 [ ac_cv_libc_defines_sys_errlist="yes" ],
1927 [ ac_cv_libc_defines_sys_errlist="no" ]
1928 )
1929])
1930if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1931 AC_DEFINE(HAVE_SYS_ERRLIST)
1932fi
1933
1934
Damien Miller11fa2cc2000-08-16 10:35:58 +10001935AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001936 AC_TRY_LINK([],
1937 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001938 [ ac_cv_libc_defines_sys_nerr="yes" ],
1939 [ ac_cv_libc_defines_sys_nerr="no" ]
1940 )
1941])
1942if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1943 AC_DEFINE(HAVE_SYS_NERR)
1944fi
1945
Damien Millera8e06ce2003-11-21 23:48:55 +11001946SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001947# Check whether user wants sectok support
1948AC_ARG_WITH(sectok,
1949 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001950 [
1951 if test "x$withval" != "xno" ; then
1952 if test "x$withval" != "xyes" ; then
1953 CPPFLAGS="$CPPFLAGS -I${withval}"
1954 LDFLAGS="$LDFLAGS -L${withval}"
1955 if test ! -z "$need_dash_r" ; then
1956 LDFLAGS="$LDFLAGS -R${withval}"
1957 fi
1958 if test ! -z "$blibpath" ; then
1959 blibpath="$blibpath:${withval}"
1960 fi
1961 fi
1962 AC_CHECK_HEADERS(sectok.h)
1963 if test "$ac_cv_header_sectok_h" != yes; then
1964 AC_MSG_ERROR(Can't find sectok.h)
1965 fi
1966 AC_CHECK_LIB(sectok, sectok_open)
1967 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1968 AC_MSG_ERROR(Can't find libsectok)
1969 fi
1970 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001971 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11001972 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001973 fi
1974 ]
1975)
1976
1977# Check whether user wants OpenSC support
1978AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001979 AC_HELP_STRING([--with-opensc=PFX],
1980 [Enable smartcard support using OpenSC]),
1981 opensc_config_prefix="$withval", opensc_config_prefix="")
1982if test x$opensc_config_prefix != x ; then
1983 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1984 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1985 if test "$OPENSC_CONFIG" != "no"; then
1986 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1987 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1988 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1989 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1990 AC_DEFINE(SMARTCARD)
1991 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11001992 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10001993 fi
1994fi
Damien Miller85de5802001-09-18 14:01:11 +10001995
Darren Tucker5f88d342003-10-15 16:57:57 +10001996# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11001997AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10001998 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10001999 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002000 # Needed by our getrrsetbyname()
2001 AC_SEARCH_LIBS(res_query, resolv)
2002 AC_SEARCH_LIBS(dn_expand, resolv)
2003 AC_CHECK_FUNCS(_getshort _getlong)
2004 AC_CHECK_MEMBER(HEADER.ad,
2005 [AC_DEFINE(HAVE_HEADER_AD)],,
2006 [#include <arpa/nameser.h>])
2007 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002008
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002009# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002010KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002011AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002012 [ --with-kerberos5=PATH Enable Kerberos 5 support],
2013 [
2014 if test "x$withval" != "xno" ; then
2015 if test "x$withval" = "xyes" ; then
2016 KRB5ROOT="/usr/local"
2017 else
2018 KRB5ROOT=${withval}
2019 fi
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002020 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002021 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
2022 AC_DEFINE(KRB5)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002023 KRB5_MSG="yes"
Damien Millera8e06ce2003-11-21 23:48:55 +11002024 AC_MSG_CHECKING(whether we are using Heimdal)
2025 AC_TRY_COMPILE([ #include <krb5.h> ],
2026 [ char *tmp = heimdal_version; ],
2027 [ AC_MSG_RESULT(yes)
2028 AC_DEFINE(HEIMDAL)
2029 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2030 ],
2031 [ AC_MSG_RESULT(no)
2032 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2033 ]
2034 )
2035 if test ! -z "$need_dash_r" ; then
2036 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2037 fi
2038 if test ! -z "$blibpath" ; then
2039 blibpath="$blibpath:${KRB5ROOT}/lib"
2040 fi
Damien Miller200d0a72003-06-30 19:21:36 +10002041 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002042
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002043 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2044 [ AC_DEFINE(GSSAPI)
2045 K5LIBS="-lgssapi $K5LIBS" ],
2046 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2047 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002048 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002049 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2050 $K5LIBS)
2051 ],
2052 $K5LIBS)
2053
2054 AC_CHECK_HEADER(gssapi.h, ,
2055 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002056 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002057 AC_CHECK_HEADERS(gssapi.h, ,
2058 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002059 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002060 ]
2061 )
2062
2063 oldCPP="$CPPFLAGS"
2064 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2065 AC_CHECK_HEADER(gssapi_krb5.h, ,
2066 [ CPPFLAGS="$oldCPP" ])
2067
Damien Millera8e06ce2003-11-21 23:48:55 +11002068 KRB5=yes
2069 fi
2070 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002071)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002072LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002073
Damien Millera22ba012000-03-02 23:09:20 +11002074# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002075
Damien Millerf58c6722002-05-13 13:15:42 +10002076PRIVSEP_PATH=/var/empty
2077AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002078 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002079 [
2080 if test "x$withval" != "$no" ; then
2081 PRIVSEP_PATH=$withval
2082 fi
2083 ]
2084)
2085AC_SUBST(PRIVSEP_PATH)
2086
Damien Millera22ba012000-03-02 23:09:20 +11002087AC_ARG_WITH(xauth,
2088 [ --with-xauth=PATH Specify path to xauth program ],
2089 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002090 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002091 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002092 fi
2093 ],
2094 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002095 TestPath="$PATH"
2096 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2097 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2098 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2099 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2100 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002101 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002102 xauth_path="/usr/openwin/bin/xauth"
2103 fi
2104 ]
2105)
2106
Damien Miller7d901272003-01-13 16:55:22 +11002107STRIP_OPT=-s
2108AC_ARG_ENABLE(strip,
2109 [ --disable-strip Disable calling strip(1) on install],
2110 [
2111 if test "x$enableval" = "xno" ; then
2112 STRIP_OPT=
2113 fi
2114 ]
2115)
2116AC_SUBST(STRIP_OPT)
2117
Damien Millera19cf472000-11-29 13:28:50 +11002118if test -z "$xauth_path" ; then
2119 XAUTH_PATH="undefined"
2120 AC_SUBST(XAUTH_PATH)
2121else
Damien Millera22ba012000-03-02 23:09:20 +11002122 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002123 XAUTH_PATH=$xauth_path
2124 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002125fi
Damien Millera22ba012000-03-02 23:09:20 +11002126
2127# Check for mail directory (last resort if we cannot get it from headers)
2128if test ! -z "$MAIL" ; then
2129 maildir=`dirname $MAIL`
2130 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2131fi
2132
Damien Millera22ba012000-03-02 23:09:20 +11002133if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002134 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002135 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002136 [
2137 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2138 have_dev_ptmx=1
2139 ]
2140 )
2141 fi
Damien Millera22ba012000-03-02 23:09:20 +11002142fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002143AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002144 [
2145 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2146 have_dev_ptc=1
2147 ]
2148)
2149
Damien Millera22ba012000-03-02 23:09:20 +11002150# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002151AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002152 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002153 [
Damien Miller897741e2001-04-16 10:41:46 +10002154 case "$withval" in
2155 man|cat|doc)
2156 MANTYPE=$withval
2157 ;;
2158 *)
2159 AC_MSG_ERROR(invalid man type: $withval)
2160 ;;
2161 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002162 ]
2163)
Ben Lindstrombc709922001-04-18 18:04:21 +00002164if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002165 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2166 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002167 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2168 MANTYPE=doc
2169 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2170 MANTYPE=man
2171 else
2172 MANTYPE=cat
2173 fi
2174fi
Damien Miller670a4b82000-01-22 13:53:11 +11002175AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002176if test "$MANTYPE" = "doc"; then
2177 mansubdir=man;
2178else
2179 mansubdir=$MANTYPE;
2180fi
2181AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002182
Damien Millera22ba012000-03-02 23:09:20 +11002183# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002184MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002185AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002186 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002187 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002188 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002189 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002190 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002191 fi
2192 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002193)
2194
Damien Millera22ba012000-03-02 23:09:20 +11002195# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002196AC_ARG_WITH(shadow,
2197 [ --without-shadow Disable shadow password support],
2198 [
2199 if test "x$withval" = "xno" ; then
2200 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002201 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002202 fi
2203 ]
2204)
2205
Damien Miller1f335fb2000-06-26 11:31:33 +10002206if test -z "$disable_shadow" ; then
2207 AC_MSG_CHECKING([if the systems has expire shadow information])
2208 AC_TRY_COMPILE(
2209 [
2210#include <sys/types.h>
2211#include <shadow.h>
2212 struct spwd sp;
2213 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2214 [ sp_expire_available=yes ], []
2215 )
2216
2217 if test "x$sp_expire_available" = "xyes" ; then
2218 AC_MSG_RESULT(yes)
2219 AC_DEFINE(HAS_SHADOW_EXPIRE)
2220 else
2221 AC_MSG_RESULT(no)
2222 fi
2223fi
2224
Damien Millera22ba012000-03-02 23:09:20 +11002225# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002226if test ! -z "$IPADDR_IN_DISPLAY" ; then
2227 DISPLAY_HACK_MSG="yes"
2228 AC_DEFINE(IPADDR_IN_DISPLAY)
2229else
Damien Millera8e06ce2003-11-21 23:48:55 +11002230 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002231 AC_ARG_WITH(ipaddr-display,
2232 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2233 [
2234 if test "x$withval" != "xno" ; then
2235 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002236 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002237 fi
2238 ]
2239 )
2240fi
Damien Miller76112de1999-12-21 11:18:08 +11002241
Darren Tuckere1a790d2003-09-16 11:52:19 +10002242# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002243AC_ARG_ENABLE(etc-default-login,
2244 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2245[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002246AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2247
2248if test "x$external_path_file" = "x/etc/default/login"; then
2249 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2250fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002251])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002252
Tim Rice43a1c132002-04-17 21:19:14 -07002253dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2254if test $ac_cv_func_login_getcapbool = "yes" -a \
2255 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002256 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002257fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002258
Damien Millera22ba012000-03-02 23:09:20 +11002259# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002260SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002261AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002262 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002263 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002264 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002265 AC_MSG_WARN([
2266--with-default-path=PATH has no effect on this system.
2267Edit /etc/login.conf instead.])
2268 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002269 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002270 AC_MSG_WARN([
2271--with-default-path=PATH will only be used if PATH is not defined in
2272$external_path_file .])
2273 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002274 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002275 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002276 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002277 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002278 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2279 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002280 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002281 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002282 AC_MSG_WARN([
2283If PATH is defined in $external_path_file, ensure the path to scp is included,
2284otherwise scp will not work.])
2285 fi
2286 AC_TRY_RUN(
2287 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002288/* find out what STDPATH is */
2289#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002290#ifdef HAVE_PATHS_H
2291# include <paths.h>
2292#endif
2293#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002294# ifdef _PATH_USERPATH /* Irix */
2295# define _PATH_STDPATH _PATH_USERPATH
2296# else
2297# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2298# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002299#endif
2300#include <sys/types.h>
2301#include <sys/stat.h>
2302#include <fcntl.h>
2303#define DATA "conftest.stdpath"
2304
2305main()
2306{
2307 FILE *fd;
2308 int rc;
2309
2310 fd = fopen(DATA,"w");
2311 if(fd == NULL)
2312 exit(1);
2313
2314 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2315 exit(1);
2316
2317 exit(0);
2318}
2319 ], [ user_path=`cat conftest.stdpath` ],
2320 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2321 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2322 )
2323# make sure $bindir is in USER_PATH so scp will work
2324 t_bindir=`eval echo ${bindir}`
2325 case $t_bindir in
2326 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2327 esac
2328 case $t_bindir in
2329 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2330 esac
2331 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2332 if test $? -ne 0 ; then
2333 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2334 if test $? -ne 0 ; then
2335 user_path=$user_path:$t_bindir
2336 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2337 fi
2338 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002339 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002340)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002341if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002342 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2343 AC_SUBST(user_path)
2344fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002345
Damien Millera18bbd32002-05-13 10:48:57 +10002346# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002347AC_ARG_WITH(superuser-path,
2348 [ --with-superuser-path= Specify different path for super-user],
2349 [
2350 if test "x$withval" != "xno" ; then
2351 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2352 superuser_path=$withval
2353 fi
2354 ]
2355)
2356
2357
Damien Miller61e50f12000-05-08 20:49:37 +10002358AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002359IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002360AC_ARG_WITH(4in6,
2361 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2362 [
2363 if test "x$withval" != "xno" ; then
2364 AC_MSG_RESULT(yes)
2365 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002366 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002367 else
2368 AC_MSG_RESULT(no)
2369 fi
2370 ],[
2371 if test "x$inet6_default_4in6" = "xyes"; then
2372 AC_MSG_RESULT([yes (default)])
2373 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002374 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002375 else
2376 AC_MSG_RESULT([no (default)])
2377 fi
2378 ]
2379)
2380
Damien Miller60396b02001-02-18 17:01:00 +11002381# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002382BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002383AC_ARG_WITH(bsd-auth,
2384 [ --with-bsd-auth Enable BSD auth support],
2385 [
2386 if test "x$withval" != "xno" ; then
2387 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002388 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002389 fi
2390 ]
2391)
2392
Damien Millera22ba012000-03-02 23:09:20 +11002393# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002394piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002395# make sure the directory exists
2396if test ! -d $piddir ; then
2397 piddir=`eval echo ${sysconfdir}`
2398 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002399 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002400 esac
2401fi
2402
Tim Rice88f2ab52002-03-17 12:17:34 -08002403AC_ARG_WITH(pid-dir,
2404 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2405 [
2406 if test "x$withval" != "xno" ; then
2407 piddir=$withval
2408 if test ! -d $piddir ; then
2409 AC_MSG_WARN([** no $piddir directory on this system **])
2410 fi
2411 fi
2412 ]
2413)
2414
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002415AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002416AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002417
andre2ff7b5d2000-06-03 14:57:40 +00002418dnl allow user to disable some login recording features
2419AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002420 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002421 [
2422 if test "x$enableval" = "xno" ; then
2423 AC_DEFINE(DISABLE_LASTLOG)
2424 fi
2425 ]
andre2ff7b5d2000-06-03 14:57:40 +00002426)
2427AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002428 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002429 [
2430 if test "x$enableval" = "xno" ; then
2431 AC_DEFINE(DISABLE_UTMP)
2432 fi
2433 ]
andre2ff7b5d2000-06-03 14:57:40 +00002434)
2435AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002436 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002437 [
2438 if test "x$enableval" = "xno" ; then
2439 AC_DEFINE(DISABLE_UTMPX)
2440 fi
2441 ]
andre2ff7b5d2000-06-03 14:57:40 +00002442)
2443AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002444 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002445 [
2446 if test "x$enableval" = "xno" ; then
2447 AC_DEFINE(DISABLE_WTMP)
2448 fi
2449 ]
andre2ff7b5d2000-06-03 14:57:40 +00002450)
2451AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002452 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002453 [
2454 if test "x$enableval" = "xno" ; then
2455 AC_DEFINE(DISABLE_WTMPX)
2456 fi
2457 ]
andre2ff7b5d2000-06-03 14:57:40 +00002458)
2459AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002460 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002461 [
2462 if test "x$enableval" = "xno" ; then
2463 AC_DEFINE(DISABLE_LOGIN)
2464 fi
2465 ]
andre2ff7b5d2000-06-03 14:57:40 +00002466)
2467AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002468 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002469 [
2470 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002471 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002472 fi
2473 ]
andre2ff7b5d2000-06-03 14:57:40 +00002474)
2475AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002476 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002477 [
2478 if test "x$enableval" = "xno" ; then
2479 AC_DEFINE(DISABLE_PUTUTXLINE)
2480 fi
2481 ]
andre2ff7b5d2000-06-03 14:57:40 +00002482)
2483AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002484 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002485 [
2486 if test "x$withval" = "xno" ; then
2487 AC_DEFINE(DISABLE_LASTLOG)
2488 else
2489 conf_lastlog_location=$withval
2490 fi
2491 ]
2492)
andre2ff7b5d2000-06-03 14:57:40 +00002493
2494dnl lastlog, [uw]tmpx? detection
2495dnl NOTE: set the paths in the platform section to avoid the
2496dnl need for command-line parameters
2497dnl lastlog and [uw]tmp are subject to a file search if all else fails
2498
2499dnl lastlog detection
2500dnl NOTE: the code itself will detect if lastlog is a directory
2501AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2502AC_TRY_COMPILE([
2503#include <sys/types.h>
2504#include <utmp.h>
2505#ifdef HAVE_LASTLOG_H
2506# include <lastlog.h>
2507#endif
Damien Miller2994e082000-06-04 15:51:47 +10002508#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002509# include <paths.h>
2510#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002511#ifdef HAVE_LOGIN_H
2512# include <login.h>
2513#endif
andre2ff7b5d2000-06-03 14:57:40 +00002514 ],
2515 [ char *lastlog = LASTLOG_FILE; ],
2516 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002517 [
2518 AC_MSG_RESULT(no)
2519 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2520 AC_TRY_COMPILE([
2521#include <sys/types.h>
2522#include <utmp.h>
2523#ifdef HAVE_LASTLOG_H
2524# include <lastlog.h>
2525#endif
2526#ifdef HAVE_PATHS_H
2527# include <paths.h>
2528#endif
2529 ],
2530 [ char *lastlog = _PATH_LASTLOG; ],
2531 [ AC_MSG_RESULT(yes) ],
2532 [
andree441aa32000-06-12 22:34:38 +00002533 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002534 system_lastlog_path=no
2535 ])
2536 ]
andre2ff7b5d2000-06-03 14:57:40 +00002537)
Damien Miller2994e082000-06-04 15:51:47 +10002538
andre2ff7b5d2000-06-03 14:57:40 +00002539if test -z "$conf_lastlog_location"; then
2540 if test x"$system_lastlog_path" = x"no" ; then
2541 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002542 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002543 conf_lastlog_location=$f
2544 fi
2545 done
2546 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002547 AC_MSG_WARN([** Cannot find lastlog **])
2548 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002549 fi
2550 fi
2551fi
2552
2553if test -n "$conf_lastlog_location"; then
2554 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2555fi
2556
2557dnl utmp detection
2558AC_MSG_CHECKING([if your system defines UTMP_FILE])
2559AC_TRY_COMPILE([
2560#include <sys/types.h>
2561#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002562#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002563# include <paths.h>
2564#endif
2565 ],
2566 [ char *utmp = UTMP_FILE; ],
2567 [ AC_MSG_RESULT(yes) ],
2568 [ AC_MSG_RESULT(no)
2569 system_utmp_path=no ]
2570)
2571if test -z "$conf_utmp_location"; then
2572 if test x"$system_utmp_path" = x"no" ; then
2573 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2574 if test -f $f ; then
2575 conf_utmp_location=$f
2576 fi
2577 done
2578 if test -z "$conf_utmp_location"; then
2579 AC_DEFINE(DISABLE_UTMP)
2580 fi
2581 fi
2582fi
2583if test -n "$conf_utmp_location"; then
2584 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2585fi
2586
2587dnl wtmp detection
2588AC_MSG_CHECKING([if your system defines WTMP_FILE])
2589AC_TRY_COMPILE([
2590#include <sys/types.h>
2591#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002592#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002593# include <paths.h>
2594#endif
2595 ],
2596 [ char *wtmp = WTMP_FILE; ],
2597 [ AC_MSG_RESULT(yes) ],
2598 [ AC_MSG_RESULT(no)
2599 system_wtmp_path=no ]
2600)
2601if test -z "$conf_wtmp_location"; then
2602 if test x"$system_wtmp_path" = x"no" ; then
2603 for f in /usr/adm/wtmp /var/log/wtmp; do
2604 if test -f $f ; then
2605 conf_wtmp_location=$f
2606 fi
2607 done
2608 if test -z "$conf_wtmp_location"; then
2609 AC_DEFINE(DISABLE_WTMP)
2610 fi
2611 fi
2612fi
2613if test -n "$conf_wtmp_location"; then
2614 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2615fi
2616
2617
2618dnl utmpx detection - I don't know any system so perverse as to require
2619dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2620dnl there, though.
2621AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2622AC_TRY_COMPILE([
2623#include <sys/types.h>
2624#include <utmp.h>
2625#ifdef HAVE_UTMPX_H
2626#include <utmpx.h>
2627#endif
Damien Miller2994e082000-06-04 15:51:47 +10002628#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002629# include <paths.h>
2630#endif
2631 ],
2632 [ char *utmpx = UTMPX_FILE; ],
2633 [ AC_MSG_RESULT(yes) ],
2634 [ AC_MSG_RESULT(no)
2635 system_utmpx_path=no ]
2636)
2637if test -z "$conf_utmpx_location"; then
2638 if test x"$system_utmpx_path" = x"no" ; then
2639 AC_DEFINE(DISABLE_UTMPX)
2640 fi
2641else
2642 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2643fi
2644
2645dnl wtmpx detection
2646AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2647AC_TRY_COMPILE([
2648#include <sys/types.h>
2649#include <utmp.h>
2650#ifdef HAVE_UTMPX_H
2651#include <utmpx.h>
2652#endif
Damien Miller2994e082000-06-04 15:51:47 +10002653#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002654# include <paths.h>
2655#endif
2656 ],
2657 [ char *wtmpx = WTMPX_FILE; ],
2658 [ AC_MSG_RESULT(yes) ],
2659 [ AC_MSG_RESULT(no)
2660 system_wtmpx_path=no ]
2661)
2662if test -z "$conf_wtmpx_location"; then
2663 if test x"$system_wtmpx_path" = x"no" ; then
2664 AC_DEFINE(DISABLE_WTMPX)
2665 fi
2666else
2667 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2668fi
2669
Damien Miller4018c192000-04-30 09:30:44 +10002670
Damien Miller29ea30d2000-03-17 10:54:15 +11002671if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002672 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2673 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002674fi
2675
Tim Rice4cec93f2002-02-26 08:40:48 -08002676dnl remove pam and dl because they are in $LIBPAM
2677if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002678 LIBS=`echo $LIBS | sed 's/-lpam //'`
2679fi
2680if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2681 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002682fi
2683
Damien Millerbac2d8a2000-09-05 16:13:06 +11002684AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002685AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2686AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002687
Damien Miller7b22d652000-06-18 14:07:04 +10002688# Print summary of options
2689
Damien Miller7b22d652000-06-18 14:07:04 +10002690# Someone please show me a better way :)
2691A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2692B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2693C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2694D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002695E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002696F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002697G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002698H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2699I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2700J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002701
2702echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002703echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002704echo " User binaries: $B"
2705echo " System binaries: $C"
2706echo " Configuration files: $D"
2707echo " Askpass program: $E"
2708echo " Manual pages: $F"
2709echo " PID file: $G"
2710echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002711if test "x$external_path_file" = "x/etc/login.conf" ; then
2712echo " At runtime, sshd will use the path defined in $external_path_file"
2713echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002714else
Damien Millerf58c6722002-05-13 13:15:42 +10002715echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002716 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002717echo " (If PATH is set in $external_path_file it will be used instead. If"
2718echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2719 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002720fi
Damien Millera18bbd32002-05-13 10:48:57 +10002721if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002722echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002723fi
Damien Millerf58c6722002-05-13 13:15:42 +10002724echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002725echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002726echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002727echo " KerberosV support: $KRB5_MSG"
2728echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002729echo " S/KEY support: $SKEY_MSG"
2730echo " TCP Wrappers support: $TCPW_MSG"
2731echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002732echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002733echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2734echo " BSD Auth support: $BSD_AUTH_MSG"
2735echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002736if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002737echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002738fi
2739
Damien Miller7b22d652000-06-18 14:07:04 +10002740echo ""
2741
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002742echo " Host: ${host}"
2743echo " Compiler: ${CC}"
2744echo " Compiler flags: ${CFLAGS}"
2745echo "Preprocessor flags: ${CPPFLAGS}"
2746echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002747echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002748
2749echo ""
2750
Damien Miller82cf0ce2000-12-20 13:34:48 +11002751if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002752 echo "PAM is enabled. You may need to install a PAM control file "
2753 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002754 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002755 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002756 echo ""
2757fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002758
Damien Miller6c21c512002-01-22 21:57:53 +11002759if test ! -z "$RAND_HELPER_CMDHASH" ; then
2760 echo "WARNING: you are using the builtin random number collection "
2761 echo "service. Please read WARNING.RNG and request that your OS "
2762 echo "vendor includes kernel-based random number collection in "
2763 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002764 echo ""
2765fi
Damien Miller60396b02001-02-18 17:01:00 +11002766