blob: 91a4c4eeb20f1622d5d7bf8e7790dd7081e86d06 [file] [log] [blame]
Tim Rice43fa5572004-02-11 14:46:40 -08001# $Id: configure.ac,v 1.197 2004/02/11 22:46:40 tim 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)
Darren Tuckere41bba52003-08-25 11:51:19 +1000168 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000169 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700170 LIBS="$LIBS -lsec -lsecpw"
171 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000172 disable_ptmx_check=yes
173 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100174*-*-hpux10*)
175 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000176 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100177 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000178 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100179 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000180 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000181 AC_DEFINE(LOGIN_NO_ENDOPT)
182 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000183 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000184 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700185 LIBS="$LIBS -lsec"
186 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100187 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000188*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000189 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100190 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100191 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100192 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000193 AC_DEFINE(LOGIN_NO_ENDOPT)
194 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100195 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000196 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000197 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tuckerf58fb7e2004-02-06 15:59:06 +1100198 case "$host" in
199 *-*-hpux11.11*)
200 AC_DEFINE(BROKEN_GETADDRINFO);;
201 esac
Tim Ricef028f1e2002-07-19 12:41:10 -0700202 LIBS="$LIBS -lsec"
203 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000204 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100205*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100206 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000207 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000208 AC_DEFINE(SETEUID_BREAKS_SETUID)
209 AC_DEFINE(BROKEN_SETREUID)
210 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000211 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000212 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100213 ;;
214*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100215 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000216 AC_DEFINE(WITH_IRIX_ARRAY)
217 AC_DEFINE(WITH_IRIX_PROJECT)
218 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000219 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000220 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000221 AC_DEFINE(SETEUID_BREAKS_SETUID)
222 AC_DEFINE(BROKEN_SETREUID)
223 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000224 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000225 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100226 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100227*-*-linux*)
228 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100229 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000230 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100231 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000232 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000233 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000234 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100235 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000236 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000237 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000238 AC_DEFINE(BROKEN_CMSG_TYPE)
239 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000240 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100241 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000242mips-sony-bsd|mips-sony-newsos4)
243 AC_DEFINE(HAVE_NEWS4)
244 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000245 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100246*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000247 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800248 if test "x$withval" != "xno" ; then
249 need_dash_r=1
250 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100251 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100252*-*-freebsd*)
253 check_for_libcrypt_later=1
254 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000255*-*-bsdi*)
256 AC_DEFINE(SETEUID_BREAKS_SETUID)
257 AC_DEFINE(BROKEN_SETREUID)
258 AC_DEFINE(BROKEN_SETREGID)
259 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000260*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000261 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100262 conf_utmp_location=/etc/utmp
263 conf_wtmp_location=/usr/adm/wtmp
264 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000265 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000266 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000267 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100268 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000269 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100270*-*-solaris*)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100271 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000272 AC_DEFINE(LOGIN_NEEDS_UTMPX)
273 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000274 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000275 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000276 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
277 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000278 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000279 # hardwire lastlog location (can't detect it on some versions)
280 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000281 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
282 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
283 if test "$sol2ver" -ge 8; then
284 AC_MSG_RESULT(yes)
285 AC_DEFINE(DISABLE_UTMP)
286 AC_DEFINE(DISABLE_WTMP)
287 else
288 AC_MSG_RESULT(no)
289 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100290 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000291*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000292 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000293 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100294 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000295 conf_utmp_location=/etc/utmp
296 conf_wtmp_location=/var/adm/wtmp
297 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000298 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000299 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000300*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700301 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000302 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000303 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000304 AC_DEFINE(SETEUID_BREAKS_SETUID)
305 AC_DEFINE(BROKEN_SETREUID)
306 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000307 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000308*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700309 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000310 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100311 IPADDR_IN_DISPLAY=yes
312 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000313 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000314 AC_DEFINE(SETEUID_BREAKS_SETUID)
315 AC_DEFINE(BROKEN_SETREUID)
316 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000317 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000318 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700319 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
320 # Attention: always take care to bind libsocket and libnsl before libc,
321 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000322 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100323*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100324 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700325 AC_DEFINE(SETEUID_BREAKS_SETUID)
326 AC_DEFINE(BROKEN_SETREUID)
327 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100328 ;;
329*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100330 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700331 AC_DEFINE(SETEUID_BREAKS_SETUID)
332 AC_DEFINE(BROKEN_SETREUID)
333 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100334 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100335*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100336 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100337*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800338 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Rice13aae5e2001-10-21 17:53:58 -0700339 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100340 RANLIB=true
341 no_dev_ptmx=1
342 AC_DEFINE(BROKEN_SYS_TERMIO_H)
343 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000344 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000345 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100346 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700347 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100348 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700349 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700350 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100351 ;;
352*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800353 if test -z "$GCC"; then
354 CFLAGS="$CFLAGS -belf"
355 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100356 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000357 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100358 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000359 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000360 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700361 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700362 AC_DEFINE(SETEUID_BREAKS_SETUID)
363 AC_DEFINE(BROKEN_SETREUID)
364 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700365 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100366 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700367 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000368 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000369*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100370 AC_DEFINE(NO_SSH_LASTLOG)
371 AC_DEFINE(SETEUID_BREAKS_SETUID)
372 AC_DEFINE(BROKEN_SETREUID)
373 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000374 AC_DEFINE(USE_PIPES)
375 AC_DEFINE(DISABLE_FD_PASSING)
376 LDFLAGS="$LDFLAGS"
377 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
378 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000379 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000380*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100381 AC_DEFINE(SETEUID_BREAKS_SETUID)
382 AC_DEFINE(BROKEN_SETREUID)
383 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000384 AC_DEFINE(WITH_ABBREV_NO_TTY)
385 AC_DEFINE(USE_PIPES)
386 AC_DEFINE(DISABLE_FD_PASSING)
387 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100388 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000389 MANTYPE=cat
390 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000391*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100392 AC_DEFINE(SETEUID_BREAKS_SETUID)
393 AC_DEFINE(BROKEN_SETREUID)
394 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000395 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700396 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700397 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000398 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
399 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
400 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700401 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000402*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000403 AC_MSG_CHECKING(for Digital Unix SIA)
404 no_osfsia=""
405 AC_ARG_WITH(osfsia,
406 [ --with-osfsia Enable Digital Unix SIA],
407 [
408 if test "x$withval" = "xno" ; then
409 AC_MSG_RESULT(disabled)
410 no_osfsia=1
411 fi
412 ],
413 )
414 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000415 if test -f /etc/sia/matrix.conf; then
416 AC_MSG_RESULT(yes)
417 AC_DEFINE(HAVE_OSF_SIA)
418 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000419 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000420 LIBS="$LIBS -lsecurity -ldb -lm -laud"
421 else
422 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100423 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000424 fi
425 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000426 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700427 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000428 AC_DEFINE(BROKEN_SETREUID)
429 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000430 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000431
432*-*-nto-qnx)
433 AC_DEFINE(USE_PIPES)
434 AC_DEFINE(NO_X11_UNIX_SOCKETS)
435 AC_DEFINE(MISSING_NFDBITS)
436 AC_DEFINE(MISSING_HOWMANY)
437 AC_DEFINE(MISSING_FD_MASK)
438 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100439esac
440
Damien Millere37bfc12000-06-05 09:37:43 +1000441# Allow user to specify flags
442AC_ARG_WITH(cflags,
443 [ --with-cflags Specify additional flags to pass to compiler],
444 [
445 if test "x$withval" != "xno" ; then
446 CFLAGS="$CFLAGS $withval"
447 fi
448 ]
449)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000450AC_ARG_WITH(cppflags,
451 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
452 [
453 if test "x$withval" != "xno"; then
454 CPPFLAGS="$CPPFLAGS $withval"
455 fi
456 ]
457)
Damien Millere37bfc12000-06-05 09:37:43 +1000458AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000459 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000460 [
461 if test "x$withval" != "xno" ; then
462 LDFLAGS="$LDFLAGS $withval"
463 fi
464 ]
465)
466AC_ARG_WITH(libs,
467 [ --with-libs Specify additional libraries to link with],
468 [
469 if test "x$withval" != "xno" ; then
470 LIBS="$LIBS $withval"
471 fi
472 ]
473)
474
Darren Tucker6eb93042003-06-29 21:30:41 +1000475AC_MSG_CHECKING(compiler and flags for sanity)
476AC_TRY_RUN([
477#include <stdio.h>
478int main(){exit(0);}
479 ],
480 [ AC_MSG_RESULT(yes) ],
481 [
482 AC_MSG_RESULT(no)
483 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
484 ]
485)
486
Tim Rice4cec93f2002-02-26 08:40:48 -0800487# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000488AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000489 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800490 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100491 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000492 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000493 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
Tim Rice2597bfd2004-01-26 19:03:39 -0800494 sys/cdefs.h sys/mman.h sys/pstat.h sys/ptms.h sys/select.h sys/stat.h \
Darren Tucker07459352004-02-06 21:29:41 +1100495 sys/stream.h sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700496 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Damien Miller5c3a5582003-09-23 22:12:38 +1000497 util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800498
Damien Millera22ba012000-03-02 23:09:20 +1100499# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700500AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
501AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000502
Damien Millerdf288022001-02-18 13:07:07 +1100503dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700504if test "x$with_tcp_wrappers" != "xno" ; then
505 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
506 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
507 fi
508fi
Damien Millerdf288022001-02-18 13:07:07 +1100509
Tim Rice1e1ef642003-09-11 22:19:31 -0700510dnl IRIX and Solaris 2.5.1 have dirname() in libgen
511AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
512 AC_CHECK_LIB(gen, dirname,[
513 AC_CACHE_CHECK([for broken dirname],
514 ac_cv_have_broken_dirname, [
515 save_LIBS="$LIBS"
516 LIBS="$LIBS -lgen"
517 AC_TRY_RUN(
518 [
519#include <libgen.h>
520#include <string.h>
521
522int main(int argc, char **argv) {
523 char *s, buf[32];
524
525 strncpy(buf,"/etc", 32);
526 s = dirname(buf);
527 if (!s || strncmp(s, "/", 32) != 0) {
528 exit(1);
529 } else {
530 exit(0);
531 }
532}
533 ],
534 [ ac_cv_have_broken_dirname="no" ],
535 [ ac_cv_have_broken_dirname="yes" ]
536 )
537 LIBS="$save_LIBS"
538 ])
539 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
540 LIBS="$LIBS -lgen"
541 AC_DEFINE(HAVE_DIRNAME)
542 AC_CHECK_HEADERS(libgen.h)
543 fi
544 ])
545])
546
547AC_CHECK_FUNC(getspnam, ,
548 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
549AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
550
Tim Rice13aae5e2001-10-21 17:53:58 -0700551dnl zlib is required
552AC_ARG_WITH(zlib,
553 [ --with-zlib=PATH Use zlib in PATH],
554 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000555 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100556 AC_MSG_ERROR([*** zlib is required ***])
557 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700558 if test -d "$withval/lib"; then
559 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700560 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700561 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700562 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700563 fi
564 else
565 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700566 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700567 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700568 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700569 fi
570 fi
571 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700572 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700573 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700574 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700575 fi
576 ]
577)
578
Tim Ricefcb62202004-01-23 18:35:16 -0800579AC_CHECK_LIB(z, deflate, ,
580 [
581 saved_CPPFLAGS="$CPPFLAGS"
582 saved_LDFLAGS="$LDFLAGS"
583 save_LIBS="$LIBS"
584 dnl Check default zlib install dir
585 if test -n "${need_dash_r}"; then
586 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
587 else
588 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
589 fi
590 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
591 LIBS="$LIBS -lz"
592 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
593 [
594 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
595 ]
596 )
597 ]
598)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100599AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100600
601AC_ARG_WITH(zlib-version-check,
602 [ --without-zlib-version-check Disable zlib version check],
603 [ if test "x$withval" = "xno" ; then
604 zlib_check_nonfatal=1
605 fi
606 ]
607)
608
Darren Tucker2dcd2392004-01-23 17:13:33 +1100609AC_MSG_CHECKING(for zlib 1.1.4 or greater)
610AC_TRY_RUN([
611#include <zlib.h>
612int main()
613{
614 int a, b, c, v;
615 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
616 exit(1);
617 v = a*1000000 + b*1000 + c;
618 if (v >= 1001004)
619 exit(0);
620 exit(2);
621}
622 ],
623 AC_MSG_RESULT(yes),
624 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100625 if test -z "$zlib_check_nonfatal" ; then
626 AC_MSG_ERROR([*** zlib too old - check config.log ***
627Your reported zlib version has known security problems. It's possible your
628vendor has fixed these problems without changing the version number. If you
629are sure this is the case, you can disable the check by running
630"./configure --without-zlib-version-check".
631If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
632 else
633 AC_MSG_WARN([zlib version may have security problems])
634 fi
635 ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100636)
Damien Miller6f9c3372000-10-25 10:06:04 +1100637
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000638dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100639AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000640 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
641)
Damien Millera8e06ce2003-11-21 23:48:55 +1100642AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700643 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
644 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000645)
Damien Millerab18c411999-11-11 10:40:23 +1100646
Tim Ricee589a292001-11-03 11:09:32 -0800647dnl Checks for libutil functions
648AC_CHECK_HEADERS(libutil.h)
649AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
650AC_CHECK_FUNCS(logout updwtmp logwtmp)
651
Ben Lindstrom8697e082001-02-24 21:41:10 +0000652AC_FUNC_STRFTIME
653
Damien Miller3c027682001-03-14 11:39:45 +1100654# Check for ALTDIRFUNC glob() extension
655AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
656AC_EGREP_CPP(FOUNDIT,
657 [
658 #include <glob.h>
659 #ifdef GLOB_ALTDIRFUNC
660 FOUNDIT
661 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100662 ],
Damien Miller3c027682001-03-14 11:39:45 +1100663 [
664 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
665 AC_MSG_RESULT(yes)
666 ],
667 [
668 AC_MSG_RESULT(no)
669 ]
670)
Damien Millerab18c411999-11-11 10:40:23 +1100671
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000672# Check for g.gl_matchc glob() extension
673AC_MSG_CHECKING(for gl_matchc field in glob_t)
674AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100675 [
676 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000677 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100678 ],
679 [
680 AC_DEFINE(GLOB_HAS_GL_MATCHC)
681 AC_MSG_RESULT(yes)
682 ],
683 [
684 AC_MSG_RESULT(no)
685 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000686)
687
Damien Miller18bb4732001-03-28 14:35:30 +1000688AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
689AC_TRY_RUN(
690 [
691#include <sys/types.h>
692#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700693int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000694 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100695 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000696 [
697 AC_MSG_RESULT(no)
698 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
699 ]
700)
701
Damien Millerc547bf12001-02-16 10:18:12 +1100702# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100703SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100704AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700705 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100706 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100707 [
708 if test "x$withval" != "xno" ; then
709
710 if test "x$withval" != "xyes" ; then
711 CPPFLAGS="$CPPFLAGS -I${withval}/include"
712 LDFLAGS="$LDFLAGS -L${withval}/lib"
713 fi
714
715 AC_DEFINE(SKEY)
716 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100717 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100718
Tim Rice4cec93f2002-02-26 08:40:48 -0800719 AC_MSG_CHECKING([for s/key support])
720 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100721 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800722#include <stdio.h>
723#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700724int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800725 ],
726 [AC_MSG_RESULT(yes)],
727 [
728 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100729 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
730 ])
731 fi
732 ]
733)
734
735# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700736TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100737AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700738 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100739 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100740 [
741 if test "x$withval" != "xno" ; then
742 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700743 saved_LDFLAGS="$LDFLAGS"
744 saved_CPPFLAGS="$CPPFLAGS"
745 if test -n "${withval}" -a "${withval}" != "yes"; then
746 if test -d "${withval}/lib"; then
747 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700748 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700749 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700750 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700751 fi
752 else
753 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700754 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700755 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700756 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700757 fi
758 fi
759 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700760 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700761 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700762 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700763 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700764 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800765 LIBWRAP="-lwrap"
766 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100767 AC_MSG_CHECKING(for libwrap)
768 AC_TRY_LINK(
769 [
770#include <tcpd.h>
771 int deny_severity = 0, allow_severity = 0;
772 ],
773 [hosts_access(0);],
774 [
775 AC_MSG_RESULT(yes)
776 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800777 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700778 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100779 ],
780 [
781 AC_MSG_ERROR([*** libwrap missing])
782 ]
783 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800784 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100785 fi
786 ]
787)
788
Damien Millerfe1f1432003-02-24 15:45:42 +1100789dnl Checks for library functions. Please keep in alphabetical order
790AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000791 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000792 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000793 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000794 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100795 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000796 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
797 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
798 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100799 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000800 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000801 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tuckerc28b88a2004-02-10 16:49:35 +1100802 truncate updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100803)
Tim Rice13aae5e2001-10-21 17:53:58 -0700804
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000805# IRIX has a const char return value for gai_strerror()
806AC_CHECK_FUNCS(gai_strerror,[
807 AC_DEFINE(HAVE_GAI_STRERROR)
808 AC_TRY_COMPILE([
809#include <sys/types.h>
810#include <sys/socket.h>
811#include <netdb.h>
812
813const char *gai_strerror(int);],[
814char *str;
815
816str = gai_strerror(0);],[
817 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
818 [Define if gai_strerror() returns const char *])])])
819
Damien Millercd6853c2003-01-28 11:33:42 +1100820AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
821
Darren Tuckerf1159b52003-07-07 19:44:01 +1000822dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000823AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000824AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000825
Darren Tuckerb2427c82003-09-10 15:22:44 +1000826dnl tcsendbreak might be a macro
827AC_CHECK_DECL(tcsendbreak,
828 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100829 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000830 [#include <termios.h>]
831)
832
Darren Tucker2a6b0292003-12-31 14:59:17 +1100833AC_CHECK_FUNCS(setresuid, [
834 dnl Some platorms have setresuid that isn't implemented, test for this
835 AC_MSG_CHECKING(if setresuid seems to work)
836 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100837#include <stdlib.h>
838#include <errno.h>
839int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100840 ],
841 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100842 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100843 AC_MSG_RESULT(not implemented)]
844 )
845])
Darren Tuckere937be32003-12-17 18:53:26 +1100846
Darren Tucker2a6b0292003-12-31 14:59:17 +1100847AC_CHECK_FUNCS(setresgid, [
848 dnl Some platorms have setresgid that isn't implemented, test for this
849 AC_MSG_CHECKING(if setresgid seems to work)
850 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100851#include <stdlib.h>
852#include <errno.h>
853int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100854 ],
855 [AC_MSG_RESULT(yes)],
856 [AC_DEFINE(BROKEN_SETRESGID)
857 AC_MSG_RESULT(not implemented)]
858 )
859])
Darren Tuckere937be32003-12-17 18:53:26 +1100860
Damien Millerad833b32000-08-23 10:46:23 +1000861dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000862AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000863dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000864AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000865AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000866dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000867AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000868AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100869
Damien Millera8e06ce2003-11-21 23:48:55 +1100870AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100871 [AC_DEFINE(HAVE_DAEMON)],
872 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
873)
874
Damien Millera8e06ce2003-11-21 23:48:55 +1100875AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100876 [AC_DEFINE(HAVE_GETPAGESIZE)],
877 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
878)
879
Damien Millercb170cb2000-07-01 16:52:55 +1000880# Check for broken snprintf
881if test "x$ac_cv_func_snprintf" = "xyes" ; then
882 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
883 AC_TRY_RUN(
884 [
885#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700886int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000887 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100888 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000889 [
890 AC_MSG_RESULT(no)
891 AC_DEFINE(BROKEN_SNPRINTF)
892 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
893 ]
894 )
895fi
896
Damien Millere8328192003-01-07 15:18:32 +1100897dnl see whether mkstemp() requires XXXXXX
898if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
899AC_MSG_CHECKING([for (overly) strict mkstemp])
900AC_TRY_RUN(
901 [
902#include <stdlib.h>
903main() { char template[]="conftest.mkstemp-test";
904if (mkstemp(template) == -1)
905 exit(1);
906unlink(template); exit(0);
907}
908 ],
909 [
910 AC_MSG_RESULT(no)
911 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100912 [
Damien Millere8328192003-01-07 15:18:32 +1100913 AC_MSG_RESULT(yes)
914 AC_DEFINE(HAVE_STRICT_MKSTEMP)
915 ],
916 [
917 AC_MSG_RESULT(yes)
918 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100919 ]
Damien Millere8328192003-01-07 15:18:32 +1100920)
921fi
922
Darren Tucker70a3d552003-08-21 17:58:29 +1000923dnl make sure that openpty does not reacquire controlling terminal
924if test ! -z "$check_for_openpty_ctty_bug"; then
925 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
926 AC_TRY_RUN(
927 [
928#include <stdio.h>
929#include <sys/fcntl.h>
930#include <sys/types.h>
931#include <sys/wait.h>
932
933int
934main()
935{
936 pid_t pid;
937 int fd, ptyfd, ttyfd, status;
938
939 pid = fork();
940 if (pid < 0) { /* failed */
941 exit(1);
942 } else if (pid > 0) { /* parent */
943 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100944 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000945 exit(WEXITSTATUS(status));
946 else
947 exit(2);
948 } else { /* child */
949 close(0); close(1); close(2);
950 setsid();
951 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
952 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
953 if (fd >= 0)
954 exit(3); /* Acquired ctty: broken */
955 else
956 exit(0); /* Did not acquire ctty: OK */
957 }
958}
959 ],
960 [
961 AC_MSG_RESULT(yes)
962 ],
963 [
964 AC_MSG_RESULT(no)
965 AC_DEFINE(SSHD_ACQUIRES_CTTY)
966 ]
967 )
968fi
969
Damien Miller606f8802000-09-16 15:39:56 +1100970AC_FUNC_GETPGRP
971
Damien Millera64b57a2001-01-17 10:44:13 +1100972# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000973PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100974AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100975 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100976 [
Damien Millera64b57a2001-01-17 10:44:13 +1100977 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100978 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
979 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100980 AC_MSG_ERROR([PAM headers not found])
981 fi
982
983 AC_CHECK_LIB(dl, dlopen, , )
984 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
985 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000986 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100987
Damien Millera64b57a2001-01-17 10:44:13 +1100988 PAM_MSG="yes"
989
990 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800991 if test $ac_cv_lib_dl_dlopen = yes; then
992 LIBPAM="-lpam -ldl"
993 else
994 LIBPAM="-lpam"
995 fi
996 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100997 fi
998 ]
999)
Damien Millera22ba012000-03-02 23:09:20 +11001000
Damien Millera64b57a2001-01-17 10:44:13 +11001001# Check for older PAM
1002if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001003 # Check PAM strerror arguments (old PAM)
1004 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1005 AC_TRY_COMPILE(
1006 [
Damien Miller81171112000-04-23 11:14:01 +10001007#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001008#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001009#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001010#elif defined (HAVE_PAM_PAM_APPL_H)
1011#include <pam/pam_appl.h>
1012#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001013 ],
1014 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001015 [AC_MSG_RESULT(no)],
1016 [
1017 AC_DEFINE(HAVE_OLD_PAM)
1018 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001019 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001020 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001021 )
Damien Millera22ba012000-03-02 23:09:20 +11001022fi
1023
Damien Millerfc93d4b2002-09-04 23:26:29 +10001024# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1025# because the system crypt() is more featureful.
1026if test "x$check_for_libcrypt_before" = "x1"; then
1027 AC_CHECK_LIB(crypt, crypt)
1028fi
1029
Tim Riceaef73712002-05-11 13:17:42 -07001030# Search for OpenSSL
1031saved_CPPFLAGS="$CPPFLAGS"
1032saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001033AC_ARG_WITH(ssl-dir,
1034 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1035 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001036 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001037 if test -d "$withval/lib"; then
1038 if test -n "${need_dash_r}"; then
1039 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1040 else
1041 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1042 fi
1043 else
1044 if test -n "${need_dash_r}"; then
1045 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1046 else
1047 LDFLAGS="-L${withval} ${LDFLAGS}"
1048 fi
1049 fi
1050 if test -d "$withval/include"; then
1051 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1052 else
1053 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1054 fi
Damien Millera22ba012000-03-02 23:09:20 +11001055 fi
1056 ]
1057)
Tim Riceaef73712002-05-11 13:17:42 -07001058LIBS="$LIBS -lcrypto"
1059AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001060 [
Tim Riceaef73712002-05-11 13:17:42 -07001061 dnl Check default openssl install dir
1062 if test -n "${need_dash_r}"; then
1063 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001064 else
Tim Riceaef73712002-05-11 13:17:42 -07001065 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001066 fi
Tim Riceaef73712002-05-11 13:17:42 -07001067 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1068 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1069 [
1070 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1071 ]
1072 )
1073 ]
1074)
1075
Tim Riced730b782002-08-13 18:52:10 -07001076# Determine OpenSSL header version
1077AC_MSG_CHECKING([OpenSSL header version])
1078AC_TRY_RUN(
1079 [
1080#include <stdio.h>
1081#include <string.h>
1082#include <openssl/opensslv.h>
1083#define DATA "conftest.sslincver"
1084int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001085 FILE *fd;
1086 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001087
Damien Millera8e06ce2003-11-21 23:48:55 +11001088 fd = fopen(DATA,"w");
1089 if(fd == NULL)
1090 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001091
1092 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1093 exit(1);
1094
1095 exit(0);
1096}
1097 ],
1098 [
1099 ssl_header_ver=`cat conftest.sslincver`
1100 AC_MSG_RESULT($ssl_header_ver)
1101 ],
1102 [
1103 AC_MSG_RESULT(not found)
1104 AC_MSG_ERROR(OpenSSL version header not found.)
1105 ]
1106)
1107
1108# Determine OpenSSL library version
1109AC_MSG_CHECKING([OpenSSL library version])
1110AC_TRY_RUN(
1111 [
1112#include <stdio.h>
1113#include <string.h>
1114#include <openssl/opensslv.h>
1115#include <openssl/crypto.h>
1116#define DATA "conftest.ssllibver"
1117int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001118 FILE *fd;
1119 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001120
Damien Millera8e06ce2003-11-21 23:48:55 +11001121 fd = fopen(DATA,"w");
1122 if(fd == NULL)
1123 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001124
1125 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1126 exit(1);
1127
1128 exit(0);
1129}
1130 ],
1131 [
1132 ssl_library_ver=`cat conftest.ssllibver`
1133 AC_MSG_RESULT($ssl_library_ver)
1134 ],
1135 [
1136 AC_MSG_RESULT(not found)
1137 AC_MSG_ERROR(OpenSSL library not found.)
1138 ]
1139)
Damien Millera22ba012000-03-02 23:09:20 +11001140
Damien Millerec932372002-01-22 22:16:03 +11001141# Sanity check OpenSSL headers
1142AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1143AC_TRY_RUN(
1144 [
1145#include <string.h>
1146#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001147int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001148 ],
1149 [
1150 AC_MSG_RESULT(yes)
1151 ],
1152 [
1153 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001154 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1155Check config.log for details.
1156Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001157 ]
1158)
1159
Damien Millera8e06ce2003-11-21 23:48:55 +11001160# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001161# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001162if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001163 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001164fi
1165
Damien Miller6c21c512002-01-22 21:57:53 +11001166
1167### Configure cryptographic random number support
1168
1169# Check wheter OpenSSL seeds itself
1170AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1171AC_TRY_RUN(
1172 [
1173#include <string.h>
1174#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001175int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001176 ],
1177 [
1178 OPENSSL_SEEDS_ITSELF=yes
1179 AC_MSG_RESULT(yes)
1180 ],
1181 [
1182 AC_MSG_RESULT(no)
1183 # Default to use of the rand helper if OpenSSL doesn't
1184 # seed itself
1185 USE_RAND_HELPER=yes
1186 ]
1187)
1188
1189
1190# Do we want to force the use of the rand helper?
1191AC_ARG_WITH(rand-helper,
1192 [ --with-rand-helper Use subprocess to gather strong randomness ],
1193 [
1194 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001195 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001196 # the previous test showed it to be unseeded.
1197 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1198 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1199 OPENSSL_SEEDS_ITSELF=yes
1200 USE_RAND_HELPER=""
1201 fi
1202 else
1203 USE_RAND_HELPER=yes
1204 fi
1205 ],
1206)
1207
1208# Which randomness source do we use?
1209if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1210 # OpenSSL only
1211 AC_DEFINE(OPENSSL_PRNG_ONLY)
1212 RAND_MSG="OpenSSL internal ONLY"
1213 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001214elif test ! -z "$USE_RAND_HELPER" ; then
1215 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001216 RAND_MSG="ssh-rand-helper"
1217 INSTALL_SSH_RAND_HELPER="yes"
1218fi
1219AC_SUBST(INSTALL_SSH_RAND_HELPER)
1220
1221### Configuration of ssh-rand-helper
1222
1223# PRNGD TCP socket
1224AC_ARG_WITH(prngd-port,
1225 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1226 [
Damien Millere996d722002-01-23 11:20:59 +11001227 case "$withval" in
1228 no)
1229 withval=""
1230 ;;
1231 [[0-9]]*)
1232 ;;
1233 *)
1234 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1235 ;;
1236 esac
1237 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001238 PRNGD_PORT="$withval"
1239 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1240 fi
1241 ]
1242)
1243
1244# PRNGD Unix domain socket
1245AC_ARG_WITH(prngd-socket,
1246 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1247 [
Damien Millere996d722002-01-23 11:20:59 +11001248 case "$withval" in
1249 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001250 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001251 ;;
1252 no)
1253 withval=""
1254 ;;
1255 /*)
1256 ;;
1257 *)
1258 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1259 ;;
1260 esac
1261
1262 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001263 if test ! -z "$PRNGD_PORT" ; then
1264 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1265 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001266 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001267 AC_MSG_WARN(Entropy socket is not readable)
1268 fi
1269 PRNGD_SOCKET="$withval"
1270 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1271 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001272 ],
1273 [
1274 # Check for existing socket only if we don't have a random device already
1275 if test "$USE_RAND_HELPER" = yes ; then
1276 AC_MSG_CHECKING(for PRNGD/EGD socket)
1277 # Insert other locations here
1278 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1279 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1280 PRNGD_SOCKET="$sock"
1281 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1282 break;
1283 fi
1284 done
1285 if test ! -z "$PRNGD_SOCKET" ; then
1286 AC_MSG_RESULT($PRNGD_SOCKET)
1287 else
1288 AC_MSG_RESULT(not found)
1289 fi
1290 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001291 ]
1292)
1293
1294# Change default command timeout for hashing entropy source
1295entropy_timeout=200
1296AC_ARG_WITH(entropy-timeout,
1297 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1298 [
1299 if test "x$withval" != "xno" ; then
1300 entropy_timeout=$withval
1301 fi
1302 ]
1303)
Damien Miller6c21c512002-01-22 21:57:53 +11001304AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1305
Damien Millerd3f6ad22002-06-25 10:24:47 +10001306SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001307AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001308 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001309 [
1310 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001311 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001312 fi
1313 ]
1314)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001315AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1316AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001317
Tim Rice88f2ab52002-03-17 12:17:34 -08001318# We do this little dance with the search path to insure
1319# that programs that we select for use by installed programs
1320# (which may be run by the super-user) come from trusted
1321# locations before they come from the user's private area.
1322# This should help avoid accidentally configuring some
1323# random version of a program in someone's personal bin.
1324
1325OPATH=$PATH
1326PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001327test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001328test -d /sbin && PATH=$PATH:/sbin
1329test -d /usr/sbin && PATH=$PATH:/usr/sbin
1330PATH=$PATH:/etc:$OPATH
1331
Damien Millera8e06ce2003-11-21 23:48:55 +11001332# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001333OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1334OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1335OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1336OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1337OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1338OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1339OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1340OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1341OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1342OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1343OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1344OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1345OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1346OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1347OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1348OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001349# restore PATH
1350PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001351
1352# Where does ssh-rand-helper get its randomness from?
1353INSTALL_SSH_PRNG_CMDS=""
1354if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1355 if test ! -z "$PRNGD_PORT" ; then
1356 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1357 elif test ! -z "$PRNGD_SOCKET" ; then
1358 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1359 else
1360 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1361 RAND_HELPER_CMDHASH=yes
1362 INSTALL_SSH_PRNG_CMDS="yes"
1363 fi
1364fi
1365AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1366
1367
Ben Lindstromb5628642000-10-18 00:02:25 +00001368# Cheap hack to ensure NEWS-OS libraries are arranged right.
1369if test ! -z "$SONY" ; then
1370 LIBS="$LIBS -liberty";
1371fi
1372
Damien Millera22ba012000-03-02 23:09:20 +11001373# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001374AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001375AC_CHECK_SIZEOF(short int, 2)
1376AC_CHECK_SIZEOF(int, 4)
1377AC_CHECK_SIZEOF(long int, 4)
1378AC_CHECK_SIZEOF(long long int, 8)
1379
Damien Millerfa2bb692002-04-23 23:22:25 +10001380# Sanity check long long for some platforms (AIX)
1381if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1382 ac_cv_sizeof_long_long_int=0
1383fi
1384
Damien Millera22ba012000-03-02 23:09:20 +11001385# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001386AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1387 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001388 [ #include <sys/types.h> ],
1389 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001390 [ ac_cv_have_u_int="yes" ],
1391 [ ac_cv_have_u_int="no" ]
1392 )
1393])
1394if test "x$ac_cv_have_u_int" = "xyes" ; then
1395 AC_DEFINE(HAVE_U_INT)
1396 have_u_int=1
1397fi
1398
Damien Miller61e50f12000-05-08 20:49:37 +10001399AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1400 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001401 [ #include <sys/types.h> ],
1402 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001403 [ ac_cv_have_intxx_t="yes" ],
1404 [ ac_cv_have_intxx_t="no" ]
1405 )
1406])
1407if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1408 AC_DEFINE(HAVE_INTXX_T)
1409 have_intxx_t=1
1410fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001411
1412if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001413 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001414then
1415 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1416 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001417 [ #include <stdint.h> ],
1418 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001419 [
1420 AC_DEFINE(HAVE_INTXX_T)
1421 AC_MSG_RESULT(yes)
1422 ],
1423 [ AC_MSG_RESULT(no) ]
1424 )
1425fi
1426
Damien Miller578783e2000-09-23 14:12:24 +11001427AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1428 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001429 [
1430#include <sys/types.h>
1431#ifdef HAVE_STDINT_H
1432# include <stdint.h>
1433#endif
1434#include <sys/socket.h>
1435#ifdef HAVE_SYS_BITYPES_H
1436# include <sys/bitypes.h>
1437#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001438 ],
1439 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001440 [ ac_cv_have_int64_t="yes" ],
1441 [ ac_cv_have_int64_t="no" ]
1442 )
1443])
1444if test "x$ac_cv_have_int64_t" = "xyes" ; then
1445 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001446fi
1447
Damien Miller61e50f12000-05-08 20:49:37 +10001448AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1449 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001450 [ #include <sys/types.h> ],
1451 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001452 [ ac_cv_have_u_intxx_t="yes" ],
1453 [ ac_cv_have_u_intxx_t="no" ]
1454 )
1455])
1456if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1457 AC_DEFINE(HAVE_U_INTXX_T)
1458 have_u_intxx_t=1
1459fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001460
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001461if test -z "$have_u_intxx_t" ; then
1462 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1463 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001464 [ #include <sys/socket.h> ],
1465 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001466 [
1467 AC_DEFINE(HAVE_U_INTXX_T)
1468 AC_MSG_RESULT(yes)
1469 ],
1470 [ AC_MSG_RESULT(no) ]
1471 )
1472fi
1473
Damien Miller578783e2000-09-23 14:12:24 +11001474AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1475 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001476 [ #include <sys/types.h> ],
1477 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001478 [ ac_cv_have_u_int64_t="yes" ],
1479 [ ac_cv_have_u_int64_t="no" ]
1480 )
1481])
1482if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1483 AC_DEFINE(HAVE_U_INT64_T)
1484 have_u_int64_t=1
1485fi
1486
Tim Rice4cec93f2002-02-26 08:40:48 -08001487if test -z "$have_u_int64_t" ; then
1488 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1489 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001490 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001491 [ u_int64_t a; a = 1],
1492 [
1493 AC_DEFINE(HAVE_U_INT64_T)
1494 AC_MSG_RESULT(yes)
1495 ],
1496 [ AC_MSG_RESULT(no) ]
1497 )
1498fi
1499
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001500if test -z "$have_u_intxx_t" ; then
1501 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1502 AC_TRY_COMPILE(
1503 [
1504#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001505 ],
1506 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001507 [ ac_cv_have_uintxx_t="yes" ],
1508 [ ac_cv_have_uintxx_t="no" ]
1509 )
1510 ])
1511 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1512 AC_DEFINE(HAVE_UINTXX_T)
1513 fi
1514fi
1515
1516if test -z "$have_uintxx_t" ; then
1517 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1518 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001519 [ #include <stdint.h> ],
1520 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001521 [
1522 AC_DEFINE(HAVE_UINTXX_T)
1523 AC_MSG_RESULT(yes)
1524 ],
1525 [ AC_MSG_RESULT(no) ]
1526 )
1527fi
1528
Damien Milleredb82922000-06-20 13:25:52 +10001529if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001530 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001531then
1532 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1533 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001534 [
1535#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001536 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001537 [
Damien Miller70494d12000-04-03 15:57:06 +10001538 int8_t a; int16_t b; int32_t c;
1539 u_int8_t e; u_int16_t f; u_int32_t g;
1540 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001541 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001542 [
1543 AC_DEFINE(HAVE_U_INTXX_T)
1544 AC_DEFINE(HAVE_INTXX_T)
1545 AC_MSG_RESULT(yes)
1546 ],
1547 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001548 )
Damien Millerb29ea912000-01-15 14:12:03 +11001549fi
1550
Damien Miller58be7382001-09-15 21:31:54 +10001551
1552AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1553 AC_TRY_COMPILE(
1554 [
1555#include <sys/types.h>
1556 ],
1557 [ u_char foo; foo = 125; ],
1558 [ ac_cv_have_u_char="yes" ],
1559 [ ac_cv_have_u_char="no" ]
1560 )
1561])
1562if test "x$ac_cv_have_u_char" = "xyes" ; then
1563 AC_DEFINE(HAVE_U_CHAR)
1564fi
1565
Tim Rice13aae5e2001-10-21 17:53:58 -07001566TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001567
Tim Rice200a5c02002-02-26 22:12:34 -08001568AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001569
Damien Miller61e50f12000-05-08 20:49:37 +10001570AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1571 AC_TRY_COMPILE(
1572 [
1573#include <sys/types.h>
1574 ],
1575 [ size_t foo; foo = 1235; ],
1576 [ ac_cv_have_size_t="yes" ],
1577 [ ac_cv_have_size_t="no" ]
1578 )
1579])
1580if test "x$ac_cv_have_size_t" = "xyes" ; then
1581 AC_DEFINE(HAVE_SIZE_T)
1582fi
Damien Miller95058511999-12-29 10:36:45 +11001583
Damien Miller615f9392000-05-17 22:53:33 +10001584AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1585 AC_TRY_COMPILE(
1586 [
1587#include <sys/types.h>
1588 ],
1589 [ ssize_t foo; foo = 1235; ],
1590 [ ac_cv_have_ssize_t="yes" ],
1591 [ ac_cv_have_ssize_t="no" ]
1592 )
1593])
1594if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1595 AC_DEFINE(HAVE_SSIZE_T)
1596fi
1597
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001598AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1599 AC_TRY_COMPILE(
1600 [
1601#include <time.h>
1602 ],
1603 [ clock_t foo; foo = 1235; ],
1604 [ ac_cv_have_clock_t="yes" ],
1605 [ ac_cv_have_clock_t="no" ]
1606 )
1607])
1608if test "x$ac_cv_have_clock_t" = "xyes" ; then
1609 AC_DEFINE(HAVE_CLOCK_T)
1610fi
1611
Damien Millerb54b40e2000-06-23 08:23:34 +10001612AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1613 AC_TRY_COMPILE(
1614 [
1615#include <sys/types.h>
1616#include <sys/socket.h>
1617 ],
1618 [ sa_family_t foo; foo = 1235; ],
1619 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001620 [ AC_TRY_COMPILE(
1621 [
1622#include <sys/types.h>
1623#include <sys/socket.h>
1624#include <netinet/in.h>
1625 ],
1626 [ sa_family_t foo; foo = 1235; ],
1627 [ ac_cv_have_sa_family_t="yes" ],
1628
Damien Millerb54b40e2000-06-23 08:23:34 +10001629 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001630 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001631 )
1632])
1633if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1634 AC_DEFINE(HAVE_SA_FAMILY_T)
1635fi
1636
Damien Miller0f91b4e2000-06-18 15:43:25 +10001637AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1638 AC_TRY_COMPILE(
1639 [
1640#include <sys/types.h>
1641 ],
1642 [ pid_t foo; foo = 1235; ],
1643 [ ac_cv_have_pid_t="yes" ],
1644 [ ac_cv_have_pid_t="no" ]
1645 )
1646])
1647if test "x$ac_cv_have_pid_t" = "xyes" ; then
1648 AC_DEFINE(HAVE_PID_T)
1649fi
1650
1651AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1652 AC_TRY_COMPILE(
1653 [
1654#include <sys/types.h>
1655 ],
1656 [ mode_t foo; foo = 1235; ],
1657 [ ac_cv_have_mode_t="yes" ],
1658 [ ac_cv_have_mode_t="no" ]
1659 )
1660])
1661if test "x$ac_cv_have_mode_t" = "xyes" ; then
1662 AC_DEFINE(HAVE_MODE_T)
1663fi
1664
Damien Miller61e50f12000-05-08 20:49:37 +10001665
1666AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1667 AC_TRY_COMPILE(
1668 [
Damien Miller81171112000-04-23 11:14:01 +10001669#include <sys/types.h>
1670#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001671 ],
1672 [ struct sockaddr_storage s; ],
1673 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1674 [ ac_cv_have_struct_sockaddr_storage="no" ]
1675 )
1676])
1677if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1678 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1679fi
Damien Miller34132e52000-01-14 15:45:46 +11001680
Damien Miller61e50f12000-05-08 20:49:37 +10001681AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1682 AC_TRY_COMPILE(
1683 [
Damien Miller7b22d652000-06-18 14:07:04 +10001684#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001685#include <netinet/in.h>
1686 ],
1687 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1688 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1689 [ ac_cv_have_struct_sockaddr_in6="no" ]
1690 )
1691])
1692if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1693 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1694fi
Damien Miller34132e52000-01-14 15:45:46 +11001695
Damien Miller61e50f12000-05-08 20:49:37 +10001696AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1697 AC_TRY_COMPILE(
1698 [
Damien Miller7b22d652000-06-18 14:07:04 +10001699#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001700#include <netinet/in.h>
1701 ],
1702 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1703 [ ac_cv_have_struct_in6_addr="yes" ],
1704 [ ac_cv_have_struct_in6_addr="no" ]
1705 )
1706])
1707if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1708 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1709fi
Damien Miller34132e52000-01-14 15:45:46 +11001710
Damien Miller61e50f12000-05-08 20:49:37 +10001711AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1712 AC_TRY_COMPILE(
1713 [
Damien Miller81171112000-04-23 11:14:01 +10001714#include <sys/types.h>
1715#include <sys/socket.h>
1716#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001717 ],
1718 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1719 [ ac_cv_have_struct_addrinfo="yes" ],
1720 [ ac_cv_have_struct_addrinfo="no" ]
1721 )
1722])
1723if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1724 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1725fi
1726
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001727AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1728 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001729 [ #include <sys/time.h> ],
1730 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001731 [ ac_cv_have_struct_timeval="yes" ],
1732 [ ac_cv_have_struct_timeval="no" ]
1733 )
1734])
1735if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1736 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1737 have_struct_timeval=1
1738fi
1739
Tim Rice4e4dc562003-03-18 10:21:40 -08001740AC_CHECK_TYPES(struct timespec)
1741
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001742# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001743if test "x$ac_cv_have_int64_t" = "xno" -a \
1744 "x$ac_cv_sizeof_long_int" != "x8" -a \
1745 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001746 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1747 echo "an alternative compiler (I.E., GCC) before continuing."
1748 echo ""
1749 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001750else
1751dnl test snprintf (broken on SCO w/gcc)
1752 AC_TRY_RUN(
1753 [
1754#include <stdio.h>
1755#include <string.h>
1756#ifdef HAVE_SNPRINTF
1757main()
1758{
1759 char buf[50];
1760 char expected_out[50];
1761 int mazsize = 50 ;
1762#if (SIZEOF_LONG_INT == 8)
1763 long int num = 0x7fffffffffffffff;
1764#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001765 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001766#endif
1767 strcpy(expected_out, "9223372036854775807");
1768 snprintf(buf, mazsize, "%lld", num);
1769 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001770 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001771 exit(0);
1772}
1773#else
1774main() { exit(0); }
1775#endif
1776 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1777 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001778fi
1779
Damien Miller78315eb2000-09-29 23:01:36 +11001780dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001781OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1782OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1783OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1784OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1785OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001786OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001787OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1788OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001789OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001790OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1791OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1792OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1793OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001794OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1795OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1796OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1797OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001798
1799AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001800
Damien Miller61e50f12000-05-08 20:49:37 +10001801AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1802 ac_cv_have_ss_family_in_struct_ss, [
1803 AC_TRY_COMPILE(
1804 [
Damien Miller81171112000-04-23 11:14:01 +10001805#include <sys/types.h>
1806#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001807 ],
1808 [ struct sockaddr_storage s; s.ss_family = 1; ],
1809 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1810 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1811 )
1812])
1813if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1814 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1815fi
1816
Damien Miller61e50f12000-05-08 20:49:37 +10001817AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1818 ac_cv_have___ss_family_in_struct_ss, [
1819 AC_TRY_COMPILE(
1820 [
Damien Miller81171112000-04-23 11:14:01 +10001821#include <sys/types.h>
1822#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001823 ],
1824 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1825 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1826 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1827 )
1828])
1829if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1830 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1831fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001832
Damien Millerad833b32000-08-23 10:46:23 +10001833AC_CACHE_CHECK([for pw_class field in struct passwd],
1834 ac_cv_have_pw_class_in_struct_passwd, [
1835 AC_TRY_COMPILE(
1836 [
Damien Millerad833b32000-08-23 10:46:23 +10001837#include <pwd.h>
1838 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001839 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001840 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1841 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1842 )
1843])
1844if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1845 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1846fi
1847
Kevin Steves82456952001-06-22 21:14:18 +00001848AC_CACHE_CHECK([for pw_expire field in struct passwd],
1849 ac_cv_have_pw_expire_in_struct_passwd, [
1850 AC_TRY_COMPILE(
1851 [
1852#include <pwd.h>
1853 ],
1854 [ struct passwd p; p.pw_expire = 0; ],
1855 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1856 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1857 )
1858])
1859if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1860 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1861fi
1862
1863AC_CACHE_CHECK([for pw_change field in struct passwd],
1864 ac_cv_have_pw_change_in_struct_passwd, [
1865 AC_TRY_COMPILE(
1866 [
1867#include <pwd.h>
1868 ],
1869 [ struct passwd p; p.pw_change = 0; ],
1870 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1871 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1872 )
1873])
1874if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1875 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1876fi
Damien Miller61e50f12000-05-08 20:49:37 +10001877
Tim Rice28bbb0c2002-05-27 17:37:32 -07001878dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001879AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1880 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001881 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001882 [
Tim Riceae49fe62002-04-12 10:26:21 -07001883#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001884#include <sys/socket.h>
1885#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001886int main() {
1887#ifdef msg_accrights
1888exit(1);
1889#endif
1890struct msghdr m;
1891m.msg_accrights = 0;
1892exit(0);
1893}
Kevin Steves939c9db2002-03-22 17:23:25 +00001894 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001895 [ ac_cv_have_accrights_in_msghdr="yes" ],
1896 [ ac_cv_have_accrights_in_msghdr="no" ]
1897 )
1898])
1899if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1900 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1901fi
1902
Kevin Stevesa44e0352002-04-07 16:18:03 +00001903AC_CACHE_CHECK([for msg_control field in struct msghdr],
1904 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001905 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001906 [
Tim Riceae49fe62002-04-12 10:26:21 -07001907#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001908#include <sys/socket.h>
1909#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001910int main() {
1911#ifdef msg_control
1912exit(1);
1913#endif
1914struct msghdr m;
1915m.msg_control = 0;
1916exit(0);
1917}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001918 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001919 [ ac_cv_have_control_in_msghdr="yes" ],
1920 [ ac_cv_have_control_in_msghdr="no" ]
1921 )
1922])
1923if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1924 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1925fi
1926
Damien Miller61e50f12000-05-08 20:49:37 +10001927AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001928 AC_TRY_LINK([],
1929 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001930 [ ac_cv_libc_defines___progname="yes" ],
1931 [ ac_cv_libc_defines___progname="no" ]
1932 )
1933])
1934if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1935 AC_DEFINE(HAVE___PROGNAME)
1936fi
1937
Kevin Steves4846f4a2002-03-22 18:19:53 +00001938AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1939 AC_TRY_LINK([
1940#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001941],
1942 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001943 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1944 [ ac_cv_cc_implements___FUNCTION__="no" ]
1945 )
1946])
1947if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1948 AC_DEFINE(HAVE___FUNCTION__)
1949fi
1950
1951AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1952 AC_TRY_LINK([
1953#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001954],
1955 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001956 [ ac_cv_cc_implements___func__="yes" ],
1957 [ ac_cv_cc_implements___func__="no" ]
1958 )
1959])
1960if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1961 AC_DEFINE(HAVE___func__)
1962fi
1963
Damien Miller4f8e6692001-07-14 13:22:53 +10001964AC_CACHE_CHECK([whether getopt has optreset support],
1965 ac_cv_have_getopt_optreset, [
1966 AC_TRY_LINK(
1967 [
1968#include <getopt.h>
1969 ],
1970 [ extern int optreset; optreset = 0; ],
1971 [ ac_cv_have_getopt_optreset="yes" ],
1972 [ ac_cv_have_getopt_optreset="no" ]
1973 )
1974])
1975if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1976 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1977fi
Damien Millera22ba012000-03-02 23:09:20 +11001978
Damien Millerecbb26d2000-07-15 14:59:14 +10001979AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001980 AC_TRY_LINK([],
1981 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10001982 [ ac_cv_libc_defines_sys_errlist="yes" ],
1983 [ ac_cv_libc_defines_sys_errlist="no" ]
1984 )
1985])
1986if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1987 AC_DEFINE(HAVE_SYS_ERRLIST)
1988fi
1989
1990
Damien Miller11fa2cc2000-08-16 10:35:58 +10001991AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001992 AC_TRY_LINK([],
1993 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10001994 [ ac_cv_libc_defines_sys_nerr="yes" ],
1995 [ ac_cv_libc_defines_sys_nerr="no" ]
1996 )
1997])
1998if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1999 AC_DEFINE(HAVE_SYS_NERR)
2000fi
2001
Damien Millera8e06ce2003-11-21 23:48:55 +11002002SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002003# Check whether user wants sectok support
2004AC_ARG_WITH(sectok,
2005 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002006 [
2007 if test "x$withval" != "xno" ; then
2008 if test "x$withval" != "xyes" ; then
2009 CPPFLAGS="$CPPFLAGS -I${withval}"
2010 LDFLAGS="$LDFLAGS -L${withval}"
2011 if test ! -z "$need_dash_r" ; then
2012 LDFLAGS="$LDFLAGS -R${withval}"
2013 fi
2014 if test ! -z "$blibpath" ; then
2015 blibpath="$blibpath:${withval}"
2016 fi
2017 fi
2018 AC_CHECK_HEADERS(sectok.h)
2019 if test "$ac_cv_header_sectok_h" != yes; then
2020 AC_MSG_ERROR(Can't find sectok.h)
2021 fi
2022 AC_CHECK_LIB(sectok, sectok_open)
2023 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2024 AC_MSG_ERROR(Can't find libsectok)
2025 fi
2026 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002027 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002028 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002029 fi
2030 ]
2031)
2032
2033# Check whether user wants OpenSC support
2034AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002035 AC_HELP_STRING([--with-opensc=PFX],
2036 [Enable smartcard support using OpenSC]),
2037 opensc_config_prefix="$withval", opensc_config_prefix="")
2038if test x$opensc_config_prefix != x ; then
2039 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2040 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2041 if test "$OPENSC_CONFIG" != "no"; then
2042 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2043 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2044 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2045 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2046 AC_DEFINE(SMARTCARD)
2047 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002048 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002049 fi
2050fi
Damien Miller85de5802001-09-18 14:01:11 +10002051
Darren Tucker5f88d342003-10-15 16:57:57 +10002052# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002053AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002054 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002055 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002056 # Needed by our getrrsetbyname()
2057 AC_SEARCH_LIBS(res_query, resolv)
2058 AC_SEARCH_LIBS(dn_expand, resolv)
2059 AC_CHECK_FUNCS(_getshort _getlong)
2060 AC_CHECK_MEMBER(HEADER.ad,
2061 [AC_DEFINE(HAVE_HEADER_AD)],,
2062 [#include <arpa/nameser.h>])
2063 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002064
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002065# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002066KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002067AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002068 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002069 [ if test "x$withval" != "xno" ; then
2070 if test "x$withval" = "xyes" ; then
2071 KRB5ROOT="/usr/local"
2072 else
2073 KRB5ROOT=${withval}
2074 fi
2075
2076 AC_DEFINE(KRB5)
2077 KRB5_MSG="yes"
2078
2079 AC_MSG_CHECKING(for krb5-config)
2080 if test -x $KRB5ROOT/bin/krb5-config ; then
2081 KRB5CONF=$KRB5ROOT/bin/krb5-config
2082 AC_MSG_RESULT($KRB5CONF)
2083
2084 AC_MSG_CHECKING(for gssapi support)
2085 if $KRB5CONF | grep gssapi >/dev/null ; then
2086 AC_MSG_RESULT(yes)
2087 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
2088 dnl m4 quadragraphs: "sed 's/-l[^- ]*//g'"
2089 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
2090 K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002091 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002092 AC_MSG_RESULT(no)
2093 K5CFLAGS="`$KRB5CONF --cflags`"
2094 K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
2095 K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
Damien Millera8e06ce2003-11-21 23:48:55 +11002096 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002097 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2098 LDFLAGS="$LDFLAGS $K5LDFLAGS"
2099 AC_MSG_CHECKING(whether we are using Heimdal)
2100 AC_TRY_COMPILE([ #include <krb5.h> ],
2101 [ char *tmp = heimdal_version; ],
2102 [ AC_MSG_RESULT(yes)
2103 AC_DEFINE(HEIMDAL) ],
2104 AC_MSG_RESULT(no)
2105 )
2106 else
2107 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002108 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002109 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002110 AC_MSG_CHECKING(whether we are using Heimdal)
2111 AC_TRY_COMPILE([ #include <krb5.h> ],
2112 [ char *tmp = heimdal_version; ],
2113 [ AC_MSG_RESULT(yes)
2114 AC_DEFINE(HEIMDAL)
2115 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2116 ],
2117 [ AC_MSG_RESULT(no)
2118 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2119 ]
2120 )
Damien Miller200d0a72003-06-30 19:21:36 +10002121 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002122
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002123 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2124 [ AC_DEFINE(GSSAPI)
2125 K5LIBS="-lgssapi $K5LIBS" ],
2126 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2127 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002128 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002129 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2130 $K5LIBS)
2131 ],
2132 $K5LIBS)
2133
2134 AC_CHECK_HEADER(gssapi.h, ,
2135 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002136 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002137 AC_CHECK_HEADERS(gssapi.h, ,
2138 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002139 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002140 ]
2141 )
2142
2143 oldCPP="$CPPFLAGS"
2144 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2145 AC_CHECK_HEADER(gssapi_krb5.h, ,
2146 [ CPPFLAGS="$oldCPP" ])
2147
Damien Millera8e06ce2003-11-21 23:48:55 +11002148 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002149 if test ! -z "$need_dash_r" ; then
2150 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2151 fi
2152 if test ! -z "$blibpath" ; then
2153 blibpath="$blibpath:${KRB5ROOT}/lib"
2154 fi
2155 fi ]
2156 AC_SEARCH_LIBS(k_hasafs, kafs,
Darren Tucker3c78c5e2004-01-23 22:03:10 +11002157 [ AC_DEFINE(USE_AFS)
Darren Tucker1d3ca582004-01-22 12:05:34 +11002158 K5LIBS="-lkafs $K5LIBS"
2159 ]
2160 )
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002161)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002162LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002163
Damien Millera22ba012000-03-02 23:09:20 +11002164# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002165
Damien Millerf58c6722002-05-13 13:15:42 +10002166PRIVSEP_PATH=/var/empty
2167AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002168 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002169 [
2170 if test "x$withval" != "$no" ; then
2171 PRIVSEP_PATH=$withval
2172 fi
2173 ]
2174)
2175AC_SUBST(PRIVSEP_PATH)
2176
Damien Millera22ba012000-03-02 23:09:20 +11002177AC_ARG_WITH(xauth,
2178 [ --with-xauth=PATH Specify path to xauth program ],
2179 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002180 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002181 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002182 fi
2183 ],
2184 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002185 TestPath="$PATH"
2186 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2187 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2188 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2189 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2190 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002191 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002192 xauth_path="/usr/openwin/bin/xauth"
2193 fi
2194 ]
2195)
2196
Damien Miller7d901272003-01-13 16:55:22 +11002197STRIP_OPT=-s
2198AC_ARG_ENABLE(strip,
2199 [ --disable-strip Disable calling strip(1) on install],
2200 [
2201 if test "x$enableval" = "xno" ; then
2202 STRIP_OPT=
2203 fi
2204 ]
2205)
2206AC_SUBST(STRIP_OPT)
2207
Damien Millera19cf472000-11-29 13:28:50 +11002208if test -z "$xauth_path" ; then
2209 XAUTH_PATH="undefined"
2210 AC_SUBST(XAUTH_PATH)
2211else
Damien Millera22ba012000-03-02 23:09:20 +11002212 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002213 XAUTH_PATH=$xauth_path
2214 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002215fi
Damien Millera22ba012000-03-02 23:09:20 +11002216
2217# Check for mail directory (last resort if we cannot get it from headers)
2218if test ! -z "$MAIL" ; then
2219 maildir=`dirname $MAIL`
2220 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2221fi
2222
Damien Millera22ba012000-03-02 23:09:20 +11002223if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002224 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002225 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002226 [
2227 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2228 have_dev_ptmx=1
2229 ]
2230 )
2231 fi
Damien Millera22ba012000-03-02 23:09:20 +11002232fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002233AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002234 [
2235 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2236 have_dev_ptc=1
2237 ]
2238)
2239
Damien Millera22ba012000-03-02 23:09:20 +11002240# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002241AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002242 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002243 [
Damien Miller897741e2001-04-16 10:41:46 +10002244 case "$withval" in
2245 man|cat|doc)
2246 MANTYPE=$withval
2247 ;;
2248 *)
2249 AC_MSG_ERROR(invalid man type: $withval)
2250 ;;
2251 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002252 ]
2253)
Ben Lindstrombc709922001-04-18 18:04:21 +00002254if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002255 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2256 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002257 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2258 MANTYPE=doc
2259 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2260 MANTYPE=man
2261 else
2262 MANTYPE=cat
2263 fi
2264fi
Damien Miller670a4b82000-01-22 13:53:11 +11002265AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002266if test "$MANTYPE" = "doc"; then
2267 mansubdir=man;
2268else
2269 mansubdir=$MANTYPE;
2270fi
2271AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002272
Damien Millera22ba012000-03-02 23:09:20 +11002273# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002274MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002275AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002276 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002277 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002278 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002279 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002280 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002281 fi
2282 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002283)
2284
Damien Millera22ba012000-03-02 23:09:20 +11002285# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002286AC_ARG_WITH(shadow,
2287 [ --without-shadow Disable shadow password support],
2288 [
2289 if test "x$withval" = "xno" ; then
2290 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002291 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002292 fi
2293 ]
2294)
2295
Damien Miller1f335fb2000-06-26 11:31:33 +10002296if test -z "$disable_shadow" ; then
2297 AC_MSG_CHECKING([if the systems has expire shadow information])
2298 AC_TRY_COMPILE(
2299 [
2300#include <sys/types.h>
2301#include <shadow.h>
2302 struct spwd sp;
2303 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2304 [ sp_expire_available=yes ], []
2305 )
2306
2307 if test "x$sp_expire_available" = "xyes" ; then
2308 AC_MSG_RESULT(yes)
2309 AC_DEFINE(HAS_SHADOW_EXPIRE)
2310 else
2311 AC_MSG_RESULT(no)
2312 fi
2313fi
2314
Damien Millera22ba012000-03-02 23:09:20 +11002315# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002316if test ! -z "$IPADDR_IN_DISPLAY" ; then
2317 DISPLAY_HACK_MSG="yes"
2318 AC_DEFINE(IPADDR_IN_DISPLAY)
2319else
Damien Millera8e06ce2003-11-21 23:48:55 +11002320 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002321 AC_ARG_WITH(ipaddr-display,
2322 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2323 [
2324 if test "x$withval" != "xno" ; then
2325 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002326 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002327 fi
2328 ]
2329 )
2330fi
Damien Miller76112de1999-12-21 11:18:08 +11002331
Darren Tuckere1a790d2003-09-16 11:52:19 +10002332# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002333AC_ARG_ENABLE(etc-default-login,
2334 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2335[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002336AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2337
2338if test "x$external_path_file" = "x/etc/default/login"; then
2339 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2340fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002341])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002342
Tim Rice43a1c132002-04-17 21:19:14 -07002343dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2344if test $ac_cv_func_login_getcapbool = "yes" -a \
2345 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002346 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002347fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002348
Damien Millera22ba012000-03-02 23:09:20 +11002349# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002350SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002351AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002352 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002353 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002354 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002355 AC_MSG_WARN([
2356--with-default-path=PATH has no effect on this system.
2357Edit /etc/login.conf instead.])
2358 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002359 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002360 AC_MSG_WARN([
2361--with-default-path=PATH will only be used if PATH is not defined in
2362$external_path_file .])
2363 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002364 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002365 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002366 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002367 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002368 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2369 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002370 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002371 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002372 AC_MSG_WARN([
2373If PATH is defined in $external_path_file, ensure the path to scp is included,
2374otherwise scp will not work.])
2375 fi
2376 AC_TRY_RUN(
2377 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002378/* find out what STDPATH is */
2379#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002380#ifdef HAVE_PATHS_H
2381# include <paths.h>
2382#endif
2383#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002384# ifdef _PATH_USERPATH /* Irix */
2385# define _PATH_STDPATH _PATH_USERPATH
2386# else
2387# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2388# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002389#endif
2390#include <sys/types.h>
2391#include <sys/stat.h>
2392#include <fcntl.h>
2393#define DATA "conftest.stdpath"
2394
2395main()
2396{
2397 FILE *fd;
2398 int rc;
2399
2400 fd = fopen(DATA,"w");
2401 if(fd == NULL)
2402 exit(1);
2403
2404 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2405 exit(1);
2406
2407 exit(0);
2408}
2409 ], [ user_path=`cat conftest.stdpath` ],
2410 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2411 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2412 )
2413# make sure $bindir is in USER_PATH so scp will work
2414 t_bindir=`eval echo ${bindir}`
2415 case $t_bindir in
2416 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2417 esac
2418 case $t_bindir in
2419 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2420 esac
2421 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2422 if test $? -ne 0 ; then
2423 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2424 if test $? -ne 0 ; then
2425 user_path=$user_path:$t_bindir
2426 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2427 fi
2428 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002429 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002430)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002431if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002432 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2433 AC_SUBST(user_path)
2434fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002435
Damien Millera18bbd32002-05-13 10:48:57 +10002436# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002437AC_ARG_WITH(superuser-path,
2438 [ --with-superuser-path= Specify different path for super-user],
2439 [
2440 if test "x$withval" != "xno" ; then
2441 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2442 superuser_path=$withval
2443 fi
2444 ]
2445)
2446
2447
Damien Miller61e50f12000-05-08 20:49:37 +10002448AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002449IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002450AC_ARG_WITH(4in6,
2451 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2452 [
2453 if test "x$withval" != "xno" ; then
2454 AC_MSG_RESULT(yes)
2455 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002456 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002457 else
2458 AC_MSG_RESULT(no)
2459 fi
2460 ],[
2461 if test "x$inet6_default_4in6" = "xyes"; then
2462 AC_MSG_RESULT([yes (default)])
2463 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002464 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002465 else
2466 AC_MSG_RESULT([no (default)])
2467 fi
2468 ]
2469)
2470
Damien Miller60396b02001-02-18 17:01:00 +11002471# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002472BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002473AC_ARG_WITH(bsd-auth,
2474 [ --with-bsd-auth Enable BSD auth support],
2475 [
2476 if test "x$withval" != "xno" ; then
2477 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002478 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002479 fi
2480 ]
2481)
2482
Damien Millera22ba012000-03-02 23:09:20 +11002483# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002484piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002485# make sure the directory exists
2486if test ! -d $piddir ; then
2487 piddir=`eval echo ${sysconfdir}`
2488 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002489 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002490 esac
2491fi
2492
Tim Rice88f2ab52002-03-17 12:17:34 -08002493AC_ARG_WITH(pid-dir,
2494 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2495 [
2496 if test "x$withval" != "xno" ; then
2497 piddir=$withval
2498 if test ! -d $piddir ; then
2499 AC_MSG_WARN([** no $piddir directory on this system **])
2500 fi
2501 fi
2502 ]
2503)
2504
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002505AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002506AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002507
andre2ff7b5d2000-06-03 14:57:40 +00002508dnl allow user to disable some login recording features
2509AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002510 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002511 [
2512 if test "x$enableval" = "xno" ; then
2513 AC_DEFINE(DISABLE_LASTLOG)
2514 fi
2515 ]
andre2ff7b5d2000-06-03 14:57:40 +00002516)
2517AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002518 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002519 [
2520 if test "x$enableval" = "xno" ; then
2521 AC_DEFINE(DISABLE_UTMP)
2522 fi
2523 ]
andre2ff7b5d2000-06-03 14:57:40 +00002524)
2525AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002526 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002527 [
2528 if test "x$enableval" = "xno" ; then
2529 AC_DEFINE(DISABLE_UTMPX)
2530 fi
2531 ]
andre2ff7b5d2000-06-03 14:57:40 +00002532)
2533AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002534 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002535 [
2536 if test "x$enableval" = "xno" ; then
2537 AC_DEFINE(DISABLE_WTMP)
2538 fi
2539 ]
andre2ff7b5d2000-06-03 14:57:40 +00002540)
2541AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002542 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002543 [
2544 if test "x$enableval" = "xno" ; then
2545 AC_DEFINE(DISABLE_WTMPX)
2546 fi
2547 ]
andre2ff7b5d2000-06-03 14:57:40 +00002548)
2549AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002550 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002551 [
2552 if test "x$enableval" = "xno" ; then
2553 AC_DEFINE(DISABLE_LOGIN)
2554 fi
2555 ]
andre2ff7b5d2000-06-03 14:57:40 +00002556)
2557AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002558 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002559 [
2560 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002561 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002562 fi
2563 ]
andre2ff7b5d2000-06-03 14:57:40 +00002564)
2565AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002566 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002567 [
2568 if test "x$enableval" = "xno" ; then
2569 AC_DEFINE(DISABLE_PUTUTXLINE)
2570 fi
2571 ]
andre2ff7b5d2000-06-03 14:57:40 +00002572)
2573AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002574 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002575 [
2576 if test "x$withval" = "xno" ; then
2577 AC_DEFINE(DISABLE_LASTLOG)
2578 else
2579 conf_lastlog_location=$withval
2580 fi
2581 ]
2582)
andre2ff7b5d2000-06-03 14:57:40 +00002583
2584dnl lastlog, [uw]tmpx? detection
2585dnl NOTE: set the paths in the platform section to avoid the
2586dnl need for command-line parameters
2587dnl lastlog and [uw]tmp are subject to a file search if all else fails
2588
2589dnl lastlog detection
2590dnl NOTE: the code itself will detect if lastlog is a directory
2591AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2592AC_TRY_COMPILE([
2593#include <sys/types.h>
2594#include <utmp.h>
2595#ifdef HAVE_LASTLOG_H
2596# include <lastlog.h>
2597#endif
Damien Miller2994e082000-06-04 15:51:47 +10002598#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002599# include <paths.h>
2600#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002601#ifdef HAVE_LOGIN_H
2602# include <login.h>
2603#endif
andre2ff7b5d2000-06-03 14:57:40 +00002604 ],
2605 [ char *lastlog = LASTLOG_FILE; ],
2606 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002607 [
2608 AC_MSG_RESULT(no)
2609 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2610 AC_TRY_COMPILE([
2611#include <sys/types.h>
2612#include <utmp.h>
2613#ifdef HAVE_LASTLOG_H
2614# include <lastlog.h>
2615#endif
2616#ifdef HAVE_PATHS_H
2617# include <paths.h>
2618#endif
2619 ],
2620 [ char *lastlog = _PATH_LASTLOG; ],
2621 [ AC_MSG_RESULT(yes) ],
2622 [
andree441aa32000-06-12 22:34:38 +00002623 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002624 system_lastlog_path=no
2625 ])
2626 ]
andre2ff7b5d2000-06-03 14:57:40 +00002627)
Damien Miller2994e082000-06-04 15:51:47 +10002628
andre2ff7b5d2000-06-03 14:57:40 +00002629if test -z "$conf_lastlog_location"; then
2630 if test x"$system_lastlog_path" = x"no" ; then
2631 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002632 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002633 conf_lastlog_location=$f
2634 fi
2635 done
2636 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002637 AC_MSG_WARN([** Cannot find lastlog **])
2638 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002639 fi
2640 fi
2641fi
2642
2643if test -n "$conf_lastlog_location"; then
2644 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2645fi
2646
2647dnl utmp detection
2648AC_MSG_CHECKING([if your system defines UTMP_FILE])
2649AC_TRY_COMPILE([
2650#include <sys/types.h>
2651#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002652#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002653# include <paths.h>
2654#endif
2655 ],
2656 [ char *utmp = UTMP_FILE; ],
2657 [ AC_MSG_RESULT(yes) ],
2658 [ AC_MSG_RESULT(no)
2659 system_utmp_path=no ]
2660)
2661if test -z "$conf_utmp_location"; then
2662 if test x"$system_utmp_path" = x"no" ; then
2663 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2664 if test -f $f ; then
2665 conf_utmp_location=$f
2666 fi
2667 done
2668 if test -z "$conf_utmp_location"; then
2669 AC_DEFINE(DISABLE_UTMP)
2670 fi
2671 fi
2672fi
2673if test -n "$conf_utmp_location"; then
2674 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2675fi
2676
2677dnl wtmp detection
2678AC_MSG_CHECKING([if your system defines WTMP_FILE])
2679AC_TRY_COMPILE([
2680#include <sys/types.h>
2681#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002682#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002683# include <paths.h>
2684#endif
2685 ],
2686 [ char *wtmp = WTMP_FILE; ],
2687 [ AC_MSG_RESULT(yes) ],
2688 [ AC_MSG_RESULT(no)
2689 system_wtmp_path=no ]
2690)
2691if test -z "$conf_wtmp_location"; then
2692 if test x"$system_wtmp_path" = x"no" ; then
2693 for f in /usr/adm/wtmp /var/log/wtmp; do
2694 if test -f $f ; then
2695 conf_wtmp_location=$f
2696 fi
2697 done
2698 if test -z "$conf_wtmp_location"; then
2699 AC_DEFINE(DISABLE_WTMP)
2700 fi
2701 fi
2702fi
2703if test -n "$conf_wtmp_location"; then
2704 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2705fi
2706
2707
2708dnl utmpx detection - I don't know any system so perverse as to require
2709dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2710dnl there, though.
2711AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2712AC_TRY_COMPILE([
2713#include <sys/types.h>
2714#include <utmp.h>
2715#ifdef HAVE_UTMPX_H
2716#include <utmpx.h>
2717#endif
Damien Miller2994e082000-06-04 15:51:47 +10002718#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002719# include <paths.h>
2720#endif
2721 ],
2722 [ char *utmpx = UTMPX_FILE; ],
2723 [ AC_MSG_RESULT(yes) ],
2724 [ AC_MSG_RESULT(no)
2725 system_utmpx_path=no ]
2726)
2727if test -z "$conf_utmpx_location"; then
2728 if test x"$system_utmpx_path" = x"no" ; then
2729 AC_DEFINE(DISABLE_UTMPX)
2730 fi
2731else
2732 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2733fi
2734
2735dnl wtmpx detection
2736AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2737AC_TRY_COMPILE([
2738#include <sys/types.h>
2739#include <utmp.h>
2740#ifdef HAVE_UTMPX_H
2741#include <utmpx.h>
2742#endif
Damien Miller2994e082000-06-04 15:51:47 +10002743#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002744# include <paths.h>
2745#endif
2746 ],
2747 [ char *wtmpx = WTMPX_FILE; ],
2748 [ AC_MSG_RESULT(yes) ],
2749 [ AC_MSG_RESULT(no)
2750 system_wtmpx_path=no ]
2751)
2752if test -z "$conf_wtmpx_location"; then
2753 if test x"$system_wtmpx_path" = x"no" ; then
2754 AC_DEFINE(DISABLE_WTMPX)
2755 fi
2756else
2757 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2758fi
2759
Damien Miller4018c192000-04-30 09:30:44 +10002760
Damien Miller29ea30d2000-03-17 10:54:15 +11002761if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002762 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2763 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002764fi
2765
Tim Rice4cec93f2002-02-26 08:40:48 -08002766dnl remove pam and dl because they are in $LIBPAM
2767if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002768 LIBS=`echo $LIBS | sed 's/-lpam //'`
2769fi
2770if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2771 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002772fi
2773
Damien Millerbac2d8a2000-09-05 16:13:06 +11002774AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002775AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2776AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002777
Damien Miller7b22d652000-06-18 14:07:04 +10002778# Print summary of options
2779
Damien Miller7b22d652000-06-18 14:07:04 +10002780# Someone please show me a better way :)
2781A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2782B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2783C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2784D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002785E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002786F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002787G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002788H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2789I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2790J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002791
2792echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002793echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002794echo " User binaries: $B"
2795echo " System binaries: $C"
2796echo " Configuration files: $D"
2797echo " Askpass program: $E"
2798echo " Manual pages: $F"
2799echo " PID file: $G"
2800echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002801if test "x$external_path_file" = "x/etc/login.conf" ; then
2802echo " At runtime, sshd will use the path defined in $external_path_file"
2803echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002804else
Damien Millerf58c6722002-05-13 13:15:42 +10002805echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002806 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002807echo " (If PATH is set in $external_path_file it will be used instead. If"
2808echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2809 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002810fi
Damien Millera18bbd32002-05-13 10:48:57 +10002811if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002812echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002813fi
Damien Millerf58c6722002-05-13 13:15:42 +10002814echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002815echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002816echo " KerberosV support: $KRB5_MSG"
2817echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002818echo " S/KEY support: $SKEY_MSG"
2819echo " TCP Wrappers support: $TCPW_MSG"
2820echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002821echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002822echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2823echo " BSD Auth support: $BSD_AUTH_MSG"
2824echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002825if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002826echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002827fi
2828
Damien Miller7b22d652000-06-18 14:07:04 +10002829echo ""
2830
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002831echo " Host: ${host}"
2832echo " Compiler: ${CC}"
2833echo " Compiler flags: ${CFLAGS}"
2834echo "Preprocessor flags: ${CPPFLAGS}"
2835echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002836echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002837
2838echo ""
2839
Damien Miller82cf0ce2000-12-20 13:34:48 +11002840if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002841 echo "PAM is enabled. You may need to install a PAM control file "
2842 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002843 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002844 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002845 echo ""
2846fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002847
Damien Miller6c21c512002-01-22 21:57:53 +11002848if test ! -z "$RAND_HELPER_CMDHASH" ; then
2849 echo "WARNING: you are using the builtin random number collection "
2850 echo "service. Please read WARNING.RNG and request that your OS "
2851 echo "vendor includes kernel-based random number collection in "
2852 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002853 echo ""
2854fi
Damien Miller60396b02001-02-18 17:01:00 +11002855