blob: 5ac6acb38d0d8d4b3c8ea45a83344cfd17a6c2d8 [file] [log] [blame]
Darren Tucker2a6b0292003-12-31 14:59:17 +11001# $Id: configure.ac,v 1.179 2003/12/31 03:59:17 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 \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100752 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000753 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 Tucker2a6b0292003-12-31 14:59:17 +1100786AC_CHECK_FUNCS(setresuid, [
787 dnl Some platorms have setresuid that isn't implemented, test for this
788 AC_MSG_CHECKING(if setresuid seems to work)
789 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100790#include <stdlib.h>
791#include <errno.h>
792int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100793 ],
794 [AC_MSG_RESULT(yes)],
795 [AC_DEFINE(BROKEN_SETRESUID),
796 AC_MSG_RESULT(not implemented)]
797 )
798])
Darren Tuckere937be32003-12-17 18:53:26 +1100799
Darren Tucker2a6b0292003-12-31 14:59:17 +1100800AC_CHECK_FUNCS(setresgid, [
801 dnl Some platorms have setresgid that isn't implemented, test for this
802 AC_MSG_CHECKING(if setresgid seems to work)
803 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100804#include <stdlib.h>
805#include <errno.h>
806int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100807 ],
808 [AC_MSG_RESULT(yes)],
809 [AC_DEFINE(BROKEN_SETRESGID)
810 AC_MSG_RESULT(not implemented)]
811 )
812])
Darren Tuckere937be32003-12-17 18:53:26 +1100813
Damien Millerad833b32000-08-23 10:46:23 +1000814dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000815AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000816dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000817AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000818AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000819dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000820AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000821AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100822
Damien Millera8e06ce2003-11-21 23:48:55 +1100823AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100824 [AC_DEFINE(HAVE_DAEMON)],
825 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
826)
827
Damien Millera8e06ce2003-11-21 23:48:55 +1100828AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100829 [AC_DEFINE(HAVE_GETPAGESIZE)],
830 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
831)
832
Damien Millercb170cb2000-07-01 16:52:55 +1000833# Check for broken snprintf
834if test "x$ac_cv_func_snprintf" = "xyes" ; then
835 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
836 AC_TRY_RUN(
837 [
838#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700839int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000840 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100841 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000842 [
843 AC_MSG_RESULT(no)
844 AC_DEFINE(BROKEN_SNPRINTF)
845 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
846 ]
847 )
848fi
849
Damien Millere8328192003-01-07 15:18:32 +1100850dnl see whether mkstemp() requires XXXXXX
851if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
852AC_MSG_CHECKING([for (overly) strict mkstemp])
853AC_TRY_RUN(
854 [
855#include <stdlib.h>
856main() { char template[]="conftest.mkstemp-test";
857if (mkstemp(template) == -1)
858 exit(1);
859unlink(template); exit(0);
860}
861 ],
862 [
863 AC_MSG_RESULT(no)
864 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100865 [
Damien Millere8328192003-01-07 15:18:32 +1100866 AC_MSG_RESULT(yes)
867 AC_DEFINE(HAVE_STRICT_MKSTEMP)
868 ],
869 [
870 AC_MSG_RESULT(yes)
871 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100872 ]
Damien Millere8328192003-01-07 15:18:32 +1100873)
874fi
875
Darren Tucker70a3d552003-08-21 17:58:29 +1000876dnl make sure that openpty does not reacquire controlling terminal
877if test ! -z "$check_for_openpty_ctty_bug"; then
878 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
879 AC_TRY_RUN(
880 [
881#include <stdio.h>
882#include <sys/fcntl.h>
883#include <sys/types.h>
884#include <sys/wait.h>
885
886int
887main()
888{
889 pid_t pid;
890 int fd, ptyfd, ttyfd, status;
891
892 pid = fork();
893 if (pid < 0) { /* failed */
894 exit(1);
895 } else if (pid > 0) { /* parent */
896 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100897 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000898 exit(WEXITSTATUS(status));
899 else
900 exit(2);
901 } else { /* child */
902 close(0); close(1); close(2);
903 setsid();
904 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
905 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
906 if (fd >= 0)
907 exit(3); /* Acquired ctty: broken */
908 else
909 exit(0); /* Did not acquire ctty: OK */
910 }
911}
912 ],
913 [
914 AC_MSG_RESULT(yes)
915 ],
916 [
917 AC_MSG_RESULT(no)
918 AC_DEFINE(SSHD_ACQUIRES_CTTY)
919 ]
920 )
921fi
922
Damien Miller606f8802000-09-16 15:39:56 +1100923AC_FUNC_GETPGRP
924
Damien Millera64b57a2001-01-17 10:44:13 +1100925# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000926PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100927AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100928 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100929 [
Damien Millera64b57a2001-01-17 10:44:13 +1100930 if test "x$withval" != "xno" ; then
931 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
932 AC_MSG_ERROR([PAM headers not found])
933 fi
934
935 AC_CHECK_LIB(dl, dlopen, , )
936 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
937 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000938 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100939
Damien Millera64b57a2001-01-17 10:44:13 +1100940 PAM_MSG="yes"
941
942 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800943 if test $ac_cv_lib_dl_dlopen = yes; then
944 LIBPAM="-lpam -ldl"
945 else
946 LIBPAM="-lpam"
947 fi
948 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100949 fi
950 ]
951)
Damien Millera22ba012000-03-02 23:09:20 +1100952
Damien Millera64b57a2001-01-17 10:44:13 +1100953# Check for older PAM
954if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100955 # Check PAM strerror arguments (old PAM)
956 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
957 AC_TRY_COMPILE(
958 [
Damien Miller81171112000-04-23 11:14:01 +1000959#include <stdlib.h>
960#include <security/pam_appl.h>
Damien Millera8e06ce2003-11-21 23:48:55 +1100961 ],
962 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +1100963 [AC_MSG_RESULT(no)],
964 [
965 AC_DEFINE(HAVE_OLD_PAM)
966 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000967 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100968 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100969 )
Damien Millera22ba012000-03-02 23:09:20 +1100970fi
971
Damien Millerfc93d4b2002-09-04 23:26:29 +1000972# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
973# because the system crypt() is more featureful.
974if test "x$check_for_libcrypt_before" = "x1"; then
975 AC_CHECK_LIB(crypt, crypt)
976fi
977
Tim Riceaef73712002-05-11 13:17:42 -0700978# Search for OpenSSL
979saved_CPPFLAGS="$CPPFLAGS"
980saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100981AC_ARG_WITH(ssl-dir,
982 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
983 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000984 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700985 if test -d "$withval/lib"; then
986 if test -n "${need_dash_r}"; then
987 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
988 else
989 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
990 fi
991 else
992 if test -n "${need_dash_r}"; then
993 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
994 else
995 LDFLAGS="-L${withval} ${LDFLAGS}"
996 fi
997 fi
998 if test -d "$withval/include"; then
999 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1000 else
1001 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1002 fi
Damien Millera22ba012000-03-02 23:09:20 +11001003 fi
1004 ]
1005)
Tim Riceaef73712002-05-11 13:17:42 -07001006LIBS="$LIBS -lcrypto"
1007AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001008 [
Tim Riceaef73712002-05-11 13:17:42 -07001009 dnl Check default openssl install dir
1010 if test -n "${need_dash_r}"; then
1011 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001012 else
Tim Riceaef73712002-05-11 13:17:42 -07001013 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001014 fi
Tim Riceaef73712002-05-11 13:17:42 -07001015 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1016 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1017 [
1018 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1019 ]
1020 )
1021 ]
1022)
1023
Tim Riced730b782002-08-13 18:52:10 -07001024# Determine OpenSSL header version
1025AC_MSG_CHECKING([OpenSSL header version])
1026AC_TRY_RUN(
1027 [
1028#include <stdio.h>
1029#include <string.h>
1030#include <openssl/opensslv.h>
1031#define DATA "conftest.sslincver"
1032int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001033 FILE *fd;
1034 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001035
Damien Millera8e06ce2003-11-21 23:48:55 +11001036 fd = fopen(DATA,"w");
1037 if(fd == NULL)
1038 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001039
1040 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1041 exit(1);
1042
1043 exit(0);
1044}
1045 ],
1046 [
1047 ssl_header_ver=`cat conftest.sslincver`
1048 AC_MSG_RESULT($ssl_header_ver)
1049 ],
1050 [
1051 AC_MSG_RESULT(not found)
1052 AC_MSG_ERROR(OpenSSL version header not found.)
1053 ]
1054)
1055
1056# Determine OpenSSL library version
1057AC_MSG_CHECKING([OpenSSL library version])
1058AC_TRY_RUN(
1059 [
1060#include <stdio.h>
1061#include <string.h>
1062#include <openssl/opensslv.h>
1063#include <openssl/crypto.h>
1064#define DATA "conftest.ssllibver"
1065int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001066 FILE *fd;
1067 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001068
Damien Millera8e06ce2003-11-21 23:48:55 +11001069 fd = fopen(DATA,"w");
1070 if(fd == NULL)
1071 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001072
1073 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1074 exit(1);
1075
1076 exit(0);
1077}
1078 ],
1079 [
1080 ssl_library_ver=`cat conftest.ssllibver`
1081 AC_MSG_RESULT($ssl_library_ver)
1082 ],
1083 [
1084 AC_MSG_RESULT(not found)
1085 AC_MSG_ERROR(OpenSSL library not found.)
1086 ]
1087)
Damien Millera22ba012000-03-02 23:09:20 +11001088
Damien Millerec932372002-01-22 22:16:03 +11001089# Sanity check OpenSSL headers
1090AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1091AC_TRY_RUN(
1092 [
1093#include <string.h>
1094#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001095int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001096 ],
1097 [
1098 AC_MSG_RESULT(yes)
1099 ],
1100 [
1101 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001102 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1103Check config.log for details.
1104Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001105 ]
1106)
1107
Damien Millera8e06ce2003-11-21 23:48:55 +11001108# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001109# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001110if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001111 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001112fi
1113
Damien Miller6c21c512002-01-22 21:57:53 +11001114
1115### Configure cryptographic random number support
1116
1117# Check wheter OpenSSL seeds itself
1118AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1119AC_TRY_RUN(
1120 [
1121#include <string.h>
1122#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001123int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001124 ],
1125 [
1126 OPENSSL_SEEDS_ITSELF=yes
1127 AC_MSG_RESULT(yes)
1128 ],
1129 [
1130 AC_MSG_RESULT(no)
1131 # Default to use of the rand helper if OpenSSL doesn't
1132 # seed itself
1133 USE_RAND_HELPER=yes
1134 ]
1135)
1136
1137
1138# Do we want to force the use of the rand helper?
1139AC_ARG_WITH(rand-helper,
1140 [ --with-rand-helper Use subprocess to gather strong randomness ],
1141 [
1142 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001143 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001144 # the previous test showed it to be unseeded.
1145 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1146 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1147 OPENSSL_SEEDS_ITSELF=yes
1148 USE_RAND_HELPER=""
1149 fi
1150 else
1151 USE_RAND_HELPER=yes
1152 fi
1153 ],
1154)
1155
1156# Which randomness source do we use?
1157if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1158 # OpenSSL only
1159 AC_DEFINE(OPENSSL_PRNG_ONLY)
1160 RAND_MSG="OpenSSL internal ONLY"
1161 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001162elif test ! -z "$USE_RAND_HELPER" ; then
1163 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001164 RAND_MSG="ssh-rand-helper"
1165 INSTALL_SSH_RAND_HELPER="yes"
1166fi
1167AC_SUBST(INSTALL_SSH_RAND_HELPER)
1168
1169### Configuration of ssh-rand-helper
1170
1171# PRNGD TCP socket
1172AC_ARG_WITH(prngd-port,
1173 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1174 [
Damien Millere996d722002-01-23 11:20:59 +11001175 case "$withval" in
1176 no)
1177 withval=""
1178 ;;
1179 [[0-9]]*)
1180 ;;
1181 *)
1182 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1183 ;;
1184 esac
1185 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001186 PRNGD_PORT="$withval"
1187 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1188 fi
1189 ]
1190)
1191
1192# PRNGD Unix domain socket
1193AC_ARG_WITH(prngd-socket,
1194 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1195 [
Damien Millere996d722002-01-23 11:20:59 +11001196 case "$withval" in
1197 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001198 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001199 ;;
1200 no)
1201 withval=""
1202 ;;
1203 /*)
1204 ;;
1205 *)
1206 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1207 ;;
1208 esac
1209
1210 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001211 if test ! -z "$PRNGD_PORT" ; then
1212 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1213 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001214 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001215 AC_MSG_WARN(Entropy socket is not readable)
1216 fi
1217 PRNGD_SOCKET="$withval"
1218 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1219 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001220 ],
1221 [
1222 # Check for existing socket only if we don't have a random device already
1223 if test "$USE_RAND_HELPER" = yes ; then
1224 AC_MSG_CHECKING(for PRNGD/EGD socket)
1225 # Insert other locations here
1226 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1227 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1228 PRNGD_SOCKET="$sock"
1229 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1230 break;
1231 fi
1232 done
1233 if test ! -z "$PRNGD_SOCKET" ; then
1234 AC_MSG_RESULT($PRNGD_SOCKET)
1235 else
1236 AC_MSG_RESULT(not found)
1237 fi
1238 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001239 ]
1240)
1241
1242# Change default command timeout for hashing entropy source
1243entropy_timeout=200
1244AC_ARG_WITH(entropy-timeout,
1245 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1246 [
1247 if test "x$withval" != "xno" ; then
1248 entropy_timeout=$withval
1249 fi
1250 ]
1251)
Damien Miller6c21c512002-01-22 21:57:53 +11001252AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1253
Damien Millerd3f6ad22002-06-25 10:24:47 +10001254SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001255AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001256 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001257 [
1258 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001259 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001260 fi
1261 ]
1262)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001263AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1264AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001265
Tim Rice88f2ab52002-03-17 12:17:34 -08001266# We do this little dance with the search path to insure
1267# that programs that we select for use by installed programs
1268# (which may be run by the super-user) come from trusted
1269# locations before they come from the user's private area.
1270# This should help avoid accidentally configuring some
1271# random version of a program in someone's personal bin.
1272
1273OPATH=$PATH
1274PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001275test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001276test -d /sbin && PATH=$PATH:/sbin
1277test -d /usr/sbin && PATH=$PATH:/usr/sbin
1278PATH=$PATH:/etc:$OPATH
1279
Damien Millera8e06ce2003-11-21 23:48:55 +11001280# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001281OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1282OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1283OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1284OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1285OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1286OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1287OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1288OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1289OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1290OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1291OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1292OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1293OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1294OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1295OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1296OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001297# restore PATH
1298PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001299
1300# Where does ssh-rand-helper get its randomness from?
1301INSTALL_SSH_PRNG_CMDS=""
1302if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1303 if test ! -z "$PRNGD_PORT" ; then
1304 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1305 elif test ! -z "$PRNGD_SOCKET" ; then
1306 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1307 else
1308 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1309 RAND_HELPER_CMDHASH=yes
1310 INSTALL_SSH_PRNG_CMDS="yes"
1311 fi
1312fi
1313AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1314
1315
Ben Lindstromb5628642000-10-18 00:02:25 +00001316# Cheap hack to ensure NEWS-OS libraries are arranged right.
1317if test ! -z "$SONY" ; then
1318 LIBS="$LIBS -liberty";
1319fi
1320
Damien Millera22ba012000-03-02 23:09:20 +11001321# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001322AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001323AC_CHECK_SIZEOF(short int, 2)
1324AC_CHECK_SIZEOF(int, 4)
1325AC_CHECK_SIZEOF(long int, 4)
1326AC_CHECK_SIZEOF(long long int, 8)
1327
Damien Millerfa2bb692002-04-23 23:22:25 +10001328# Sanity check long long for some platforms (AIX)
1329if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1330 ac_cv_sizeof_long_long_int=0
1331fi
1332
Damien Millera22ba012000-03-02 23:09:20 +11001333# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001334AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1335 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001336 [ #include <sys/types.h> ],
1337 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001338 [ ac_cv_have_u_int="yes" ],
1339 [ ac_cv_have_u_int="no" ]
1340 )
1341])
1342if test "x$ac_cv_have_u_int" = "xyes" ; then
1343 AC_DEFINE(HAVE_U_INT)
1344 have_u_int=1
1345fi
1346
Damien Miller61e50f12000-05-08 20:49:37 +10001347AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1348 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001349 [ #include <sys/types.h> ],
1350 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001351 [ ac_cv_have_intxx_t="yes" ],
1352 [ ac_cv_have_intxx_t="no" ]
1353 )
1354])
1355if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1356 AC_DEFINE(HAVE_INTXX_T)
1357 have_intxx_t=1
1358fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001359
1360if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001361 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001362then
1363 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1364 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001365 [ #include <stdint.h> ],
1366 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001367 [
1368 AC_DEFINE(HAVE_INTXX_T)
1369 AC_MSG_RESULT(yes)
1370 ],
1371 [ AC_MSG_RESULT(no) ]
1372 )
1373fi
1374
Damien Miller578783e2000-09-23 14:12:24 +11001375AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1376 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001377 [
1378#include <sys/types.h>
1379#ifdef HAVE_STDINT_H
1380# include <stdint.h>
1381#endif
1382#include <sys/socket.h>
1383#ifdef HAVE_SYS_BITYPES_H
1384# include <sys/bitypes.h>
1385#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001386 ],
1387 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001388 [ ac_cv_have_int64_t="yes" ],
1389 [ ac_cv_have_int64_t="no" ]
1390 )
1391])
1392if test "x$ac_cv_have_int64_t" = "xyes" ; then
1393 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001394fi
1395
Damien Miller61e50f12000-05-08 20:49:37 +10001396AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1397 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001398 [ #include <sys/types.h> ],
1399 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001400 [ ac_cv_have_u_intxx_t="yes" ],
1401 [ ac_cv_have_u_intxx_t="no" ]
1402 )
1403])
1404if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1405 AC_DEFINE(HAVE_U_INTXX_T)
1406 have_u_intxx_t=1
1407fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001408
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001409if test -z "$have_u_intxx_t" ; then
1410 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1411 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001412 [ #include <sys/socket.h> ],
1413 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001414 [
1415 AC_DEFINE(HAVE_U_INTXX_T)
1416 AC_MSG_RESULT(yes)
1417 ],
1418 [ AC_MSG_RESULT(no) ]
1419 )
1420fi
1421
Damien Miller578783e2000-09-23 14:12:24 +11001422AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1423 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001424 [ #include <sys/types.h> ],
1425 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001426 [ ac_cv_have_u_int64_t="yes" ],
1427 [ ac_cv_have_u_int64_t="no" ]
1428 )
1429])
1430if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1431 AC_DEFINE(HAVE_U_INT64_T)
1432 have_u_int64_t=1
1433fi
1434
Tim Rice4cec93f2002-02-26 08:40:48 -08001435if test -z "$have_u_int64_t" ; then
1436 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1437 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001438 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001439 [ u_int64_t a; a = 1],
1440 [
1441 AC_DEFINE(HAVE_U_INT64_T)
1442 AC_MSG_RESULT(yes)
1443 ],
1444 [ AC_MSG_RESULT(no) ]
1445 )
1446fi
1447
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001448if test -z "$have_u_intxx_t" ; then
1449 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1450 AC_TRY_COMPILE(
1451 [
1452#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001453 ],
1454 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001455 [ ac_cv_have_uintxx_t="yes" ],
1456 [ ac_cv_have_uintxx_t="no" ]
1457 )
1458 ])
1459 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1460 AC_DEFINE(HAVE_UINTXX_T)
1461 fi
1462fi
1463
1464if test -z "$have_uintxx_t" ; then
1465 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1466 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001467 [ #include <stdint.h> ],
1468 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001469 [
1470 AC_DEFINE(HAVE_UINTXX_T)
1471 AC_MSG_RESULT(yes)
1472 ],
1473 [ AC_MSG_RESULT(no) ]
1474 )
1475fi
1476
Damien Milleredb82922000-06-20 13:25:52 +10001477if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001478 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001479then
1480 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1481 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001482 [
1483#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001484 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001485 [
Damien Miller70494d12000-04-03 15:57:06 +10001486 int8_t a; int16_t b; int32_t c;
1487 u_int8_t e; u_int16_t f; u_int32_t g;
1488 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001489 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001490 [
1491 AC_DEFINE(HAVE_U_INTXX_T)
1492 AC_DEFINE(HAVE_INTXX_T)
1493 AC_MSG_RESULT(yes)
1494 ],
1495 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001496 )
Damien Millerb29ea912000-01-15 14:12:03 +11001497fi
1498
Damien Miller58be7382001-09-15 21:31:54 +10001499
1500AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1501 AC_TRY_COMPILE(
1502 [
1503#include <sys/types.h>
1504 ],
1505 [ u_char foo; foo = 125; ],
1506 [ ac_cv_have_u_char="yes" ],
1507 [ ac_cv_have_u_char="no" ]
1508 )
1509])
1510if test "x$ac_cv_have_u_char" = "xyes" ; then
1511 AC_DEFINE(HAVE_U_CHAR)
1512fi
1513
Tim Rice13aae5e2001-10-21 17:53:58 -07001514TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001515
Tim Rice200a5c02002-02-26 22:12:34 -08001516AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001517
Damien Miller61e50f12000-05-08 20:49:37 +10001518AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1519 AC_TRY_COMPILE(
1520 [
1521#include <sys/types.h>
1522 ],
1523 [ size_t foo; foo = 1235; ],
1524 [ ac_cv_have_size_t="yes" ],
1525 [ ac_cv_have_size_t="no" ]
1526 )
1527])
1528if test "x$ac_cv_have_size_t" = "xyes" ; then
1529 AC_DEFINE(HAVE_SIZE_T)
1530fi
Damien Miller95058511999-12-29 10:36:45 +11001531
Damien Miller615f9392000-05-17 22:53:33 +10001532AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1533 AC_TRY_COMPILE(
1534 [
1535#include <sys/types.h>
1536 ],
1537 [ ssize_t foo; foo = 1235; ],
1538 [ ac_cv_have_ssize_t="yes" ],
1539 [ ac_cv_have_ssize_t="no" ]
1540 )
1541])
1542if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1543 AC_DEFINE(HAVE_SSIZE_T)
1544fi
1545
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001546AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1547 AC_TRY_COMPILE(
1548 [
1549#include <time.h>
1550 ],
1551 [ clock_t foo; foo = 1235; ],
1552 [ ac_cv_have_clock_t="yes" ],
1553 [ ac_cv_have_clock_t="no" ]
1554 )
1555])
1556if test "x$ac_cv_have_clock_t" = "xyes" ; then
1557 AC_DEFINE(HAVE_CLOCK_T)
1558fi
1559
Damien Millerb54b40e2000-06-23 08:23:34 +10001560AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1561 AC_TRY_COMPILE(
1562 [
1563#include <sys/types.h>
1564#include <sys/socket.h>
1565 ],
1566 [ sa_family_t foo; foo = 1235; ],
1567 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001568 [ AC_TRY_COMPILE(
1569 [
1570#include <sys/types.h>
1571#include <sys/socket.h>
1572#include <netinet/in.h>
1573 ],
1574 [ sa_family_t foo; foo = 1235; ],
1575 [ ac_cv_have_sa_family_t="yes" ],
1576
Damien Millerb54b40e2000-06-23 08:23:34 +10001577 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001578 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001579 )
1580])
1581if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1582 AC_DEFINE(HAVE_SA_FAMILY_T)
1583fi
1584
Damien Miller0f91b4e2000-06-18 15:43:25 +10001585AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1586 AC_TRY_COMPILE(
1587 [
1588#include <sys/types.h>
1589 ],
1590 [ pid_t foo; foo = 1235; ],
1591 [ ac_cv_have_pid_t="yes" ],
1592 [ ac_cv_have_pid_t="no" ]
1593 )
1594])
1595if test "x$ac_cv_have_pid_t" = "xyes" ; then
1596 AC_DEFINE(HAVE_PID_T)
1597fi
1598
1599AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1600 AC_TRY_COMPILE(
1601 [
1602#include <sys/types.h>
1603 ],
1604 [ mode_t foo; foo = 1235; ],
1605 [ ac_cv_have_mode_t="yes" ],
1606 [ ac_cv_have_mode_t="no" ]
1607 )
1608])
1609if test "x$ac_cv_have_mode_t" = "xyes" ; then
1610 AC_DEFINE(HAVE_MODE_T)
1611fi
1612
Damien Miller61e50f12000-05-08 20:49:37 +10001613
1614AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1615 AC_TRY_COMPILE(
1616 [
Damien Miller81171112000-04-23 11:14:01 +10001617#include <sys/types.h>
1618#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001619 ],
1620 [ struct sockaddr_storage s; ],
1621 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1622 [ ac_cv_have_struct_sockaddr_storage="no" ]
1623 )
1624])
1625if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1626 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1627fi
Damien Miller34132e52000-01-14 15:45:46 +11001628
Damien Miller61e50f12000-05-08 20:49:37 +10001629AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1630 AC_TRY_COMPILE(
1631 [
Damien Miller7b22d652000-06-18 14:07:04 +10001632#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001633#include <netinet/in.h>
1634 ],
1635 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1636 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1637 [ ac_cv_have_struct_sockaddr_in6="no" ]
1638 )
1639])
1640if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1641 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1642fi
Damien Miller34132e52000-01-14 15:45:46 +11001643
Damien Miller61e50f12000-05-08 20:49:37 +10001644AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1645 AC_TRY_COMPILE(
1646 [
Damien Miller7b22d652000-06-18 14:07:04 +10001647#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001648#include <netinet/in.h>
1649 ],
1650 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1651 [ ac_cv_have_struct_in6_addr="yes" ],
1652 [ ac_cv_have_struct_in6_addr="no" ]
1653 )
1654])
1655if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1656 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1657fi
Damien Miller34132e52000-01-14 15:45:46 +11001658
Damien Miller61e50f12000-05-08 20:49:37 +10001659AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1660 AC_TRY_COMPILE(
1661 [
Damien Miller81171112000-04-23 11:14:01 +10001662#include <sys/types.h>
1663#include <sys/socket.h>
1664#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001665 ],
1666 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1667 [ ac_cv_have_struct_addrinfo="yes" ],
1668 [ ac_cv_have_struct_addrinfo="no" ]
1669 )
1670])
1671if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1672 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1673fi
1674
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001675AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1676 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001677 [ #include <sys/time.h> ],
1678 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001679 [ ac_cv_have_struct_timeval="yes" ],
1680 [ ac_cv_have_struct_timeval="no" ]
1681 )
1682])
1683if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1684 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1685 have_struct_timeval=1
1686fi
1687
Tim Rice4e4dc562003-03-18 10:21:40 -08001688AC_CHECK_TYPES(struct timespec)
1689
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001690# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001691if test "x$ac_cv_have_int64_t" = "xno" -a \
1692 "x$ac_cv_sizeof_long_int" != "x8" -a \
1693 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001694 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1695 echo "an alternative compiler (I.E., GCC) before continuing."
1696 echo ""
1697 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001698else
1699dnl test snprintf (broken on SCO w/gcc)
1700 AC_TRY_RUN(
1701 [
1702#include <stdio.h>
1703#include <string.h>
1704#ifdef HAVE_SNPRINTF
1705main()
1706{
1707 char buf[50];
1708 char expected_out[50];
1709 int mazsize = 50 ;
1710#if (SIZEOF_LONG_INT == 8)
1711 long int num = 0x7fffffffffffffff;
1712#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001713 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001714#endif
1715 strcpy(expected_out, "9223372036854775807");
1716 snprintf(buf, mazsize, "%lld", num);
1717 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001718 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001719 exit(0);
1720}
1721#else
1722main() { exit(0); }
1723#endif
1724 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1725 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001726fi
1727
Damien Miller78315eb2000-09-29 23:01:36 +11001728dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001729OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1730OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1731OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1732OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1733OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001734OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001735OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1736OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001737OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001738OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1739OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1740OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1741OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001742OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1743OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1744OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1745OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001746
1747AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001748
Damien Miller61e50f12000-05-08 20:49:37 +10001749AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1750 ac_cv_have_ss_family_in_struct_ss, [
1751 AC_TRY_COMPILE(
1752 [
Damien Miller81171112000-04-23 11:14:01 +10001753#include <sys/types.h>
1754#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001755 ],
1756 [ struct sockaddr_storage s; s.ss_family = 1; ],
1757 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1758 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1759 )
1760])
1761if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1762 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1763fi
1764
Damien Miller61e50f12000-05-08 20:49:37 +10001765AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1766 ac_cv_have___ss_family_in_struct_ss, [
1767 AC_TRY_COMPILE(
1768 [
Damien Miller81171112000-04-23 11:14:01 +10001769#include <sys/types.h>
1770#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001771 ],
1772 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1773 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1774 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1775 )
1776])
1777if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1778 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1779fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001780
Damien Millerad833b32000-08-23 10:46:23 +10001781AC_CACHE_CHECK([for pw_class field in struct passwd],
1782 ac_cv_have_pw_class_in_struct_passwd, [
1783 AC_TRY_COMPILE(
1784 [
Damien Millerad833b32000-08-23 10:46:23 +10001785#include <pwd.h>
1786 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001787 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001788 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1789 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1790 )
1791])
1792if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1793 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1794fi
1795
Kevin Steves82456952001-06-22 21:14:18 +00001796AC_CACHE_CHECK([for pw_expire field in struct passwd],
1797 ac_cv_have_pw_expire_in_struct_passwd, [
1798 AC_TRY_COMPILE(
1799 [
1800#include <pwd.h>
1801 ],
1802 [ struct passwd p; p.pw_expire = 0; ],
1803 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1804 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1805 )
1806])
1807if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1808 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1809fi
1810
1811AC_CACHE_CHECK([for pw_change field in struct passwd],
1812 ac_cv_have_pw_change_in_struct_passwd, [
1813 AC_TRY_COMPILE(
1814 [
1815#include <pwd.h>
1816 ],
1817 [ struct passwd p; p.pw_change = 0; ],
1818 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1819 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1820 )
1821])
1822if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1823 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1824fi
Damien Miller61e50f12000-05-08 20:49:37 +10001825
Tim Rice28bbb0c2002-05-27 17:37:32 -07001826dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001827AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1828 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001829 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001830 [
Tim Riceae49fe62002-04-12 10:26:21 -07001831#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001832#include <sys/socket.h>
1833#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001834int main() {
1835#ifdef msg_accrights
1836exit(1);
1837#endif
1838struct msghdr m;
1839m.msg_accrights = 0;
1840exit(0);
1841}
Kevin Steves939c9db2002-03-22 17:23:25 +00001842 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001843 [ ac_cv_have_accrights_in_msghdr="yes" ],
1844 [ ac_cv_have_accrights_in_msghdr="no" ]
1845 )
1846])
1847if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1848 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1849fi
1850
Kevin Stevesa44e0352002-04-07 16:18:03 +00001851AC_CACHE_CHECK([for msg_control field in struct msghdr],
1852 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001853 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001854 [
Tim Riceae49fe62002-04-12 10:26:21 -07001855#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001856#include <sys/socket.h>
1857#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001858int main() {
1859#ifdef msg_control
1860exit(1);
1861#endif
1862struct msghdr m;
1863m.msg_control = 0;
1864exit(0);
1865}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001866 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001867 [ ac_cv_have_control_in_msghdr="yes" ],
1868 [ ac_cv_have_control_in_msghdr="no" ]
1869 )
1870])
1871if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1872 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1873fi
1874
Damien Miller61e50f12000-05-08 20:49:37 +10001875AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001876 AC_TRY_LINK([],
1877 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001878 [ ac_cv_libc_defines___progname="yes" ],
1879 [ ac_cv_libc_defines___progname="no" ]
1880 )
1881])
1882if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1883 AC_DEFINE(HAVE___PROGNAME)
1884fi
1885
Kevin Steves4846f4a2002-03-22 18:19:53 +00001886AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1887 AC_TRY_LINK([
1888#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001889],
1890 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001891 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1892 [ ac_cv_cc_implements___FUNCTION__="no" ]
1893 )
1894])
1895if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1896 AC_DEFINE(HAVE___FUNCTION__)
1897fi
1898
1899AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1900 AC_TRY_LINK([
1901#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001902],
1903 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001904 [ ac_cv_cc_implements___func__="yes" ],
1905 [ ac_cv_cc_implements___func__="no" ]
1906 )
1907])
1908if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1909 AC_DEFINE(HAVE___func__)
1910fi
1911
Damien Miller4f8e6692001-07-14 13:22:53 +10001912AC_CACHE_CHECK([whether getopt has optreset support],
1913 ac_cv_have_getopt_optreset, [
1914 AC_TRY_LINK(
1915 [
1916#include <getopt.h>
1917 ],
1918 [ extern int optreset; optreset = 0; ],
1919 [ ac_cv_have_getopt_optreset="yes" ],
1920 [ ac_cv_have_getopt_optreset="no" ]
1921 )
1922])
1923if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1924 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1925fi
Damien Millera22ba012000-03-02 23:09:20 +11001926
Damien Millerecbb26d2000-07-15 14:59:14 +10001927AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001928 AC_TRY_LINK([],
1929 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001930 [ ac_cv_libc_defines_sys_errlist="yes" ],
1931 [ ac_cv_libc_defines_sys_errlist="no" ]
1932 )
1933])
1934if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1935 AC_DEFINE(HAVE_SYS_ERRLIST)
1936fi
1937
1938
Damien Miller11fa2cc2000-08-16 10:35:58 +10001939AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001940 AC_TRY_LINK([],
1941 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001942 [ ac_cv_libc_defines_sys_nerr="yes" ],
1943 [ ac_cv_libc_defines_sys_nerr="no" ]
1944 )
1945])
1946if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1947 AC_DEFINE(HAVE_SYS_NERR)
1948fi
1949
Damien Millera8e06ce2003-11-21 23:48:55 +11001950SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001951# Check whether user wants sectok support
1952AC_ARG_WITH(sectok,
1953 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001954 [
1955 if test "x$withval" != "xno" ; then
1956 if test "x$withval" != "xyes" ; then
1957 CPPFLAGS="$CPPFLAGS -I${withval}"
1958 LDFLAGS="$LDFLAGS -L${withval}"
1959 if test ! -z "$need_dash_r" ; then
1960 LDFLAGS="$LDFLAGS -R${withval}"
1961 fi
1962 if test ! -z "$blibpath" ; then
1963 blibpath="$blibpath:${withval}"
1964 fi
1965 fi
1966 AC_CHECK_HEADERS(sectok.h)
1967 if test "$ac_cv_header_sectok_h" != yes; then
1968 AC_MSG_ERROR(Can't find sectok.h)
1969 fi
1970 AC_CHECK_LIB(sectok, sectok_open)
1971 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1972 AC_MSG_ERROR(Can't find libsectok)
1973 fi
1974 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001975 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11001976 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001977 fi
1978 ]
1979)
1980
1981# Check whether user wants OpenSC support
1982AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001983 AC_HELP_STRING([--with-opensc=PFX],
1984 [Enable smartcard support using OpenSC]),
1985 opensc_config_prefix="$withval", opensc_config_prefix="")
1986if test x$opensc_config_prefix != x ; then
1987 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1988 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1989 if test "$OPENSC_CONFIG" != "no"; then
1990 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1991 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1992 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1993 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1994 AC_DEFINE(SMARTCARD)
1995 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11001996 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10001997 fi
1998fi
Damien Miller85de5802001-09-18 14:01:11 +10001999
Darren Tucker5f88d342003-10-15 16:57:57 +10002000# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002001AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002002 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002003 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002004 # Needed by our getrrsetbyname()
2005 AC_SEARCH_LIBS(res_query, resolv)
2006 AC_SEARCH_LIBS(dn_expand, resolv)
2007 AC_CHECK_FUNCS(_getshort _getlong)
2008 AC_CHECK_MEMBER(HEADER.ad,
2009 [AC_DEFINE(HAVE_HEADER_AD)],,
2010 [#include <arpa/nameser.h>])
2011 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002012
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002013# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002014KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002015AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002016 [ --with-kerberos5=PATH Enable Kerberos 5 support],
2017 [
2018 if test "x$withval" != "xno" ; then
2019 if test "x$withval" = "xyes" ; then
2020 KRB5ROOT="/usr/local"
2021 else
2022 KRB5ROOT=${withval}
2023 fi
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002024 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002025 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
2026 AC_DEFINE(KRB5)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002027 KRB5_MSG="yes"
Damien Millera8e06ce2003-11-21 23:48:55 +11002028 AC_MSG_CHECKING(whether we are using Heimdal)
2029 AC_TRY_COMPILE([ #include <krb5.h> ],
2030 [ char *tmp = heimdal_version; ],
2031 [ AC_MSG_RESULT(yes)
2032 AC_DEFINE(HEIMDAL)
2033 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2034 ],
2035 [ AC_MSG_RESULT(no)
2036 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2037 ]
2038 )
2039 if test ! -z "$need_dash_r" ; then
2040 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2041 fi
2042 if test ! -z "$blibpath" ; then
2043 blibpath="$blibpath:${KRB5ROOT}/lib"
2044 fi
Damien Miller200d0a72003-06-30 19:21:36 +10002045 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002046
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002047 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2048 [ AC_DEFINE(GSSAPI)
2049 K5LIBS="-lgssapi $K5LIBS" ],
2050 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2051 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002052 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002053 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2054 $K5LIBS)
2055 ],
2056 $K5LIBS)
2057
2058 AC_CHECK_HEADER(gssapi.h, ,
2059 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002060 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002061 AC_CHECK_HEADERS(gssapi.h, ,
2062 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002063 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002064 ]
2065 )
2066
2067 oldCPP="$CPPFLAGS"
2068 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2069 AC_CHECK_HEADER(gssapi_krb5.h, ,
2070 [ CPPFLAGS="$oldCPP" ])
2071
Damien Millera8e06ce2003-11-21 23:48:55 +11002072 KRB5=yes
2073 fi
2074 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002075)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002076LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002077
Damien Millera22ba012000-03-02 23:09:20 +11002078# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002079
Damien Millerf58c6722002-05-13 13:15:42 +10002080PRIVSEP_PATH=/var/empty
2081AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002082 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002083 [
2084 if test "x$withval" != "$no" ; then
2085 PRIVSEP_PATH=$withval
2086 fi
2087 ]
2088)
2089AC_SUBST(PRIVSEP_PATH)
2090
Damien Millera22ba012000-03-02 23:09:20 +11002091AC_ARG_WITH(xauth,
2092 [ --with-xauth=PATH Specify path to xauth program ],
2093 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002094 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002095 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002096 fi
2097 ],
2098 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002099 TestPath="$PATH"
2100 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2101 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2102 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2103 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2104 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002105 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002106 xauth_path="/usr/openwin/bin/xauth"
2107 fi
2108 ]
2109)
2110
Damien Miller7d901272003-01-13 16:55:22 +11002111STRIP_OPT=-s
2112AC_ARG_ENABLE(strip,
2113 [ --disable-strip Disable calling strip(1) on install],
2114 [
2115 if test "x$enableval" = "xno" ; then
2116 STRIP_OPT=
2117 fi
2118 ]
2119)
2120AC_SUBST(STRIP_OPT)
2121
Damien Millera19cf472000-11-29 13:28:50 +11002122if test -z "$xauth_path" ; then
2123 XAUTH_PATH="undefined"
2124 AC_SUBST(XAUTH_PATH)
2125else
Damien Millera22ba012000-03-02 23:09:20 +11002126 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002127 XAUTH_PATH=$xauth_path
2128 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002129fi
Damien Millera22ba012000-03-02 23:09:20 +11002130
2131# Check for mail directory (last resort if we cannot get it from headers)
2132if test ! -z "$MAIL" ; then
2133 maildir=`dirname $MAIL`
2134 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2135fi
2136
Damien Millera22ba012000-03-02 23:09:20 +11002137if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002138 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002139 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002140 [
2141 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2142 have_dev_ptmx=1
2143 ]
2144 )
2145 fi
Damien Millera22ba012000-03-02 23:09:20 +11002146fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002147AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002148 [
2149 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2150 have_dev_ptc=1
2151 ]
2152)
2153
Damien Millera22ba012000-03-02 23:09:20 +11002154# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002155AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002156 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002157 [
Damien Miller897741e2001-04-16 10:41:46 +10002158 case "$withval" in
2159 man|cat|doc)
2160 MANTYPE=$withval
2161 ;;
2162 *)
2163 AC_MSG_ERROR(invalid man type: $withval)
2164 ;;
2165 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002166 ]
2167)
Ben Lindstrombc709922001-04-18 18:04:21 +00002168if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002169 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2170 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002171 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2172 MANTYPE=doc
2173 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2174 MANTYPE=man
2175 else
2176 MANTYPE=cat
2177 fi
2178fi
Damien Miller670a4b82000-01-22 13:53:11 +11002179AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002180if test "$MANTYPE" = "doc"; then
2181 mansubdir=man;
2182else
2183 mansubdir=$MANTYPE;
2184fi
2185AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002186
Damien Millera22ba012000-03-02 23:09:20 +11002187# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002188MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002189AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002190 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002191 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002192 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002193 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002194 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002195 fi
2196 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002197)
2198
Damien Millera22ba012000-03-02 23:09:20 +11002199# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002200AC_ARG_WITH(shadow,
2201 [ --without-shadow Disable shadow password support],
2202 [
2203 if test "x$withval" = "xno" ; then
2204 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002205 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002206 fi
2207 ]
2208)
2209
Damien Miller1f335fb2000-06-26 11:31:33 +10002210if test -z "$disable_shadow" ; then
2211 AC_MSG_CHECKING([if the systems has expire shadow information])
2212 AC_TRY_COMPILE(
2213 [
2214#include <sys/types.h>
2215#include <shadow.h>
2216 struct spwd sp;
2217 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2218 [ sp_expire_available=yes ], []
2219 )
2220
2221 if test "x$sp_expire_available" = "xyes" ; then
2222 AC_MSG_RESULT(yes)
2223 AC_DEFINE(HAS_SHADOW_EXPIRE)
2224 else
2225 AC_MSG_RESULT(no)
2226 fi
2227fi
2228
Damien Millera22ba012000-03-02 23:09:20 +11002229# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002230if test ! -z "$IPADDR_IN_DISPLAY" ; then
2231 DISPLAY_HACK_MSG="yes"
2232 AC_DEFINE(IPADDR_IN_DISPLAY)
2233else
Damien Millera8e06ce2003-11-21 23:48:55 +11002234 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002235 AC_ARG_WITH(ipaddr-display,
2236 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2237 [
2238 if test "x$withval" != "xno" ; then
2239 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002240 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002241 fi
2242 ]
2243 )
2244fi
Damien Miller76112de1999-12-21 11:18:08 +11002245
Darren Tuckere1a790d2003-09-16 11:52:19 +10002246# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002247AC_ARG_ENABLE(etc-default-login,
2248 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2249[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002250AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2251
2252if test "x$external_path_file" = "x/etc/default/login"; then
2253 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2254fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002255])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002256
Tim Rice43a1c132002-04-17 21:19:14 -07002257dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2258if test $ac_cv_func_login_getcapbool = "yes" -a \
2259 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002260 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002261fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002262
Damien Millera22ba012000-03-02 23:09:20 +11002263# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002264SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002265AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002266 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002267 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002268 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002269 AC_MSG_WARN([
2270--with-default-path=PATH has no effect on this system.
2271Edit /etc/login.conf instead.])
2272 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002273 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002274 AC_MSG_WARN([
2275--with-default-path=PATH will only be used if PATH is not defined in
2276$external_path_file .])
2277 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002278 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002279 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002280 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002281 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002282 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2283 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002284 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002285 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002286 AC_MSG_WARN([
2287If PATH is defined in $external_path_file, ensure the path to scp is included,
2288otherwise scp will not work.])
2289 fi
2290 AC_TRY_RUN(
2291 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002292/* find out what STDPATH is */
2293#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002294#ifdef HAVE_PATHS_H
2295# include <paths.h>
2296#endif
2297#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002298# ifdef _PATH_USERPATH /* Irix */
2299# define _PATH_STDPATH _PATH_USERPATH
2300# else
2301# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2302# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002303#endif
2304#include <sys/types.h>
2305#include <sys/stat.h>
2306#include <fcntl.h>
2307#define DATA "conftest.stdpath"
2308
2309main()
2310{
2311 FILE *fd;
2312 int rc;
2313
2314 fd = fopen(DATA,"w");
2315 if(fd == NULL)
2316 exit(1);
2317
2318 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2319 exit(1);
2320
2321 exit(0);
2322}
2323 ], [ user_path=`cat conftest.stdpath` ],
2324 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2325 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2326 )
2327# make sure $bindir is in USER_PATH so scp will work
2328 t_bindir=`eval echo ${bindir}`
2329 case $t_bindir in
2330 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2331 esac
2332 case $t_bindir in
2333 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2334 esac
2335 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2336 if test $? -ne 0 ; then
2337 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2338 if test $? -ne 0 ; then
2339 user_path=$user_path:$t_bindir
2340 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2341 fi
2342 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002343 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002344)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002345if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002346 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2347 AC_SUBST(user_path)
2348fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002349
Damien Millera18bbd32002-05-13 10:48:57 +10002350# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002351AC_ARG_WITH(superuser-path,
2352 [ --with-superuser-path= Specify different path for super-user],
2353 [
2354 if test "x$withval" != "xno" ; then
2355 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2356 superuser_path=$withval
2357 fi
2358 ]
2359)
2360
2361
Damien Miller61e50f12000-05-08 20:49:37 +10002362AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002363IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002364AC_ARG_WITH(4in6,
2365 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2366 [
2367 if test "x$withval" != "xno" ; then
2368 AC_MSG_RESULT(yes)
2369 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002370 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002371 else
2372 AC_MSG_RESULT(no)
2373 fi
2374 ],[
2375 if test "x$inet6_default_4in6" = "xyes"; then
2376 AC_MSG_RESULT([yes (default)])
2377 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002378 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002379 else
2380 AC_MSG_RESULT([no (default)])
2381 fi
2382 ]
2383)
2384
Damien Miller60396b02001-02-18 17:01:00 +11002385# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002386BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002387AC_ARG_WITH(bsd-auth,
2388 [ --with-bsd-auth Enable BSD auth support],
2389 [
2390 if test "x$withval" != "xno" ; then
2391 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002392 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002393 fi
2394 ]
2395)
2396
Damien Millera22ba012000-03-02 23:09:20 +11002397# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002398piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002399# make sure the directory exists
2400if test ! -d $piddir ; then
2401 piddir=`eval echo ${sysconfdir}`
2402 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002403 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002404 esac
2405fi
2406
Tim Rice88f2ab52002-03-17 12:17:34 -08002407AC_ARG_WITH(pid-dir,
2408 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2409 [
2410 if test "x$withval" != "xno" ; then
2411 piddir=$withval
2412 if test ! -d $piddir ; then
2413 AC_MSG_WARN([** no $piddir directory on this system **])
2414 fi
2415 fi
2416 ]
2417)
2418
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002419AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002420AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002421
andre2ff7b5d2000-06-03 14:57:40 +00002422dnl allow user to disable some login recording features
2423AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002424 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002425 [
2426 if test "x$enableval" = "xno" ; then
2427 AC_DEFINE(DISABLE_LASTLOG)
2428 fi
2429 ]
andre2ff7b5d2000-06-03 14:57:40 +00002430)
2431AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002432 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002433 [
2434 if test "x$enableval" = "xno" ; then
2435 AC_DEFINE(DISABLE_UTMP)
2436 fi
2437 ]
andre2ff7b5d2000-06-03 14:57:40 +00002438)
2439AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002440 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002441 [
2442 if test "x$enableval" = "xno" ; then
2443 AC_DEFINE(DISABLE_UTMPX)
2444 fi
2445 ]
andre2ff7b5d2000-06-03 14:57:40 +00002446)
2447AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002448 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002449 [
2450 if test "x$enableval" = "xno" ; then
2451 AC_DEFINE(DISABLE_WTMP)
2452 fi
2453 ]
andre2ff7b5d2000-06-03 14:57:40 +00002454)
2455AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002456 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002457 [
2458 if test "x$enableval" = "xno" ; then
2459 AC_DEFINE(DISABLE_WTMPX)
2460 fi
2461 ]
andre2ff7b5d2000-06-03 14:57:40 +00002462)
2463AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002464 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002465 [
2466 if test "x$enableval" = "xno" ; then
2467 AC_DEFINE(DISABLE_LOGIN)
2468 fi
2469 ]
andre2ff7b5d2000-06-03 14:57:40 +00002470)
2471AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002472 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002473 [
2474 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002475 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002476 fi
2477 ]
andre2ff7b5d2000-06-03 14:57:40 +00002478)
2479AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002480 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002481 [
2482 if test "x$enableval" = "xno" ; then
2483 AC_DEFINE(DISABLE_PUTUTXLINE)
2484 fi
2485 ]
andre2ff7b5d2000-06-03 14:57:40 +00002486)
2487AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002488 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002489 [
2490 if test "x$withval" = "xno" ; then
2491 AC_DEFINE(DISABLE_LASTLOG)
2492 else
2493 conf_lastlog_location=$withval
2494 fi
2495 ]
2496)
andre2ff7b5d2000-06-03 14:57:40 +00002497
2498dnl lastlog, [uw]tmpx? detection
2499dnl NOTE: set the paths in the platform section to avoid the
2500dnl need for command-line parameters
2501dnl lastlog and [uw]tmp are subject to a file search if all else fails
2502
2503dnl lastlog detection
2504dnl NOTE: the code itself will detect if lastlog is a directory
2505AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2506AC_TRY_COMPILE([
2507#include <sys/types.h>
2508#include <utmp.h>
2509#ifdef HAVE_LASTLOG_H
2510# include <lastlog.h>
2511#endif
Damien Miller2994e082000-06-04 15:51:47 +10002512#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002513# include <paths.h>
2514#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002515#ifdef HAVE_LOGIN_H
2516# include <login.h>
2517#endif
andre2ff7b5d2000-06-03 14:57:40 +00002518 ],
2519 [ char *lastlog = LASTLOG_FILE; ],
2520 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002521 [
2522 AC_MSG_RESULT(no)
2523 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2524 AC_TRY_COMPILE([
2525#include <sys/types.h>
2526#include <utmp.h>
2527#ifdef HAVE_LASTLOG_H
2528# include <lastlog.h>
2529#endif
2530#ifdef HAVE_PATHS_H
2531# include <paths.h>
2532#endif
2533 ],
2534 [ char *lastlog = _PATH_LASTLOG; ],
2535 [ AC_MSG_RESULT(yes) ],
2536 [
andree441aa32000-06-12 22:34:38 +00002537 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002538 system_lastlog_path=no
2539 ])
2540 ]
andre2ff7b5d2000-06-03 14:57:40 +00002541)
Damien Miller2994e082000-06-04 15:51:47 +10002542
andre2ff7b5d2000-06-03 14:57:40 +00002543if test -z "$conf_lastlog_location"; then
2544 if test x"$system_lastlog_path" = x"no" ; then
2545 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002546 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002547 conf_lastlog_location=$f
2548 fi
2549 done
2550 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002551 AC_MSG_WARN([** Cannot find lastlog **])
2552 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002553 fi
2554 fi
2555fi
2556
2557if test -n "$conf_lastlog_location"; then
2558 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2559fi
2560
2561dnl utmp detection
2562AC_MSG_CHECKING([if your system defines UTMP_FILE])
2563AC_TRY_COMPILE([
2564#include <sys/types.h>
2565#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002566#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002567# include <paths.h>
2568#endif
2569 ],
2570 [ char *utmp = UTMP_FILE; ],
2571 [ AC_MSG_RESULT(yes) ],
2572 [ AC_MSG_RESULT(no)
2573 system_utmp_path=no ]
2574)
2575if test -z "$conf_utmp_location"; then
2576 if test x"$system_utmp_path" = x"no" ; then
2577 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2578 if test -f $f ; then
2579 conf_utmp_location=$f
2580 fi
2581 done
2582 if test -z "$conf_utmp_location"; then
2583 AC_DEFINE(DISABLE_UTMP)
2584 fi
2585 fi
2586fi
2587if test -n "$conf_utmp_location"; then
2588 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2589fi
2590
2591dnl wtmp detection
2592AC_MSG_CHECKING([if your system defines WTMP_FILE])
2593AC_TRY_COMPILE([
2594#include <sys/types.h>
2595#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002596#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002597# include <paths.h>
2598#endif
2599 ],
2600 [ char *wtmp = WTMP_FILE; ],
2601 [ AC_MSG_RESULT(yes) ],
2602 [ AC_MSG_RESULT(no)
2603 system_wtmp_path=no ]
2604)
2605if test -z "$conf_wtmp_location"; then
2606 if test x"$system_wtmp_path" = x"no" ; then
2607 for f in /usr/adm/wtmp /var/log/wtmp; do
2608 if test -f $f ; then
2609 conf_wtmp_location=$f
2610 fi
2611 done
2612 if test -z "$conf_wtmp_location"; then
2613 AC_DEFINE(DISABLE_WTMP)
2614 fi
2615 fi
2616fi
2617if test -n "$conf_wtmp_location"; then
2618 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2619fi
2620
2621
2622dnl utmpx detection - I don't know any system so perverse as to require
2623dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2624dnl there, though.
2625AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2626AC_TRY_COMPILE([
2627#include <sys/types.h>
2628#include <utmp.h>
2629#ifdef HAVE_UTMPX_H
2630#include <utmpx.h>
2631#endif
Damien Miller2994e082000-06-04 15:51:47 +10002632#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002633# include <paths.h>
2634#endif
2635 ],
2636 [ char *utmpx = UTMPX_FILE; ],
2637 [ AC_MSG_RESULT(yes) ],
2638 [ AC_MSG_RESULT(no)
2639 system_utmpx_path=no ]
2640)
2641if test -z "$conf_utmpx_location"; then
2642 if test x"$system_utmpx_path" = x"no" ; then
2643 AC_DEFINE(DISABLE_UTMPX)
2644 fi
2645else
2646 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2647fi
2648
2649dnl wtmpx detection
2650AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2651AC_TRY_COMPILE([
2652#include <sys/types.h>
2653#include <utmp.h>
2654#ifdef HAVE_UTMPX_H
2655#include <utmpx.h>
2656#endif
Damien Miller2994e082000-06-04 15:51:47 +10002657#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002658# include <paths.h>
2659#endif
2660 ],
2661 [ char *wtmpx = WTMPX_FILE; ],
2662 [ AC_MSG_RESULT(yes) ],
2663 [ AC_MSG_RESULT(no)
2664 system_wtmpx_path=no ]
2665)
2666if test -z "$conf_wtmpx_location"; then
2667 if test x"$system_wtmpx_path" = x"no" ; then
2668 AC_DEFINE(DISABLE_WTMPX)
2669 fi
2670else
2671 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2672fi
2673
Damien Miller4018c192000-04-30 09:30:44 +10002674
Damien Miller29ea30d2000-03-17 10:54:15 +11002675if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002676 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2677 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002678fi
2679
Tim Rice4cec93f2002-02-26 08:40:48 -08002680dnl remove pam and dl because they are in $LIBPAM
2681if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002682 LIBS=`echo $LIBS | sed 's/-lpam //'`
2683fi
2684if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2685 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002686fi
2687
Damien Millerbac2d8a2000-09-05 16:13:06 +11002688AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002689AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2690AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002691
Damien Miller7b22d652000-06-18 14:07:04 +10002692# Print summary of options
2693
Damien Miller7b22d652000-06-18 14:07:04 +10002694# Someone please show me a better way :)
2695A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2696B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2697C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2698D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002699E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002700F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002701G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002702H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2703I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2704J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002705
2706echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002707echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002708echo " User binaries: $B"
2709echo " System binaries: $C"
2710echo " Configuration files: $D"
2711echo " Askpass program: $E"
2712echo " Manual pages: $F"
2713echo " PID file: $G"
2714echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002715if test "x$external_path_file" = "x/etc/login.conf" ; then
2716echo " At runtime, sshd will use the path defined in $external_path_file"
2717echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002718else
Damien Millerf58c6722002-05-13 13:15:42 +10002719echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002720 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002721echo " (If PATH is set in $external_path_file it will be used instead. If"
2722echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2723 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002724fi
Damien Millera18bbd32002-05-13 10:48:57 +10002725if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002726echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002727fi
Damien Millerf58c6722002-05-13 13:15:42 +10002728echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002729echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002730echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002731echo " KerberosV support: $KRB5_MSG"
2732echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002733echo " S/KEY support: $SKEY_MSG"
2734echo " TCP Wrappers support: $TCPW_MSG"
2735echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002736echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002737echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2738echo " BSD Auth support: $BSD_AUTH_MSG"
2739echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002740if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002741echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002742fi
2743
Damien Miller7b22d652000-06-18 14:07:04 +10002744echo ""
2745
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002746echo " Host: ${host}"
2747echo " Compiler: ${CC}"
2748echo " Compiler flags: ${CFLAGS}"
2749echo "Preprocessor flags: ${CPPFLAGS}"
2750echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002751echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002752
2753echo ""
2754
Damien Miller82cf0ce2000-12-20 13:34:48 +11002755if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002756 echo "PAM is enabled. You may need to install a PAM control file "
2757 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002758 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002759 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002760 echo ""
2761fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002762
Damien Miller6c21c512002-01-22 21:57:53 +11002763if test ! -z "$RAND_HELPER_CMDHASH" ; then
2764 echo "WARNING: you are using the builtin random number collection "
2765 echo "service. Please read WARNING.RNG and request that your OS "
2766 echo "vendor includes kernel-based random number collection in "
2767 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002768 echo ""
2769fi
Damien Miller60396b02001-02-18 17:01:00 +11002770