blob: 64645217df3f22d869a28f177695681734fcd0da [file] [log] [blame]
Darren Tucker23bc8d02004-02-06 16:24:31 +11001# $Id: configure.ac,v 1.193 2004/02/06 05:24:31 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
Darren Tucker23bc8d02004-02-06 16:24:31 +110045AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
46if test ! -z "$PATH_PASSWD_PROG" ; then
47 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
48fi
49
Damien Miller166bd442000-03-16 10:48:25 +110050if test -z "$LD" ; then
51 LD=$CC
52fi
53AC_SUBST(LD)
54
Damien Miller166bd442000-03-16 10:48:25 +110055AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110056if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100057 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110058fi
59
Tim Rice88368a32003-12-08 12:35:59 -080060AC_ARG_WITH(rpath,
61 [ --without-rpath Disable auto-added -R linker paths],
62 [
63 if test "x$withval" = "xno" ; then
64 need_dash_r=""
65 fi
66 if test "x$withval" = "xyes" ; then
67 need_dash_r=1
68 fi
69 ]
70)
71
Damien Millera22ba012000-03-02 23:09:20 +110072# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110073case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110074*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110075 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +100076 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -080077 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110078 fi
Damien Millereab4bae2003-04-29 23:22:40 +100079 saved_LDFLAGS="$LDFLAGS"
80 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
81 if (test -z "$blibflags"); then
82 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
83 AC_TRY_LINK([], [], [blibflags=$tryflags])
84 fi
85 done
86 if (test -z "$blibflags"); then
87 AC_MSG_RESULT(not found)
88 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
89 else
90 AC_MSG_RESULT($blibflags)
91 fi
92 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100093 dnl Check for authenticate. Might be in libs.a on older AIXes
94 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070095 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100096 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070097 LIBS="$LIBS -ls"
98 ])
99 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000100 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
101 AC_CHECK_DECL(loginfailed,
102 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
103 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000104 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000105 [(void)loginfailed("user","host","tty",0);],
106 [AC_MSG_RESULT(yes)
107 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000108 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000109 )],
110 [],
111 [#include <usersec.h>]
112 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000113 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +1100114 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000115 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000116 AC_DEFINE(SETEUID_BREAKS_SETUID)
117 AC_DEFINE(BROKEN_SETREUID)
118 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000119 dnl AIX handles lastlog as part of its login message
120 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000121 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000122 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100123 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100124*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100125 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800126 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100127 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000128 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100129 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100130 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000131 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000132 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700133 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000134 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100135 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000136*-*-dgux*)
137 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100138 AC_DEFINE(SETEUID_BREAKS_SETUID)
139 AC_DEFINE(BROKEN_SETREUID)
140 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000141 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000142*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000143 AC_MSG_CHECKING(if we have working getaddrinfo)
144 AC_TRY_RUN([#include <mach-o/dyld.h>
145main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
146 exit(0);
147 else
148 exit(1);
149}], [AC_MSG_RESULT(working)],
150 [AC_MSG_RESULT(buggy)
151 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700152 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000153 AC_DEFINE(SETEUID_BREAKS_SETUID)
154 AC_DEFINE(BROKEN_SETREUID)
155 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100156 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000157 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000158*-*-hpux10.26)
159 if test -z "$GCC"; then
160 CFLAGS="$CFLAGS -Ae"
161 fi
162 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
163 IPADDR_IN_DISPLAY=yes
164 AC_DEFINE(HAVE_SECUREWARE)
165 AC_DEFINE(USE_PIPES)
166 AC_DEFINE(LOGIN_NO_ENDOPT)
167 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000168 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000169 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000170 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700171 LIBS="$LIBS -lsec -lsecpw"
172 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000173 disable_ptmx_check=yes
174 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100175*-*-hpux10*)
176 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000177 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100178 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000179 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100180 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000181 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000182 AC_DEFINE(LOGIN_NO_ENDOPT)
183 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100184 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000185 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000186 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700187 LIBS="$LIBS -lsec"
188 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100189 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000190*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000191 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100192 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100193 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100194 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000195 AC_DEFINE(LOGIN_NO_ENDOPT)
196 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100197 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000198 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000199 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tuckerf58fb7e2004-02-06 15:59:06 +1100200 case "$host" in
201 *-*-hpux11.11*)
202 AC_DEFINE(BROKEN_GETADDRINFO);;
203 esac
Tim Ricef028f1e2002-07-19 12:41:10 -0700204 LIBS="$LIBS -lsec"
205 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000206 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100207*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100208 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000209 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000210 AC_DEFINE(SETEUID_BREAKS_SETUID)
211 AC_DEFINE(BROKEN_SETREUID)
212 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000213 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000214 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100215 ;;
216*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100217 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000218 AC_DEFINE(WITH_IRIX_ARRAY)
219 AC_DEFINE(WITH_IRIX_PROJECT)
220 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000221 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000222 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000223 AC_DEFINE(SETEUID_BREAKS_SETUID)
224 AC_DEFINE(BROKEN_SETREUID)
225 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000226 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000227 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100228 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100229*-*-linux*)
230 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100231 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000232 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100233 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000234 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000235 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000236 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100237 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000238 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000239 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000240 AC_DEFINE(BROKEN_CMSG_TYPE)
241 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000242 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100243 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000244mips-sony-bsd|mips-sony-newsos4)
245 AC_DEFINE(HAVE_NEWS4)
246 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000247 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100248*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000249 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800250 if test "x$withval" != "xno" ; then
251 need_dash_r=1
252 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100253 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100254*-*-freebsd*)
255 check_for_libcrypt_later=1
256 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000257*-*-bsdi*)
258 AC_DEFINE(SETEUID_BREAKS_SETUID)
259 AC_DEFINE(BROKEN_SETREUID)
260 AC_DEFINE(BROKEN_SETREGID)
261 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000262*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000263 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100264 conf_utmp_location=/etc/utmp
265 conf_wtmp_location=/usr/adm/wtmp
266 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000267 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000268 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000269 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100270 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000271 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100272*-*-solaris*)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100273 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000274 AC_DEFINE(LOGIN_NEEDS_UTMPX)
275 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000276 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000277 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000278 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
279 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000280 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000281 # hardwire lastlog location (can't detect it on some versions)
282 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000283 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
284 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
285 if test "$sol2ver" -ge 8; then
286 AC_MSG_RESULT(yes)
287 AC_DEFINE(DISABLE_UTMP)
288 AC_DEFINE(DISABLE_WTMP)
289 else
290 AC_MSG_RESULT(no)
291 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100292 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000293*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000294 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000295 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100296 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000297 conf_utmp_location=/etc/utmp
298 conf_wtmp_location=/var/adm/wtmp
299 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000300 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000301 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000302*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700303 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000304 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000305 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000306 AC_DEFINE(SETEUID_BREAKS_SETUID)
307 AC_DEFINE(BROKEN_SETREUID)
308 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000309 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000310*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700311 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000312 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100313 IPADDR_IN_DISPLAY=yes
314 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000315 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000316 AC_DEFINE(SETEUID_BREAKS_SETUID)
317 AC_DEFINE(BROKEN_SETREUID)
318 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000319 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000320 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700321 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
322 # Attention: always take care to bind libsocket and libnsl before libc,
323 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000324 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100325*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100326 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700327 AC_DEFINE(SETEUID_BREAKS_SETUID)
328 AC_DEFINE(BROKEN_SETREUID)
329 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100330 ;;
331*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100332 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700333 AC_DEFINE(SETEUID_BREAKS_SETUID)
334 AC_DEFINE(BROKEN_SETREUID)
335 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100336 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100337*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100338 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100339*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800340 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Rice13aae5e2001-10-21 17:53:58 -0700341 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100342 RANLIB=true
343 no_dev_ptmx=1
344 AC_DEFINE(BROKEN_SYS_TERMIO_H)
345 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000346 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000347 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100348 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700349 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100350 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700351 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700352 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100353 ;;
354*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800355 if test -z "$GCC"; then
356 CFLAGS="$CFLAGS -belf"
357 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100358 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000359 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100360 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000361 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000362 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700363 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700364 AC_DEFINE(SETEUID_BREAKS_SETUID)
365 AC_DEFINE(BROKEN_SETREUID)
366 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700367 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100368 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700369 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000370 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000371*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100372 AC_DEFINE(NO_SSH_LASTLOG)
373 AC_DEFINE(SETEUID_BREAKS_SETUID)
374 AC_DEFINE(BROKEN_SETREUID)
375 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000376 AC_DEFINE(USE_PIPES)
377 AC_DEFINE(DISABLE_FD_PASSING)
378 LDFLAGS="$LDFLAGS"
379 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
380 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000381 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000382*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100383 AC_DEFINE(SETEUID_BREAKS_SETUID)
384 AC_DEFINE(BROKEN_SETREUID)
385 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000386 AC_DEFINE(WITH_ABBREV_NO_TTY)
387 AC_DEFINE(USE_PIPES)
388 AC_DEFINE(DISABLE_FD_PASSING)
389 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100390 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000391 MANTYPE=cat
392 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000393*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100394 AC_DEFINE(SETEUID_BREAKS_SETUID)
395 AC_DEFINE(BROKEN_SETREUID)
396 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000397 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700398 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700399 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000400 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
401 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
402 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700403 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000404*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000405 AC_MSG_CHECKING(for Digital Unix SIA)
406 no_osfsia=""
407 AC_ARG_WITH(osfsia,
408 [ --with-osfsia Enable Digital Unix SIA],
409 [
410 if test "x$withval" = "xno" ; then
411 AC_MSG_RESULT(disabled)
412 no_osfsia=1
413 fi
414 ],
415 )
416 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000417 if test -f /etc/sia/matrix.conf; then
418 AC_MSG_RESULT(yes)
419 AC_DEFINE(HAVE_OSF_SIA)
420 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000421 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000422 LIBS="$LIBS -lsecurity -ldb -lm -laud"
423 else
424 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100425 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000426 fi
427 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000428 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700429 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000430 AC_DEFINE(BROKEN_SETREUID)
431 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000432 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000433
434*-*-nto-qnx)
435 AC_DEFINE(USE_PIPES)
436 AC_DEFINE(NO_X11_UNIX_SOCKETS)
437 AC_DEFINE(MISSING_NFDBITS)
438 AC_DEFINE(MISSING_HOWMANY)
439 AC_DEFINE(MISSING_FD_MASK)
440 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100441esac
442
Damien Millere37bfc12000-06-05 09:37:43 +1000443# Allow user to specify flags
444AC_ARG_WITH(cflags,
445 [ --with-cflags Specify additional flags to pass to compiler],
446 [
447 if test "x$withval" != "xno" ; then
448 CFLAGS="$CFLAGS $withval"
449 fi
450 ]
451)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000452AC_ARG_WITH(cppflags,
453 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
454 [
455 if test "x$withval" != "xno"; then
456 CPPFLAGS="$CPPFLAGS $withval"
457 fi
458 ]
459)
Damien Millere37bfc12000-06-05 09:37:43 +1000460AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000461 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000462 [
463 if test "x$withval" != "xno" ; then
464 LDFLAGS="$LDFLAGS $withval"
465 fi
466 ]
467)
468AC_ARG_WITH(libs,
469 [ --with-libs Specify additional libraries to link with],
470 [
471 if test "x$withval" != "xno" ; then
472 LIBS="$LIBS $withval"
473 fi
474 ]
475)
476
Darren Tucker6eb93042003-06-29 21:30:41 +1000477AC_MSG_CHECKING(compiler and flags for sanity)
478AC_TRY_RUN([
479#include <stdio.h>
480int main(){exit(0);}
481 ],
482 [ AC_MSG_RESULT(yes) ],
483 [
484 AC_MSG_RESULT(no)
485 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
486 ]
487)
488
Tim Rice4cec93f2002-02-26 08:40:48 -0800489# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000490AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000491 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800492 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100493 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000494 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000495 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
Tim Rice2597bfd2004-01-26 19:03:39 -0800496 sys/cdefs.h sys/mman.h sys/pstat.h sys/ptms.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000497 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700498 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Damien Miller5c3a5582003-09-23 22:12:38 +1000499 util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800500
Damien Millera22ba012000-03-02 23:09:20 +1100501# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700502AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
503AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000504
Damien Millerdf288022001-02-18 13:07:07 +1100505dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700506if test "x$with_tcp_wrappers" != "xno" ; then
507 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
508 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
509 fi
510fi
Damien Millerdf288022001-02-18 13:07:07 +1100511
Tim Rice1e1ef642003-09-11 22:19:31 -0700512dnl IRIX and Solaris 2.5.1 have dirname() in libgen
513AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
514 AC_CHECK_LIB(gen, dirname,[
515 AC_CACHE_CHECK([for broken dirname],
516 ac_cv_have_broken_dirname, [
517 save_LIBS="$LIBS"
518 LIBS="$LIBS -lgen"
519 AC_TRY_RUN(
520 [
521#include <libgen.h>
522#include <string.h>
523
524int main(int argc, char **argv) {
525 char *s, buf[32];
526
527 strncpy(buf,"/etc", 32);
528 s = dirname(buf);
529 if (!s || strncmp(s, "/", 32) != 0) {
530 exit(1);
531 } else {
532 exit(0);
533 }
534}
535 ],
536 [ ac_cv_have_broken_dirname="no" ],
537 [ ac_cv_have_broken_dirname="yes" ]
538 )
539 LIBS="$save_LIBS"
540 ])
541 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
542 LIBS="$LIBS -lgen"
543 AC_DEFINE(HAVE_DIRNAME)
544 AC_CHECK_HEADERS(libgen.h)
545 fi
546 ])
547])
548
549AC_CHECK_FUNC(getspnam, ,
550 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
551AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
552
Tim Rice13aae5e2001-10-21 17:53:58 -0700553dnl zlib is required
554AC_ARG_WITH(zlib,
555 [ --with-zlib=PATH Use zlib in PATH],
556 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000557 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100558 AC_MSG_ERROR([*** zlib is required ***])
559 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700560 if test -d "$withval/lib"; then
561 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700562 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700563 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700564 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700565 fi
566 else
567 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700568 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700569 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700570 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700571 fi
572 fi
573 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700574 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700575 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700576 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700577 fi
578 ]
579)
580
Tim Ricefcb62202004-01-23 18:35:16 -0800581AC_CHECK_LIB(z, deflate, ,
582 [
583 saved_CPPFLAGS="$CPPFLAGS"
584 saved_LDFLAGS="$LDFLAGS"
585 save_LIBS="$LIBS"
586 dnl Check default zlib install dir
587 if test -n "${need_dash_r}"; then
588 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
589 else
590 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
591 fi
592 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
593 LIBS="$LIBS -lz"
594 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
595 [
596 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
597 ]
598 )
599 ]
600)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100601AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100602
603AC_ARG_WITH(zlib-version-check,
604 [ --without-zlib-version-check Disable zlib version check],
605 [ if test "x$withval" = "xno" ; then
606 zlib_check_nonfatal=1
607 fi
608 ]
609)
610
Darren Tucker2dcd2392004-01-23 17:13:33 +1100611AC_MSG_CHECKING(for zlib 1.1.4 or greater)
612AC_TRY_RUN([
613#include <zlib.h>
614int main()
615{
616 int a, b, c, v;
617 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
618 exit(1);
619 v = a*1000000 + b*1000 + c;
620 if (v >= 1001004)
621 exit(0);
622 exit(2);
623}
624 ],
625 AC_MSG_RESULT(yes),
626 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100627 if test -z "$zlib_check_nonfatal" ; then
628 AC_MSG_ERROR([*** zlib too old - check config.log ***
629Your reported zlib version has known security problems. It's possible your
630vendor has fixed these problems without changing the version number. If you
631are sure this is the case, you can disable the check by running
632"./configure --without-zlib-version-check".
633If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
634 else
635 AC_MSG_WARN([zlib version may have security problems])
636 fi
637 ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100638)
Damien Miller6f9c3372000-10-25 10:06:04 +1100639
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000640dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100641AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000642 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
643)
Damien Millera8e06ce2003-11-21 23:48:55 +1100644AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700645 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
646 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000647)
Damien Millerab18c411999-11-11 10:40:23 +1100648
Tim Ricee589a292001-11-03 11:09:32 -0800649dnl Checks for libutil functions
650AC_CHECK_HEADERS(libutil.h)
651AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
652AC_CHECK_FUNCS(logout updwtmp logwtmp)
653
Ben Lindstrom8697e082001-02-24 21:41:10 +0000654AC_FUNC_STRFTIME
655
Damien Miller3c027682001-03-14 11:39:45 +1100656# Check for ALTDIRFUNC glob() extension
657AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
658AC_EGREP_CPP(FOUNDIT,
659 [
660 #include <glob.h>
661 #ifdef GLOB_ALTDIRFUNC
662 FOUNDIT
663 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100664 ],
Damien Miller3c027682001-03-14 11:39:45 +1100665 [
666 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
667 AC_MSG_RESULT(yes)
668 ],
669 [
670 AC_MSG_RESULT(no)
671 ]
672)
Damien Millerab18c411999-11-11 10:40:23 +1100673
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000674# Check for g.gl_matchc glob() extension
675AC_MSG_CHECKING(for gl_matchc field in glob_t)
676AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100677 [
678 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000679 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100680 ],
681 [
682 AC_DEFINE(GLOB_HAS_GL_MATCHC)
683 AC_MSG_RESULT(yes)
684 ],
685 [
686 AC_MSG_RESULT(no)
687 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000688)
689
Damien Miller18bb4732001-03-28 14:35:30 +1000690AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
691AC_TRY_RUN(
692 [
693#include <sys/types.h>
694#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700695int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000696 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100697 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000698 [
699 AC_MSG_RESULT(no)
700 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
701 ]
702)
703
Damien Millerc547bf12001-02-16 10:18:12 +1100704# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100705SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100706AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700707 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100708 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100709 [
710 if test "x$withval" != "xno" ; then
711
712 if test "x$withval" != "xyes" ; then
713 CPPFLAGS="$CPPFLAGS -I${withval}/include"
714 LDFLAGS="$LDFLAGS -L${withval}/lib"
715 fi
716
717 AC_DEFINE(SKEY)
718 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100719 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100720
Tim Rice4cec93f2002-02-26 08:40:48 -0800721 AC_MSG_CHECKING([for s/key support])
722 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100723 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800724#include <stdio.h>
725#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700726int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800727 ],
728 [AC_MSG_RESULT(yes)],
729 [
730 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100731 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
732 ])
733 fi
734 ]
735)
736
737# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700738TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100739AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700740 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100741 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100742 [
743 if test "x$withval" != "xno" ; then
744 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700745 saved_LDFLAGS="$LDFLAGS"
746 saved_CPPFLAGS="$CPPFLAGS"
747 if test -n "${withval}" -a "${withval}" != "yes"; then
748 if test -d "${withval}/lib"; then
749 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700750 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700751 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700752 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700753 fi
754 else
755 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700756 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700757 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700758 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700759 fi
760 fi
761 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700762 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700763 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700764 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700765 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700766 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800767 LIBWRAP="-lwrap"
768 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100769 AC_MSG_CHECKING(for libwrap)
770 AC_TRY_LINK(
771 [
772#include <tcpd.h>
773 int deny_severity = 0, allow_severity = 0;
774 ],
775 [hosts_access(0);],
776 [
777 AC_MSG_RESULT(yes)
778 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800779 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700780 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100781 ],
782 [
783 AC_MSG_ERROR([*** libwrap missing])
784 ]
785 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800786 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100787 fi
788 ]
789)
790
Damien Millerfe1f1432003-02-24 15:45:42 +1100791dnl Checks for library functions. Please keep in alphabetical order
792AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000793 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000794 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000795 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000796 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100797 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000798 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
799 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
800 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100801 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000802 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000803 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000804 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100805)
Tim Rice13aae5e2001-10-21 17:53:58 -0700806
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000807# IRIX has a const char return value for gai_strerror()
808AC_CHECK_FUNCS(gai_strerror,[
809 AC_DEFINE(HAVE_GAI_STRERROR)
810 AC_TRY_COMPILE([
811#include <sys/types.h>
812#include <sys/socket.h>
813#include <netdb.h>
814
815const char *gai_strerror(int);],[
816char *str;
817
818str = gai_strerror(0);],[
819 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
820 [Define if gai_strerror() returns const char *])])])
821
Damien Millercd6853c2003-01-28 11:33:42 +1100822AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
823
Darren Tuckerf1159b52003-07-07 19:44:01 +1000824dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000825AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000826AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000827
Darren Tuckerb2427c82003-09-10 15:22:44 +1000828dnl tcsendbreak might be a macro
829AC_CHECK_DECL(tcsendbreak,
830 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100831 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000832 [#include <termios.h>]
833)
834
Darren Tucker2a6b0292003-12-31 14:59:17 +1100835AC_CHECK_FUNCS(setresuid, [
836 dnl Some platorms have setresuid that isn't implemented, test for this
837 AC_MSG_CHECKING(if setresuid seems to work)
838 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100839#include <stdlib.h>
840#include <errno.h>
841int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100842 ],
843 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100844 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100845 AC_MSG_RESULT(not implemented)]
846 )
847])
Darren Tuckere937be32003-12-17 18:53:26 +1100848
Darren Tucker2a6b0292003-12-31 14:59:17 +1100849AC_CHECK_FUNCS(setresgid, [
850 dnl Some platorms have setresgid that isn't implemented, test for this
851 AC_MSG_CHECKING(if setresgid seems to work)
852 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100853#include <stdlib.h>
854#include <errno.h>
855int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100856 ],
857 [AC_MSG_RESULT(yes)],
858 [AC_DEFINE(BROKEN_SETRESGID)
859 AC_MSG_RESULT(not implemented)]
860 )
861])
Darren Tuckere937be32003-12-17 18:53:26 +1100862
Damien Millerad833b32000-08-23 10:46:23 +1000863dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000864AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000865dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000866AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000867AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000868dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000869AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000870AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100871
Damien Millera8e06ce2003-11-21 23:48:55 +1100872AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100873 [AC_DEFINE(HAVE_DAEMON)],
874 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
875)
876
Damien Millera8e06ce2003-11-21 23:48:55 +1100877AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100878 [AC_DEFINE(HAVE_GETPAGESIZE)],
879 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
880)
881
Damien Millercb170cb2000-07-01 16:52:55 +1000882# Check for broken snprintf
883if test "x$ac_cv_func_snprintf" = "xyes" ; then
884 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
885 AC_TRY_RUN(
886 [
887#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700888int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000889 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100890 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000891 [
892 AC_MSG_RESULT(no)
893 AC_DEFINE(BROKEN_SNPRINTF)
894 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
895 ]
896 )
897fi
898
Damien Millere8328192003-01-07 15:18:32 +1100899dnl see whether mkstemp() requires XXXXXX
900if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
901AC_MSG_CHECKING([for (overly) strict mkstemp])
902AC_TRY_RUN(
903 [
904#include <stdlib.h>
905main() { char template[]="conftest.mkstemp-test";
906if (mkstemp(template) == -1)
907 exit(1);
908unlink(template); exit(0);
909}
910 ],
911 [
912 AC_MSG_RESULT(no)
913 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100914 [
Damien Millere8328192003-01-07 15:18:32 +1100915 AC_MSG_RESULT(yes)
916 AC_DEFINE(HAVE_STRICT_MKSTEMP)
917 ],
918 [
919 AC_MSG_RESULT(yes)
920 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100921 ]
Damien Millere8328192003-01-07 15:18:32 +1100922)
923fi
924
Darren Tucker70a3d552003-08-21 17:58:29 +1000925dnl make sure that openpty does not reacquire controlling terminal
926if test ! -z "$check_for_openpty_ctty_bug"; then
927 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
928 AC_TRY_RUN(
929 [
930#include <stdio.h>
931#include <sys/fcntl.h>
932#include <sys/types.h>
933#include <sys/wait.h>
934
935int
936main()
937{
938 pid_t pid;
939 int fd, ptyfd, ttyfd, status;
940
941 pid = fork();
942 if (pid < 0) { /* failed */
943 exit(1);
944 } else if (pid > 0) { /* parent */
945 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100946 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000947 exit(WEXITSTATUS(status));
948 else
949 exit(2);
950 } else { /* child */
951 close(0); close(1); close(2);
952 setsid();
953 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
954 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
955 if (fd >= 0)
956 exit(3); /* Acquired ctty: broken */
957 else
958 exit(0); /* Did not acquire ctty: OK */
959 }
960}
961 ],
962 [
963 AC_MSG_RESULT(yes)
964 ],
965 [
966 AC_MSG_RESULT(no)
967 AC_DEFINE(SSHD_ACQUIRES_CTTY)
968 ]
969 )
970fi
971
Damien Miller606f8802000-09-16 15:39:56 +1100972AC_FUNC_GETPGRP
973
Damien Millera64b57a2001-01-17 10:44:13 +1100974# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000975PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100976AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100977 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100978 [
Damien Millera64b57a2001-01-17 10:44:13 +1100979 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100980 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
981 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100982 AC_MSG_ERROR([PAM headers not found])
983 fi
984
985 AC_CHECK_LIB(dl, dlopen, , )
986 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
987 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000988 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100989
Damien Millera64b57a2001-01-17 10:44:13 +1100990 PAM_MSG="yes"
991
992 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800993 if test $ac_cv_lib_dl_dlopen = yes; then
994 LIBPAM="-lpam -ldl"
995 else
996 LIBPAM="-lpam"
997 fi
998 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100999 fi
1000 ]
1001)
Damien Millera22ba012000-03-02 23:09:20 +11001002
Damien Millera64b57a2001-01-17 10:44:13 +11001003# Check for older PAM
1004if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001005 # Check PAM strerror arguments (old PAM)
1006 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1007 AC_TRY_COMPILE(
1008 [
Damien Miller81171112000-04-23 11:14:01 +10001009#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001010#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001011#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001012#elif defined (HAVE_PAM_PAM_APPL_H)
1013#include <pam/pam_appl.h>
1014#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001015 ],
1016 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001017 [AC_MSG_RESULT(no)],
1018 [
1019 AC_DEFINE(HAVE_OLD_PAM)
1020 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001021 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001022 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001023 )
Damien Millera22ba012000-03-02 23:09:20 +11001024fi
1025
Damien Millerfc93d4b2002-09-04 23:26:29 +10001026# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1027# because the system crypt() is more featureful.
1028if test "x$check_for_libcrypt_before" = "x1"; then
1029 AC_CHECK_LIB(crypt, crypt)
1030fi
1031
Tim Riceaef73712002-05-11 13:17:42 -07001032# Search for OpenSSL
1033saved_CPPFLAGS="$CPPFLAGS"
1034saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001035AC_ARG_WITH(ssl-dir,
1036 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1037 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001038 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001039 if test -d "$withval/lib"; then
1040 if test -n "${need_dash_r}"; then
1041 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1042 else
1043 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1044 fi
1045 else
1046 if test -n "${need_dash_r}"; then
1047 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1048 else
1049 LDFLAGS="-L${withval} ${LDFLAGS}"
1050 fi
1051 fi
1052 if test -d "$withval/include"; then
1053 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1054 else
1055 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1056 fi
Damien Millera22ba012000-03-02 23:09:20 +11001057 fi
1058 ]
1059)
Tim Riceaef73712002-05-11 13:17:42 -07001060LIBS="$LIBS -lcrypto"
1061AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001062 [
Tim Riceaef73712002-05-11 13:17:42 -07001063 dnl Check default openssl install dir
1064 if test -n "${need_dash_r}"; then
1065 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001066 else
Tim Riceaef73712002-05-11 13:17:42 -07001067 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001068 fi
Tim Riceaef73712002-05-11 13:17:42 -07001069 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1070 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1071 [
1072 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1073 ]
1074 )
1075 ]
1076)
1077
Tim Riced730b782002-08-13 18:52:10 -07001078# Determine OpenSSL header version
1079AC_MSG_CHECKING([OpenSSL header version])
1080AC_TRY_RUN(
1081 [
1082#include <stdio.h>
1083#include <string.h>
1084#include <openssl/opensslv.h>
1085#define DATA "conftest.sslincver"
1086int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001087 FILE *fd;
1088 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001089
Damien Millera8e06ce2003-11-21 23:48:55 +11001090 fd = fopen(DATA,"w");
1091 if(fd == NULL)
1092 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001093
1094 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1095 exit(1);
1096
1097 exit(0);
1098}
1099 ],
1100 [
1101 ssl_header_ver=`cat conftest.sslincver`
1102 AC_MSG_RESULT($ssl_header_ver)
1103 ],
1104 [
1105 AC_MSG_RESULT(not found)
1106 AC_MSG_ERROR(OpenSSL version header not found.)
1107 ]
1108)
1109
1110# Determine OpenSSL library version
1111AC_MSG_CHECKING([OpenSSL library version])
1112AC_TRY_RUN(
1113 [
1114#include <stdio.h>
1115#include <string.h>
1116#include <openssl/opensslv.h>
1117#include <openssl/crypto.h>
1118#define DATA "conftest.ssllibver"
1119int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001120 FILE *fd;
1121 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001122
Damien Millera8e06ce2003-11-21 23:48:55 +11001123 fd = fopen(DATA,"w");
1124 if(fd == NULL)
1125 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001126
1127 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1128 exit(1);
1129
1130 exit(0);
1131}
1132 ],
1133 [
1134 ssl_library_ver=`cat conftest.ssllibver`
1135 AC_MSG_RESULT($ssl_library_ver)
1136 ],
1137 [
1138 AC_MSG_RESULT(not found)
1139 AC_MSG_ERROR(OpenSSL library not found.)
1140 ]
1141)
Damien Millera22ba012000-03-02 23:09:20 +11001142
Damien Millerec932372002-01-22 22:16:03 +11001143# Sanity check OpenSSL headers
1144AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1145AC_TRY_RUN(
1146 [
1147#include <string.h>
1148#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001149int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001150 ],
1151 [
1152 AC_MSG_RESULT(yes)
1153 ],
1154 [
1155 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001156 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1157Check config.log for details.
1158Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001159 ]
1160)
1161
Damien Millera8e06ce2003-11-21 23:48:55 +11001162# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Damien Millera64b57a2001-01-17 10:44:13 +11001163# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001164if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001165 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001166fi
1167
Damien Miller6c21c512002-01-22 21:57:53 +11001168
1169### Configure cryptographic random number support
1170
1171# Check wheter OpenSSL seeds itself
1172AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1173AC_TRY_RUN(
1174 [
1175#include <string.h>
1176#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001177int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001178 ],
1179 [
1180 OPENSSL_SEEDS_ITSELF=yes
1181 AC_MSG_RESULT(yes)
1182 ],
1183 [
1184 AC_MSG_RESULT(no)
1185 # Default to use of the rand helper if OpenSSL doesn't
1186 # seed itself
1187 USE_RAND_HELPER=yes
1188 ]
1189)
1190
1191
1192# Do we want to force the use of the rand helper?
1193AC_ARG_WITH(rand-helper,
1194 [ --with-rand-helper Use subprocess to gather strong randomness ],
1195 [
1196 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001197 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001198 # the previous test showed it to be unseeded.
1199 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1200 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1201 OPENSSL_SEEDS_ITSELF=yes
1202 USE_RAND_HELPER=""
1203 fi
1204 else
1205 USE_RAND_HELPER=yes
1206 fi
1207 ],
1208)
1209
1210# Which randomness source do we use?
1211if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1212 # OpenSSL only
1213 AC_DEFINE(OPENSSL_PRNG_ONLY)
1214 RAND_MSG="OpenSSL internal ONLY"
1215 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001216elif test ! -z "$USE_RAND_HELPER" ; then
1217 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001218 RAND_MSG="ssh-rand-helper"
1219 INSTALL_SSH_RAND_HELPER="yes"
1220fi
1221AC_SUBST(INSTALL_SSH_RAND_HELPER)
1222
1223### Configuration of ssh-rand-helper
1224
1225# PRNGD TCP socket
1226AC_ARG_WITH(prngd-port,
1227 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1228 [
Damien Millere996d722002-01-23 11:20:59 +11001229 case "$withval" in
1230 no)
1231 withval=""
1232 ;;
1233 [[0-9]]*)
1234 ;;
1235 *)
1236 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1237 ;;
1238 esac
1239 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001240 PRNGD_PORT="$withval"
1241 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1242 fi
1243 ]
1244)
1245
1246# PRNGD Unix domain socket
1247AC_ARG_WITH(prngd-socket,
1248 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1249 [
Damien Millere996d722002-01-23 11:20:59 +11001250 case "$withval" in
1251 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001252 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001253 ;;
1254 no)
1255 withval=""
1256 ;;
1257 /*)
1258 ;;
1259 *)
1260 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1261 ;;
1262 esac
1263
1264 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001265 if test ! -z "$PRNGD_PORT" ; then
1266 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1267 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001268 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001269 AC_MSG_WARN(Entropy socket is not readable)
1270 fi
1271 PRNGD_SOCKET="$withval"
1272 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1273 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001274 ],
1275 [
1276 # Check for existing socket only if we don't have a random device already
1277 if test "$USE_RAND_HELPER" = yes ; then
1278 AC_MSG_CHECKING(for PRNGD/EGD socket)
1279 # Insert other locations here
1280 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1281 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1282 PRNGD_SOCKET="$sock"
1283 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1284 break;
1285 fi
1286 done
1287 if test ! -z "$PRNGD_SOCKET" ; then
1288 AC_MSG_RESULT($PRNGD_SOCKET)
1289 else
1290 AC_MSG_RESULT(not found)
1291 fi
1292 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001293 ]
1294)
1295
1296# Change default command timeout for hashing entropy source
1297entropy_timeout=200
1298AC_ARG_WITH(entropy-timeout,
1299 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1300 [
1301 if test "x$withval" != "xno" ; then
1302 entropy_timeout=$withval
1303 fi
1304 ]
1305)
Damien Miller6c21c512002-01-22 21:57:53 +11001306AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1307
Damien Millerd3f6ad22002-06-25 10:24:47 +10001308SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001309AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001310 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001311 [
1312 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001313 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001314 fi
1315 ]
1316)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001317AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1318AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001319
Tim Rice88f2ab52002-03-17 12:17:34 -08001320# We do this little dance with the search path to insure
1321# that programs that we select for use by installed programs
1322# (which may be run by the super-user) come from trusted
1323# locations before they come from the user's private area.
1324# This should help avoid accidentally configuring some
1325# random version of a program in someone's personal bin.
1326
1327OPATH=$PATH
1328PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001329test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001330test -d /sbin && PATH=$PATH:/sbin
1331test -d /usr/sbin && PATH=$PATH:/usr/sbin
1332PATH=$PATH:/etc:$OPATH
1333
Damien Millera8e06ce2003-11-21 23:48:55 +11001334# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001335OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1336OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1337OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1338OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1339OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1340OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1341OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1342OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1343OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1344OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1345OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1346OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1347OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1348OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1349OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1350OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001351# restore PATH
1352PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001353
1354# Where does ssh-rand-helper get its randomness from?
1355INSTALL_SSH_PRNG_CMDS=""
1356if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1357 if test ! -z "$PRNGD_PORT" ; then
1358 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1359 elif test ! -z "$PRNGD_SOCKET" ; then
1360 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1361 else
1362 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1363 RAND_HELPER_CMDHASH=yes
1364 INSTALL_SSH_PRNG_CMDS="yes"
1365 fi
1366fi
1367AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1368
1369
Ben Lindstromb5628642000-10-18 00:02:25 +00001370# Cheap hack to ensure NEWS-OS libraries are arranged right.
1371if test ! -z "$SONY" ; then
1372 LIBS="$LIBS -liberty";
1373fi
1374
Damien Millera22ba012000-03-02 23:09:20 +11001375# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001376AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001377AC_CHECK_SIZEOF(short int, 2)
1378AC_CHECK_SIZEOF(int, 4)
1379AC_CHECK_SIZEOF(long int, 4)
1380AC_CHECK_SIZEOF(long long int, 8)
1381
Damien Millerfa2bb692002-04-23 23:22:25 +10001382# Sanity check long long for some platforms (AIX)
1383if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1384 ac_cv_sizeof_long_long_int=0
1385fi
1386
Damien Millera22ba012000-03-02 23:09:20 +11001387# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001388AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1389 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001390 [ #include <sys/types.h> ],
1391 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001392 [ ac_cv_have_u_int="yes" ],
1393 [ ac_cv_have_u_int="no" ]
1394 )
1395])
1396if test "x$ac_cv_have_u_int" = "xyes" ; then
1397 AC_DEFINE(HAVE_U_INT)
1398 have_u_int=1
1399fi
1400
Damien Miller61e50f12000-05-08 20:49:37 +10001401AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1402 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001403 [ #include <sys/types.h> ],
1404 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001405 [ ac_cv_have_intxx_t="yes" ],
1406 [ ac_cv_have_intxx_t="no" ]
1407 )
1408])
1409if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1410 AC_DEFINE(HAVE_INTXX_T)
1411 have_intxx_t=1
1412fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001413
1414if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001415 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001416then
1417 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1418 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001419 [ #include <stdint.h> ],
1420 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001421 [
1422 AC_DEFINE(HAVE_INTXX_T)
1423 AC_MSG_RESULT(yes)
1424 ],
1425 [ AC_MSG_RESULT(no) ]
1426 )
1427fi
1428
Damien Miller578783e2000-09-23 14:12:24 +11001429AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1430 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001431 [
1432#include <sys/types.h>
1433#ifdef HAVE_STDINT_H
1434# include <stdint.h>
1435#endif
1436#include <sys/socket.h>
1437#ifdef HAVE_SYS_BITYPES_H
1438# include <sys/bitypes.h>
1439#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001440 ],
1441 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001442 [ ac_cv_have_int64_t="yes" ],
1443 [ ac_cv_have_int64_t="no" ]
1444 )
1445])
1446if test "x$ac_cv_have_int64_t" = "xyes" ; then
1447 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001448fi
1449
Damien Miller61e50f12000-05-08 20:49:37 +10001450AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1451 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001452 [ #include <sys/types.h> ],
1453 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001454 [ ac_cv_have_u_intxx_t="yes" ],
1455 [ ac_cv_have_u_intxx_t="no" ]
1456 )
1457])
1458if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1459 AC_DEFINE(HAVE_U_INTXX_T)
1460 have_u_intxx_t=1
1461fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001462
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001463if test -z "$have_u_intxx_t" ; then
1464 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1465 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001466 [ #include <sys/socket.h> ],
1467 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001468 [
1469 AC_DEFINE(HAVE_U_INTXX_T)
1470 AC_MSG_RESULT(yes)
1471 ],
1472 [ AC_MSG_RESULT(no) ]
1473 )
1474fi
1475
Damien Miller578783e2000-09-23 14:12:24 +11001476AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1477 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001478 [ #include <sys/types.h> ],
1479 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001480 [ ac_cv_have_u_int64_t="yes" ],
1481 [ ac_cv_have_u_int64_t="no" ]
1482 )
1483])
1484if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1485 AC_DEFINE(HAVE_U_INT64_T)
1486 have_u_int64_t=1
1487fi
1488
Tim Rice4cec93f2002-02-26 08:40:48 -08001489if test -z "$have_u_int64_t" ; then
1490 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1491 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001492 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001493 [ u_int64_t a; a = 1],
1494 [
1495 AC_DEFINE(HAVE_U_INT64_T)
1496 AC_MSG_RESULT(yes)
1497 ],
1498 [ AC_MSG_RESULT(no) ]
1499 )
1500fi
1501
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001502if test -z "$have_u_intxx_t" ; then
1503 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1504 AC_TRY_COMPILE(
1505 [
1506#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001507 ],
1508 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001509 [ ac_cv_have_uintxx_t="yes" ],
1510 [ ac_cv_have_uintxx_t="no" ]
1511 )
1512 ])
1513 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1514 AC_DEFINE(HAVE_UINTXX_T)
1515 fi
1516fi
1517
1518if test -z "$have_uintxx_t" ; then
1519 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1520 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001521 [ #include <stdint.h> ],
1522 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001523 [
1524 AC_DEFINE(HAVE_UINTXX_T)
1525 AC_MSG_RESULT(yes)
1526 ],
1527 [ AC_MSG_RESULT(no) ]
1528 )
1529fi
1530
Damien Milleredb82922000-06-20 13:25:52 +10001531if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001532 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001533then
1534 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1535 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001536 [
1537#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001538 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001539 [
Damien Miller70494d12000-04-03 15:57:06 +10001540 int8_t a; int16_t b; int32_t c;
1541 u_int8_t e; u_int16_t f; u_int32_t g;
1542 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001543 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001544 [
1545 AC_DEFINE(HAVE_U_INTXX_T)
1546 AC_DEFINE(HAVE_INTXX_T)
1547 AC_MSG_RESULT(yes)
1548 ],
1549 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001550 )
Damien Millerb29ea912000-01-15 14:12:03 +11001551fi
1552
Damien Miller58be7382001-09-15 21:31:54 +10001553
1554AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1555 AC_TRY_COMPILE(
1556 [
1557#include <sys/types.h>
1558 ],
1559 [ u_char foo; foo = 125; ],
1560 [ ac_cv_have_u_char="yes" ],
1561 [ ac_cv_have_u_char="no" ]
1562 )
1563])
1564if test "x$ac_cv_have_u_char" = "xyes" ; then
1565 AC_DEFINE(HAVE_U_CHAR)
1566fi
1567
Tim Rice13aae5e2001-10-21 17:53:58 -07001568TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001569
Tim Rice200a5c02002-02-26 22:12:34 -08001570AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001571
Damien Miller61e50f12000-05-08 20:49:37 +10001572AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1573 AC_TRY_COMPILE(
1574 [
1575#include <sys/types.h>
1576 ],
1577 [ size_t foo; foo = 1235; ],
1578 [ ac_cv_have_size_t="yes" ],
1579 [ ac_cv_have_size_t="no" ]
1580 )
1581])
1582if test "x$ac_cv_have_size_t" = "xyes" ; then
1583 AC_DEFINE(HAVE_SIZE_T)
1584fi
Damien Miller95058511999-12-29 10:36:45 +11001585
Damien Miller615f9392000-05-17 22:53:33 +10001586AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1587 AC_TRY_COMPILE(
1588 [
1589#include <sys/types.h>
1590 ],
1591 [ ssize_t foo; foo = 1235; ],
1592 [ ac_cv_have_ssize_t="yes" ],
1593 [ ac_cv_have_ssize_t="no" ]
1594 )
1595])
1596if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1597 AC_DEFINE(HAVE_SSIZE_T)
1598fi
1599
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001600AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1601 AC_TRY_COMPILE(
1602 [
1603#include <time.h>
1604 ],
1605 [ clock_t foo; foo = 1235; ],
1606 [ ac_cv_have_clock_t="yes" ],
1607 [ ac_cv_have_clock_t="no" ]
1608 )
1609])
1610if test "x$ac_cv_have_clock_t" = "xyes" ; then
1611 AC_DEFINE(HAVE_CLOCK_T)
1612fi
1613
Damien Millerb54b40e2000-06-23 08:23:34 +10001614AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1615 AC_TRY_COMPILE(
1616 [
1617#include <sys/types.h>
1618#include <sys/socket.h>
1619 ],
1620 [ sa_family_t foo; foo = 1235; ],
1621 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001622 [ AC_TRY_COMPILE(
1623 [
1624#include <sys/types.h>
1625#include <sys/socket.h>
1626#include <netinet/in.h>
1627 ],
1628 [ sa_family_t foo; foo = 1235; ],
1629 [ ac_cv_have_sa_family_t="yes" ],
1630
Damien Millerb54b40e2000-06-23 08:23:34 +10001631 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001632 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001633 )
1634])
1635if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1636 AC_DEFINE(HAVE_SA_FAMILY_T)
1637fi
1638
Damien Miller0f91b4e2000-06-18 15:43:25 +10001639AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1640 AC_TRY_COMPILE(
1641 [
1642#include <sys/types.h>
1643 ],
1644 [ pid_t foo; foo = 1235; ],
1645 [ ac_cv_have_pid_t="yes" ],
1646 [ ac_cv_have_pid_t="no" ]
1647 )
1648])
1649if test "x$ac_cv_have_pid_t" = "xyes" ; then
1650 AC_DEFINE(HAVE_PID_T)
1651fi
1652
1653AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1654 AC_TRY_COMPILE(
1655 [
1656#include <sys/types.h>
1657 ],
1658 [ mode_t foo; foo = 1235; ],
1659 [ ac_cv_have_mode_t="yes" ],
1660 [ ac_cv_have_mode_t="no" ]
1661 )
1662])
1663if test "x$ac_cv_have_mode_t" = "xyes" ; then
1664 AC_DEFINE(HAVE_MODE_T)
1665fi
1666
Damien Miller61e50f12000-05-08 20:49:37 +10001667
1668AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1669 AC_TRY_COMPILE(
1670 [
Damien Miller81171112000-04-23 11:14:01 +10001671#include <sys/types.h>
1672#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001673 ],
1674 [ struct sockaddr_storage s; ],
1675 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1676 [ ac_cv_have_struct_sockaddr_storage="no" ]
1677 )
1678])
1679if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1680 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1681fi
Damien Miller34132e52000-01-14 15:45:46 +11001682
Damien Miller61e50f12000-05-08 20:49:37 +10001683AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1684 AC_TRY_COMPILE(
1685 [
Damien Miller7b22d652000-06-18 14:07:04 +10001686#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001687#include <netinet/in.h>
1688 ],
1689 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1690 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1691 [ ac_cv_have_struct_sockaddr_in6="no" ]
1692 )
1693])
1694if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1695 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1696fi
Damien Miller34132e52000-01-14 15:45:46 +11001697
Damien Miller61e50f12000-05-08 20:49:37 +10001698AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1699 AC_TRY_COMPILE(
1700 [
Damien Miller7b22d652000-06-18 14:07:04 +10001701#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001702#include <netinet/in.h>
1703 ],
1704 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1705 [ ac_cv_have_struct_in6_addr="yes" ],
1706 [ ac_cv_have_struct_in6_addr="no" ]
1707 )
1708])
1709if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1710 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1711fi
Damien Miller34132e52000-01-14 15:45:46 +11001712
Damien Miller61e50f12000-05-08 20:49:37 +10001713AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1714 AC_TRY_COMPILE(
1715 [
Damien Miller81171112000-04-23 11:14:01 +10001716#include <sys/types.h>
1717#include <sys/socket.h>
1718#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001719 ],
1720 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1721 [ ac_cv_have_struct_addrinfo="yes" ],
1722 [ ac_cv_have_struct_addrinfo="no" ]
1723 )
1724])
1725if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1726 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1727fi
1728
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001729AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1730 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001731 [ #include <sys/time.h> ],
1732 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001733 [ ac_cv_have_struct_timeval="yes" ],
1734 [ ac_cv_have_struct_timeval="no" ]
1735 )
1736])
1737if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1738 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1739 have_struct_timeval=1
1740fi
1741
Tim Rice4e4dc562003-03-18 10:21:40 -08001742AC_CHECK_TYPES(struct timespec)
1743
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001744# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001745if test "x$ac_cv_have_int64_t" = "xno" -a \
1746 "x$ac_cv_sizeof_long_int" != "x8" -a \
1747 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001748 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1749 echo "an alternative compiler (I.E., GCC) before continuing."
1750 echo ""
1751 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001752else
1753dnl test snprintf (broken on SCO w/gcc)
1754 AC_TRY_RUN(
1755 [
1756#include <stdio.h>
1757#include <string.h>
1758#ifdef HAVE_SNPRINTF
1759main()
1760{
1761 char buf[50];
1762 char expected_out[50];
1763 int mazsize = 50 ;
1764#if (SIZEOF_LONG_INT == 8)
1765 long int num = 0x7fffffffffffffff;
1766#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001767 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001768#endif
1769 strcpy(expected_out, "9223372036854775807");
1770 snprintf(buf, mazsize, "%lld", num);
1771 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001772 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001773 exit(0);
1774}
1775#else
1776main() { exit(0); }
1777#endif
1778 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1779 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001780fi
1781
Damien Miller78315eb2000-09-29 23:01:36 +11001782dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001783OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1784OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1785OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1786OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1787OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001788OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001789OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1790OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001791OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001792OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1793OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1794OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1795OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001796OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1797OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1798OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1799OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001800
1801AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001802
Damien Miller61e50f12000-05-08 20:49:37 +10001803AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1804 ac_cv_have_ss_family_in_struct_ss, [
1805 AC_TRY_COMPILE(
1806 [
Damien Miller81171112000-04-23 11:14:01 +10001807#include <sys/types.h>
1808#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001809 ],
1810 [ struct sockaddr_storage s; s.ss_family = 1; ],
1811 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1812 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1813 )
1814])
1815if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1816 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1817fi
1818
Damien Miller61e50f12000-05-08 20:49:37 +10001819AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1820 ac_cv_have___ss_family_in_struct_ss, [
1821 AC_TRY_COMPILE(
1822 [
Damien Miller81171112000-04-23 11:14:01 +10001823#include <sys/types.h>
1824#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001825 ],
1826 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1827 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1828 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1829 )
1830])
1831if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1832 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1833fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001834
Damien Millerad833b32000-08-23 10:46:23 +10001835AC_CACHE_CHECK([for pw_class field in struct passwd],
1836 ac_cv_have_pw_class_in_struct_passwd, [
1837 AC_TRY_COMPILE(
1838 [
Damien Millerad833b32000-08-23 10:46:23 +10001839#include <pwd.h>
1840 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001841 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001842 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1843 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1844 )
1845])
1846if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1847 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1848fi
1849
Kevin Steves82456952001-06-22 21:14:18 +00001850AC_CACHE_CHECK([for pw_expire field in struct passwd],
1851 ac_cv_have_pw_expire_in_struct_passwd, [
1852 AC_TRY_COMPILE(
1853 [
1854#include <pwd.h>
1855 ],
1856 [ struct passwd p; p.pw_expire = 0; ],
1857 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1858 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1859 )
1860])
1861if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1862 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1863fi
1864
1865AC_CACHE_CHECK([for pw_change field in struct passwd],
1866 ac_cv_have_pw_change_in_struct_passwd, [
1867 AC_TRY_COMPILE(
1868 [
1869#include <pwd.h>
1870 ],
1871 [ struct passwd p; p.pw_change = 0; ],
1872 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1873 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1874 )
1875])
1876if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1877 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1878fi
Damien Miller61e50f12000-05-08 20:49:37 +10001879
Tim Rice28bbb0c2002-05-27 17:37:32 -07001880dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001881AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1882 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001883 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001884 [
Tim Riceae49fe62002-04-12 10:26:21 -07001885#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001886#include <sys/socket.h>
1887#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001888int main() {
1889#ifdef msg_accrights
1890exit(1);
1891#endif
1892struct msghdr m;
1893m.msg_accrights = 0;
1894exit(0);
1895}
Kevin Steves939c9db2002-03-22 17:23:25 +00001896 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001897 [ ac_cv_have_accrights_in_msghdr="yes" ],
1898 [ ac_cv_have_accrights_in_msghdr="no" ]
1899 )
1900])
1901if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1902 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1903fi
1904
Kevin Stevesa44e0352002-04-07 16:18:03 +00001905AC_CACHE_CHECK([for msg_control field in struct msghdr],
1906 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001907 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001908 [
Tim Riceae49fe62002-04-12 10:26:21 -07001909#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001910#include <sys/socket.h>
1911#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001912int main() {
1913#ifdef msg_control
1914exit(1);
1915#endif
1916struct msghdr m;
1917m.msg_control = 0;
1918exit(0);
1919}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001920 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001921 [ ac_cv_have_control_in_msghdr="yes" ],
1922 [ ac_cv_have_control_in_msghdr="no" ]
1923 )
1924])
1925if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1926 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1927fi
1928
Damien Miller61e50f12000-05-08 20:49:37 +10001929AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001930 AC_TRY_LINK([],
1931 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001932 [ ac_cv_libc_defines___progname="yes" ],
1933 [ ac_cv_libc_defines___progname="no" ]
1934 )
1935])
1936if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1937 AC_DEFINE(HAVE___PROGNAME)
1938fi
1939
Kevin Steves4846f4a2002-03-22 18:19:53 +00001940AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1941 AC_TRY_LINK([
1942#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001943],
1944 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001945 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1946 [ ac_cv_cc_implements___FUNCTION__="no" ]
1947 )
1948])
1949if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1950 AC_DEFINE(HAVE___FUNCTION__)
1951fi
1952
1953AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1954 AC_TRY_LINK([
1955#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001956],
1957 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001958 [ ac_cv_cc_implements___func__="yes" ],
1959 [ ac_cv_cc_implements___func__="no" ]
1960 )
1961])
1962if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1963 AC_DEFINE(HAVE___func__)
1964fi
1965
Damien Miller4f8e6692001-07-14 13:22:53 +10001966AC_CACHE_CHECK([whether getopt has optreset support],
1967 ac_cv_have_getopt_optreset, [
1968 AC_TRY_LINK(
1969 [
1970#include <getopt.h>
1971 ],
1972 [ extern int optreset; optreset = 0; ],
1973 [ ac_cv_have_getopt_optreset="yes" ],
1974 [ ac_cv_have_getopt_optreset="no" ]
1975 )
1976])
1977if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1978 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1979fi
Damien Millera22ba012000-03-02 23:09:20 +11001980
Damien Millerecbb26d2000-07-15 14:59:14 +10001981AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001982 AC_TRY_LINK([],
1983 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001984 [ ac_cv_libc_defines_sys_errlist="yes" ],
1985 [ ac_cv_libc_defines_sys_errlist="no" ]
1986 )
1987])
1988if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1989 AC_DEFINE(HAVE_SYS_ERRLIST)
1990fi
1991
1992
Damien Miller11fa2cc2000-08-16 10:35:58 +10001993AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001994 AC_TRY_LINK([],
1995 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001996 [ ac_cv_libc_defines_sys_nerr="yes" ],
1997 [ ac_cv_libc_defines_sys_nerr="no" ]
1998 )
1999])
2000if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2001 AC_DEFINE(HAVE_SYS_NERR)
2002fi
2003
Damien Millera8e06ce2003-11-21 23:48:55 +11002004SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002005# Check whether user wants sectok support
2006AC_ARG_WITH(sectok,
2007 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002008 [
2009 if test "x$withval" != "xno" ; then
2010 if test "x$withval" != "xyes" ; then
2011 CPPFLAGS="$CPPFLAGS -I${withval}"
2012 LDFLAGS="$LDFLAGS -L${withval}"
2013 if test ! -z "$need_dash_r" ; then
2014 LDFLAGS="$LDFLAGS -R${withval}"
2015 fi
2016 if test ! -z "$blibpath" ; then
2017 blibpath="$blibpath:${withval}"
2018 fi
2019 fi
2020 AC_CHECK_HEADERS(sectok.h)
2021 if test "$ac_cv_header_sectok_h" != yes; then
2022 AC_MSG_ERROR(Can't find sectok.h)
2023 fi
2024 AC_CHECK_LIB(sectok, sectok_open)
2025 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2026 AC_MSG_ERROR(Can't find libsectok)
2027 fi
2028 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002029 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002030 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002031 fi
2032 ]
2033)
2034
2035# Check whether user wants OpenSC support
2036AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002037 AC_HELP_STRING([--with-opensc=PFX],
2038 [Enable smartcard support using OpenSC]),
2039 opensc_config_prefix="$withval", opensc_config_prefix="")
2040if test x$opensc_config_prefix != x ; then
2041 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2042 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2043 if test "$OPENSC_CONFIG" != "no"; then
2044 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2045 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2046 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2047 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2048 AC_DEFINE(SMARTCARD)
2049 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002050 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002051 fi
2052fi
Damien Miller85de5802001-09-18 14:01:11 +10002053
Darren Tucker5f88d342003-10-15 16:57:57 +10002054# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002055AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002056 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002057 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002058 # Needed by our getrrsetbyname()
2059 AC_SEARCH_LIBS(res_query, resolv)
2060 AC_SEARCH_LIBS(dn_expand, resolv)
2061 AC_CHECK_FUNCS(_getshort _getlong)
2062 AC_CHECK_MEMBER(HEADER.ad,
2063 [AC_DEFINE(HAVE_HEADER_AD)],,
2064 [#include <arpa/nameser.h>])
2065 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002066
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002067# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002068KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002069AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002070 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002071 [ if test "x$withval" != "xno" ; then
2072 if test "x$withval" = "xyes" ; then
2073 KRB5ROOT="/usr/local"
2074 else
2075 KRB5ROOT=${withval}
2076 fi
2077
2078 AC_DEFINE(KRB5)
2079 KRB5_MSG="yes"
2080
2081 AC_MSG_CHECKING(for krb5-config)
2082 if test -x $KRB5ROOT/bin/krb5-config ; then
2083 KRB5CONF=$KRB5ROOT/bin/krb5-config
2084 AC_MSG_RESULT($KRB5CONF)
2085
2086 AC_MSG_CHECKING(for gssapi support)
2087 if $KRB5CONF | grep gssapi >/dev/null ; then
2088 AC_MSG_RESULT(yes)
2089 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
2090 dnl m4 quadragraphs: "sed 's/-l[^- ]*//g'"
2091 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
2092 K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002093 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002094 AC_MSG_RESULT(no)
2095 K5CFLAGS="`$KRB5CONF --cflags`"
2096 K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
2097 K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002098 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002099 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2100 LDFLAGS="$LDFLAGS $K5LDFLAGS"
2101 AC_MSG_CHECKING(whether we are using Heimdal)
2102 AC_TRY_COMPILE([ #include <krb5.h> ],
2103 [ char *tmp = heimdal_version; ],
2104 [ AC_MSG_RESULT(yes)
2105 AC_DEFINE(HEIMDAL) ],
2106 AC_MSG_RESULT(no)
2107 )
2108 else
2109 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002110 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002111 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002112 AC_MSG_CHECKING(whether we are using Heimdal)
2113 AC_TRY_COMPILE([ #include <krb5.h> ],
2114 [ char *tmp = heimdal_version; ],
2115 [ AC_MSG_RESULT(yes)
2116 AC_DEFINE(HEIMDAL)
2117 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2118 ],
2119 [ AC_MSG_RESULT(no)
2120 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2121 ]
2122 )
Damien Miller200d0a72003-06-30 19:21:36 +10002123 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002124
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002125 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2126 [ AC_DEFINE(GSSAPI)
2127 K5LIBS="-lgssapi $K5LIBS" ],
2128 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2129 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002130 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002131 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2132 $K5LIBS)
2133 ],
2134 $K5LIBS)
2135
2136 AC_CHECK_HEADER(gssapi.h, ,
2137 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002138 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002139 AC_CHECK_HEADERS(gssapi.h, ,
2140 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002141 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002142 ]
2143 )
2144
2145 oldCPP="$CPPFLAGS"
2146 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2147 AC_CHECK_HEADER(gssapi_krb5.h, ,
2148 [ CPPFLAGS="$oldCPP" ])
2149
Damien Millera8e06ce2003-11-21 23:48:55 +11002150 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002151 if test ! -z "$need_dash_r" ; then
2152 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2153 fi
2154 if test ! -z "$blibpath" ; then
2155 blibpath="$blibpath:${KRB5ROOT}/lib"
2156 fi
2157 fi ]
2158 AC_SEARCH_LIBS(k_hasafs, kafs,
Darren Tucker3c78c5e2004-01-23 22:03:10 +11002159 [ AC_DEFINE(USE_AFS)
Darren Tucker1d3ca582004-01-22 12:05:34 +11002160 K5LIBS="-lkafs $K5LIBS"
2161 ]
2162 )
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002163)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002164LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002165
Damien Millera22ba012000-03-02 23:09:20 +11002166# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002167
Damien Millerf58c6722002-05-13 13:15:42 +10002168PRIVSEP_PATH=/var/empty
2169AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002170 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002171 [
2172 if test "x$withval" != "$no" ; then
2173 PRIVSEP_PATH=$withval
2174 fi
2175 ]
2176)
2177AC_SUBST(PRIVSEP_PATH)
2178
Damien Millera22ba012000-03-02 23:09:20 +11002179AC_ARG_WITH(xauth,
2180 [ --with-xauth=PATH Specify path to xauth program ],
2181 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002182 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002183 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002184 fi
2185 ],
2186 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002187 TestPath="$PATH"
2188 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2189 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2190 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2191 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2192 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002193 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002194 xauth_path="/usr/openwin/bin/xauth"
2195 fi
2196 ]
2197)
2198
Damien Miller7d901272003-01-13 16:55:22 +11002199STRIP_OPT=-s
2200AC_ARG_ENABLE(strip,
2201 [ --disable-strip Disable calling strip(1) on install],
2202 [
2203 if test "x$enableval" = "xno" ; then
2204 STRIP_OPT=
2205 fi
2206 ]
2207)
2208AC_SUBST(STRIP_OPT)
2209
Damien Millera19cf472000-11-29 13:28:50 +11002210if test -z "$xauth_path" ; then
2211 XAUTH_PATH="undefined"
2212 AC_SUBST(XAUTH_PATH)
2213else
Damien Millera22ba012000-03-02 23:09:20 +11002214 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002215 XAUTH_PATH=$xauth_path
2216 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002217fi
Damien Millera22ba012000-03-02 23:09:20 +11002218
2219# Check for mail directory (last resort if we cannot get it from headers)
2220if test ! -z "$MAIL" ; then
2221 maildir=`dirname $MAIL`
2222 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2223fi
2224
Damien Millera22ba012000-03-02 23:09:20 +11002225if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002226 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002227 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002228 [
2229 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2230 have_dev_ptmx=1
2231 ]
2232 )
2233 fi
Damien Millera22ba012000-03-02 23:09:20 +11002234fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002235AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002236 [
2237 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2238 have_dev_ptc=1
2239 ]
2240)
2241
Damien Millera22ba012000-03-02 23:09:20 +11002242# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002243AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002244 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002245 [
Damien Miller897741e2001-04-16 10:41:46 +10002246 case "$withval" in
2247 man|cat|doc)
2248 MANTYPE=$withval
2249 ;;
2250 *)
2251 AC_MSG_ERROR(invalid man type: $withval)
2252 ;;
2253 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002254 ]
2255)
Ben Lindstrombc709922001-04-18 18:04:21 +00002256if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002257 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2258 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002259 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2260 MANTYPE=doc
2261 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2262 MANTYPE=man
2263 else
2264 MANTYPE=cat
2265 fi
2266fi
Damien Miller670a4b82000-01-22 13:53:11 +11002267AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002268if test "$MANTYPE" = "doc"; then
2269 mansubdir=man;
2270else
2271 mansubdir=$MANTYPE;
2272fi
2273AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002274
Damien Millera22ba012000-03-02 23:09:20 +11002275# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002276MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002277AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002278 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002279 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002280 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002281 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002282 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002283 fi
2284 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002285)
2286
Damien Millera22ba012000-03-02 23:09:20 +11002287# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002288AC_ARG_WITH(shadow,
2289 [ --without-shadow Disable shadow password support],
2290 [
2291 if test "x$withval" = "xno" ; then
2292 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002293 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002294 fi
2295 ]
2296)
2297
Damien Miller1f335fb2000-06-26 11:31:33 +10002298if test -z "$disable_shadow" ; then
2299 AC_MSG_CHECKING([if the systems has expire shadow information])
2300 AC_TRY_COMPILE(
2301 [
2302#include <sys/types.h>
2303#include <shadow.h>
2304 struct spwd sp;
2305 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2306 [ sp_expire_available=yes ], []
2307 )
2308
2309 if test "x$sp_expire_available" = "xyes" ; then
2310 AC_MSG_RESULT(yes)
2311 AC_DEFINE(HAS_SHADOW_EXPIRE)
2312 else
2313 AC_MSG_RESULT(no)
2314 fi
2315fi
2316
Damien Millera22ba012000-03-02 23:09:20 +11002317# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002318if test ! -z "$IPADDR_IN_DISPLAY" ; then
2319 DISPLAY_HACK_MSG="yes"
2320 AC_DEFINE(IPADDR_IN_DISPLAY)
2321else
Damien Millera8e06ce2003-11-21 23:48:55 +11002322 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002323 AC_ARG_WITH(ipaddr-display,
2324 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2325 [
2326 if test "x$withval" != "xno" ; then
2327 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002328 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002329 fi
2330 ]
2331 )
2332fi
Damien Miller76112de1999-12-21 11:18:08 +11002333
Darren Tuckere1a790d2003-09-16 11:52:19 +10002334# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002335AC_ARG_ENABLE(etc-default-login,
2336 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2337[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002338AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2339
2340if test "x$external_path_file" = "x/etc/default/login"; then
2341 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2342fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002343])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002344
Tim Rice43a1c132002-04-17 21:19:14 -07002345dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2346if test $ac_cv_func_login_getcapbool = "yes" -a \
2347 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002348 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002349fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002350
Damien Millera22ba012000-03-02 23:09:20 +11002351# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002352SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002353AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002354 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002355 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002356 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002357 AC_MSG_WARN([
2358--with-default-path=PATH has no effect on this system.
2359Edit /etc/login.conf instead.])
2360 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002361 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002362 AC_MSG_WARN([
2363--with-default-path=PATH will only be used if PATH is not defined in
2364$external_path_file .])
2365 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002366 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002367 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002368 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002369 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002370 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2371 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002372 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002373 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002374 AC_MSG_WARN([
2375If PATH is defined in $external_path_file, ensure the path to scp is included,
2376otherwise scp will not work.])
2377 fi
2378 AC_TRY_RUN(
2379 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002380/* find out what STDPATH is */
2381#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002382#ifdef HAVE_PATHS_H
2383# include <paths.h>
2384#endif
2385#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002386# ifdef _PATH_USERPATH /* Irix */
2387# define _PATH_STDPATH _PATH_USERPATH
2388# else
2389# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2390# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002391#endif
2392#include <sys/types.h>
2393#include <sys/stat.h>
2394#include <fcntl.h>
2395#define DATA "conftest.stdpath"
2396
2397main()
2398{
2399 FILE *fd;
2400 int rc;
2401
2402 fd = fopen(DATA,"w");
2403 if(fd == NULL)
2404 exit(1);
2405
2406 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2407 exit(1);
2408
2409 exit(0);
2410}
2411 ], [ user_path=`cat conftest.stdpath` ],
2412 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2413 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2414 )
2415# make sure $bindir is in USER_PATH so scp will work
2416 t_bindir=`eval echo ${bindir}`
2417 case $t_bindir in
2418 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2419 esac
2420 case $t_bindir in
2421 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2422 esac
2423 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2424 if test $? -ne 0 ; then
2425 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2426 if test $? -ne 0 ; then
2427 user_path=$user_path:$t_bindir
2428 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2429 fi
2430 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002431 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002432)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002433if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002434 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2435 AC_SUBST(user_path)
2436fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002437
Damien Millera18bbd32002-05-13 10:48:57 +10002438# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002439AC_ARG_WITH(superuser-path,
2440 [ --with-superuser-path= Specify different path for super-user],
2441 [
2442 if test "x$withval" != "xno" ; then
2443 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2444 superuser_path=$withval
2445 fi
2446 ]
2447)
2448
2449
Damien Miller61e50f12000-05-08 20:49:37 +10002450AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002451IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002452AC_ARG_WITH(4in6,
2453 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2454 [
2455 if test "x$withval" != "xno" ; then
2456 AC_MSG_RESULT(yes)
2457 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002458 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002459 else
2460 AC_MSG_RESULT(no)
2461 fi
2462 ],[
2463 if test "x$inet6_default_4in6" = "xyes"; then
2464 AC_MSG_RESULT([yes (default)])
2465 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002466 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002467 else
2468 AC_MSG_RESULT([no (default)])
2469 fi
2470 ]
2471)
2472
Damien Miller60396b02001-02-18 17:01:00 +11002473# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002474BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002475AC_ARG_WITH(bsd-auth,
2476 [ --with-bsd-auth Enable BSD auth support],
2477 [
2478 if test "x$withval" != "xno" ; then
2479 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002480 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002481 fi
2482 ]
2483)
2484
Damien Millera22ba012000-03-02 23:09:20 +11002485# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002486piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002487# make sure the directory exists
2488if test ! -d $piddir ; then
2489 piddir=`eval echo ${sysconfdir}`
2490 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002491 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002492 esac
2493fi
2494
Tim Rice88f2ab52002-03-17 12:17:34 -08002495AC_ARG_WITH(pid-dir,
2496 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2497 [
2498 if test "x$withval" != "xno" ; then
2499 piddir=$withval
2500 if test ! -d $piddir ; then
2501 AC_MSG_WARN([** no $piddir directory on this system **])
2502 fi
2503 fi
2504 ]
2505)
2506
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002507AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002508AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002509
andre2ff7b5d2000-06-03 14:57:40 +00002510dnl allow user to disable some login recording features
2511AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002512 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002513 [
2514 if test "x$enableval" = "xno" ; then
2515 AC_DEFINE(DISABLE_LASTLOG)
2516 fi
2517 ]
andre2ff7b5d2000-06-03 14:57:40 +00002518)
2519AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002520 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002521 [
2522 if test "x$enableval" = "xno" ; then
2523 AC_DEFINE(DISABLE_UTMP)
2524 fi
2525 ]
andre2ff7b5d2000-06-03 14:57:40 +00002526)
2527AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002528 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002529 [
2530 if test "x$enableval" = "xno" ; then
2531 AC_DEFINE(DISABLE_UTMPX)
2532 fi
2533 ]
andre2ff7b5d2000-06-03 14:57:40 +00002534)
2535AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002536 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002537 [
2538 if test "x$enableval" = "xno" ; then
2539 AC_DEFINE(DISABLE_WTMP)
2540 fi
2541 ]
andre2ff7b5d2000-06-03 14:57:40 +00002542)
2543AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002544 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002545 [
2546 if test "x$enableval" = "xno" ; then
2547 AC_DEFINE(DISABLE_WTMPX)
2548 fi
2549 ]
andre2ff7b5d2000-06-03 14:57:40 +00002550)
2551AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002552 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002553 [
2554 if test "x$enableval" = "xno" ; then
2555 AC_DEFINE(DISABLE_LOGIN)
2556 fi
2557 ]
andre2ff7b5d2000-06-03 14:57:40 +00002558)
2559AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002560 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002561 [
2562 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002563 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002564 fi
2565 ]
andre2ff7b5d2000-06-03 14:57:40 +00002566)
2567AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002568 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002569 [
2570 if test "x$enableval" = "xno" ; then
2571 AC_DEFINE(DISABLE_PUTUTXLINE)
2572 fi
2573 ]
andre2ff7b5d2000-06-03 14:57:40 +00002574)
2575AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002576 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002577 [
2578 if test "x$withval" = "xno" ; then
2579 AC_DEFINE(DISABLE_LASTLOG)
2580 else
2581 conf_lastlog_location=$withval
2582 fi
2583 ]
2584)
andre2ff7b5d2000-06-03 14:57:40 +00002585
2586dnl lastlog, [uw]tmpx? detection
2587dnl NOTE: set the paths in the platform section to avoid the
2588dnl need for command-line parameters
2589dnl lastlog and [uw]tmp are subject to a file search if all else fails
2590
2591dnl lastlog detection
2592dnl NOTE: the code itself will detect if lastlog is a directory
2593AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2594AC_TRY_COMPILE([
2595#include <sys/types.h>
2596#include <utmp.h>
2597#ifdef HAVE_LASTLOG_H
2598# include <lastlog.h>
2599#endif
Damien Miller2994e082000-06-04 15:51:47 +10002600#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002601# include <paths.h>
2602#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002603#ifdef HAVE_LOGIN_H
2604# include <login.h>
2605#endif
andre2ff7b5d2000-06-03 14:57:40 +00002606 ],
2607 [ char *lastlog = LASTLOG_FILE; ],
2608 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002609 [
2610 AC_MSG_RESULT(no)
2611 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2612 AC_TRY_COMPILE([
2613#include <sys/types.h>
2614#include <utmp.h>
2615#ifdef HAVE_LASTLOG_H
2616# include <lastlog.h>
2617#endif
2618#ifdef HAVE_PATHS_H
2619# include <paths.h>
2620#endif
2621 ],
2622 [ char *lastlog = _PATH_LASTLOG; ],
2623 [ AC_MSG_RESULT(yes) ],
2624 [
andree441aa32000-06-12 22:34:38 +00002625 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002626 system_lastlog_path=no
2627 ])
2628 ]
andre2ff7b5d2000-06-03 14:57:40 +00002629)
Damien Miller2994e082000-06-04 15:51:47 +10002630
andre2ff7b5d2000-06-03 14:57:40 +00002631if test -z "$conf_lastlog_location"; then
2632 if test x"$system_lastlog_path" = x"no" ; then
2633 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002634 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002635 conf_lastlog_location=$f
2636 fi
2637 done
2638 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002639 AC_MSG_WARN([** Cannot find lastlog **])
2640 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002641 fi
2642 fi
2643fi
2644
2645if test -n "$conf_lastlog_location"; then
2646 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2647fi
2648
2649dnl utmp detection
2650AC_MSG_CHECKING([if your system defines UTMP_FILE])
2651AC_TRY_COMPILE([
2652#include <sys/types.h>
2653#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002654#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002655# include <paths.h>
2656#endif
2657 ],
2658 [ char *utmp = UTMP_FILE; ],
2659 [ AC_MSG_RESULT(yes) ],
2660 [ AC_MSG_RESULT(no)
2661 system_utmp_path=no ]
2662)
2663if test -z "$conf_utmp_location"; then
2664 if test x"$system_utmp_path" = x"no" ; then
2665 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2666 if test -f $f ; then
2667 conf_utmp_location=$f
2668 fi
2669 done
2670 if test -z "$conf_utmp_location"; then
2671 AC_DEFINE(DISABLE_UTMP)
2672 fi
2673 fi
2674fi
2675if test -n "$conf_utmp_location"; then
2676 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2677fi
2678
2679dnl wtmp detection
2680AC_MSG_CHECKING([if your system defines WTMP_FILE])
2681AC_TRY_COMPILE([
2682#include <sys/types.h>
2683#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002684#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002685# include <paths.h>
2686#endif
2687 ],
2688 [ char *wtmp = WTMP_FILE; ],
2689 [ AC_MSG_RESULT(yes) ],
2690 [ AC_MSG_RESULT(no)
2691 system_wtmp_path=no ]
2692)
2693if test -z "$conf_wtmp_location"; then
2694 if test x"$system_wtmp_path" = x"no" ; then
2695 for f in /usr/adm/wtmp /var/log/wtmp; do
2696 if test -f $f ; then
2697 conf_wtmp_location=$f
2698 fi
2699 done
2700 if test -z "$conf_wtmp_location"; then
2701 AC_DEFINE(DISABLE_WTMP)
2702 fi
2703 fi
2704fi
2705if test -n "$conf_wtmp_location"; then
2706 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2707fi
2708
2709
2710dnl utmpx detection - I don't know any system so perverse as to require
2711dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2712dnl there, though.
2713AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2714AC_TRY_COMPILE([
2715#include <sys/types.h>
2716#include <utmp.h>
2717#ifdef HAVE_UTMPX_H
2718#include <utmpx.h>
2719#endif
Damien Miller2994e082000-06-04 15:51:47 +10002720#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002721# include <paths.h>
2722#endif
2723 ],
2724 [ char *utmpx = UTMPX_FILE; ],
2725 [ AC_MSG_RESULT(yes) ],
2726 [ AC_MSG_RESULT(no)
2727 system_utmpx_path=no ]
2728)
2729if test -z "$conf_utmpx_location"; then
2730 if test x"$system_utmpx_path" = x"no" ; then
2731 AC_DEFINE(DISABLE_UTMPX)
2732 fi
2733else
2734 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2735fi
2736
2737dnl wtmpx detection
2738AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2739AC_TRY_COMPILE([
2740#include <sys/types.h>
2741#include <utmp.h>
2742#ifdef HAVE_UTMPX_H
2743#include <utmpx.h>
2744#endif
Damien Miller2994e082000-06-04 15:51:47 +10002745#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002746# include <paths.h>
2747#endif
2748 ],
2749 [ char *wtmpx = WTMPX_FILE; ],
2750 [ AC_MSG_RESULT(yes) ],
2751 [ AC_MSG_RESULT(no)
2752 system_wtmpx_path=no ]
2753)
2754if test -z "$conf_wtmpx_location"; then
2755 if test x"$system_wtmpx_path" = x"no" ; then
2756 AC_DEFINE(DISABLE_WTMPX)
2757 fi
2758else
2759 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2760fi
2761
Damien Miller4018c192000-04-30 09:30:44 +10002762
Damien Miller29ea30d2000-03-17 10:54:15 +11002763if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002764 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2765 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002766fi
2767
Tim Rice4cec93f2002-02-26 08:40:48 -08002768dnl remove pam and dl because they are in $LIBPAM
2769if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002770 LIBS=`echo $LIBS | sed 's/-lpam //'`
2771fi
2772if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2773 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002774fi
2775
Damien Millerbac2d8a2000-09-05 16:13:06 +11002776AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002777AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2778AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002779
Damien Miller7b22d652000-06-18 14:07:04 +10002780# Print summary of options
2781
Damien Miller7b22d652000-06-18 14:07:04 +10002782# Someone please show me a better way :)
2783A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2784B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2785C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2786D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002787E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002788F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002789G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002790H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2791I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2792J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002793
2794echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002795echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002796echo " User binaries: $B"
2797echo " System binaries: $C"
2798echo " Configuration files: $D"
2799echo " Askpass program: $E"
2800echo " Manual pages: $F"
2801echo " PID file: $G"
2802echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002803if test "x$external_path_file" = "x/etc/login.conf" ; then
2804echo " At runtime, sshd will use the path defined in $external_path_file"
2805echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002806else
Damien Millerf58c6722002-05-13 13:15:42 +10002807echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002808 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002809echo " (If PATH is set in $external_path_file it will be used instead. If"
2810echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2811 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002812fi
Damien Millera18bbd32002-05-13 10:48:57 +10002813if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002814echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002815fi
Damien Millerf58c6722002-05-13 13:15:42 +10002816echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002817echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002818echo " KerberosV support: $KRB5_MSG"
2819echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002820echo " S/KEY support: $SKEY_MSG"
2821echo " TCP Wrappers support: $TCPW_MSG"
2822echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002823echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002824echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2825echo " BSD Auth support: $BSD_AUTH_MSG"
2826echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002827if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002828echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002829fi
2830
Damien Miller7b22d652000-06-18 14:07:04 +10002831echo ""
2832
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002833echo " Host: ${host}"
2834echo " Compiler: ${CC}"
2835echo " Compiler flags: ${CFLAGS}"
2836echo "Preprocessor flags: ${CPPFLAGS}"
2837echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002838echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002839
2840echo ""
2841
Damien Miller82cf0ce2000-12-20 13:34:48 +11002842if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002843 echo "PAM is enabled. You may need to install a PAM control file "
2844 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002845 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002846 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002847 echo ""
2848fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002849
Damien Miller6c21c512002-01-22 21:57:53 +11002850if test ! -z "$RAND_HELPER_CMDHASH" ; then
2851 echo "WARNING: you are using the builtin random number collection "
2852 echo "service. Please read WARNING.RNG and request that your OS "
2853 echo "vendor includes kernel-based random number collection in "
2854 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002855 echo ""
2856fi
Damien Miller60396b02001-02-18 17:01:00 +11002857