blob: 2d2147518ef214c59c9f3d5dcf25d74f5474d21d [file] [log] [blame]
Darren Tucker8db9a0f2004-04-06 21:31:12 +10001# $Id: configure.ac,v 1.208 2004/04/06 11:31:13 dtucker Exp $
Damien Miller4fefe242004-03-11 14:20:10 +11002#
3# Copyright (c) 1999-2004 Damien Miller
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Damien Millere9cf3572001-02-09 12:55:35 +110016
Tim Rice13aae5e2001-10-21 17:53:58 -070017AC_INIT
18AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +100019
20AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +110021AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +110022AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +110023AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100024
Damien Millera22ba012000-03-02 23:09:20 +110025# Checks for programs.
Darren Tucker167bd9c2003-09-07 12:34:54 +100026AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110027AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100028AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110029AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000030AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070031AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080032AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110033AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100034AC_PATH_PROG(ENT, ent)
35AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110036AC_PATH_PROG(TEST_MINUS_S_SH, bash)
37AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
38AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070039AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110040
Damien Millere8bb4502001-09-25 16:39:35 +100041# System features
42AC_SYS_LARGEFILE
43
Damien Miller3f62aba2000-11-29 11:56:35 +110044if test -z "$AR" ; then
45 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
46fi
47
Damien Millerad833b32000-08-23 10:46:23 +100048# Use LOGIN_PROGRAM from environment if possible
49if test ! -z "$LOGIN_PROGRAM" ; then
50 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
51else
52 # Search for login
53 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
54 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
55 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
56 fi
57fi
58
Darren Tucker23bc8d02004-02-06 16:24:31 +110059AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
60if test ! -z "$PATH_PASSWD_PROG" ; then
61 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
62fi
63
Damien Miller166bd442000-03-16 10:48:25 +110064if test -z "$LD" ; then
65 LD=$CC
66fi
67AC_SUBST(LD)
68
Damien Miller166bd442000-03-16 10:48:25 +110069AC_C_INLINE
Damien Millera8e06ce2003-11-21 23:48:55 +110070if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
Damien Miller649d9992001-06-27 23:35:51 +100071 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110072fi
73
Tim Rice88368a32003-12-08 12:35:59 -080074AC_ARG_WITH(rpath,
75 [ --without-rpath Disable auto-added -R linker paths],
76 [
77 if test "x$withval" = "xno" ; then
78 need_dash_r=""
79 fi
80 if test "x$withval" = "xyes" ; then
81 need_dash_r=1
82 fi
83 ]
84)
85
Damien Millera22ba012000-03-02 23:09:20 +110086# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110087case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110088*-*-aix*)
Damien Millera8e06ce2003-11-21 23:48:55 +110089 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
Damien Millereab4bae2003-04-29 23:22:40 +100090 if (test -z "$blibpath"); then
Tim Ricefcb62202004-01-23 18:35:16 -080091 blibpath="/usr/lib:/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110092 fi
Damien Millereab4bae2003-04-29 23:22:40 +100093 saved_LDFLAGS="$LDFLAGS"
94 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
95 if (test -z "$blibflags"); then
96 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
97 AC_TRY_LINK([], [], [blibflags=$tryflags])
98 fi
99 done
100 if (test -z "$blibflags"); then
101 AC_MSG_RESULT(not found)
102 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
103 else
104 AC_MSG_RESULT($blibflags)
105 fi
106 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000107 dnl Check for authenticate. Might be in libs.a on older AIXes
108 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -0700109 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000110 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -0700111 LIBS="$LIBS -ls"
112 ])
113 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000114 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
115 AC_CHECK_DECL(loginfailed,
116 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
117 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +1000118 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000119 [(void)loginfailed("user","host","tty",0);],
120 [AC_MSG_RESULT(yes)
121 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +1000122 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +1000123 )],
124 [],
125 [#include <usersec.h>]
126 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +1000127 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +1100128 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000129 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000130 AC_DEFINE(SETEUID_BREAKS_SETUID)
131 AC_DEFINE(BROKEN_SETREUID)
132 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000133 dnl AIX handles lastlog as part of its login message
134 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000135 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000136 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100137 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100138*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100139 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800140 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100141 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000142 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100143 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100144 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000145 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000146 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700147 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000148 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100149 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000150*-*-dgux*)
151 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker454da0b2003-12-18 12:52:19 +1100152 AC_DEFINE(SETEUID_BREAKS_SETUID)
153 AC_DEFINE(BROKEN_SETREUID)
154 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom58055132001-02-15 18:34:29 +0000155 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000156*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000157 AC_MSG_CHECKING(if we have working getaddrinfo)
158 AC_TRY_RUN([#include <mach-o/dyld.h>
159main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
160 exit(0);
161 else
162 exit(1);
163}], [AC_MSG_RESULT(working)],
164 [AC_MSG_RESULT(buggy)
165 AC_DEFINE(BROKEN_GETADDRINFO)],
Tim Rice480ef8d2003-09-21 21:38:11 -0700166 [AC_MSG_RESULT(assume it is working)])
Darren Tucker20379a32003-09-22 11:07:40 +1000167 AC_DEFINE(SETEUID_BREAKS_SETUID)
168 AC_DEFINE(BROKEN_SETREUID)
169 AC_DEFINE(BROKEN_SETREGID)
Damien Miller7a2ea782004-01-02 17:52:10 +1100170 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000171 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000172*-*-hpux10.26)
173 if test -z "$GCC"; then
174 CFLAGS="$CFLAGS -Ae"
175 fi
176 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
177 IPADDR_IN_DISPLAY=yes
178 AC_DEFINE(HAVE_SECUREWARE)
179 AC_DEFINE(USE_PIPES)
180 AC_DEFINE(LOGIN_NO_ENDOPT)
181 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000182 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000183 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700184 LIBS="$LIBS -lsec -lsecpw"
185 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000186 disable_ptmx_check=yes
187 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100188*-*-hpux10*)
189 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000190 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100191 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000192 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100193 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000194 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000195 AC_DEFINE(LOGIN_NO_ENDOPT)
196 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Darren Tuckere41bba52003-08-25 11:51:19 +1000197 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000198 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700199 LIBS="$LIBS -lsec"
200 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100201 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000202*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000203 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100204 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100205 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100206 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000207 AC_DEFINE(LOGIN_NO_ENDOPT)
208 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerd6f204d2000-09-23 13:57:27 +1100209 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000210 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000211 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Darren Tuckerf58fb7e2004-02-06 15:59:06 +1100212 case "$host" in
213 *-*-hpux11.11*)
214 AC_DEFINE(BROKEN_GETADDRINFO);;
215 esac
Tim Ricef028f1e2002-07-19 12:41:10 -0700216 LIBS="$LIBS -lsec"
217 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000218 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100219*-*-irix5*)
Damien Miller190d5a82000-09-30 09:43:19 +1100220 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000221 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbeaf6792003-09-24 20:03:48 +1000222 AC_DEFINE(SETEUID_BREAKS_SETUID)
223 AC_DEFINE(BROKEN_SETREUID)
224 AC_DEFINE(BROKEN_SETREGID)
Damien Millerf1b9d112002-04-23 23:09:19 +1000225 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000226 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100227 ;;
228*-*-irix6*)
Damien Miller190d5a82000-09-30 09:43:19 +1100229 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000230 AC_DEFINE(WITH_IRIX_ARRAY)
231 AC_DEFINE(WITH_IRIX_PROJECT)
232 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000233 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000234 AC_DEFINE(BROKEN_INET_NTOA)
Darren Tuckerbe79af12003-09-22 11:58:21 +1000235 AC_DEFINE(SETEUID_BREAKS_SETUID)
236 AC_DEFINE(BROKEN_SETREUID)
237 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker8db9a0f2004-04-06 21:31:12 +1000238 AC_DEFINE(BROKEN_UPDWTMPX)
Damien Millerf1b9d112002-04-23 23:09:19 +1000239 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000240 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100241 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100242*-*-linux*)
243 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100244 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000245 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100246 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000247 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tucker809031f2004-03-30 14:03:45 +1000248 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!")
Damien Miller35276252003-06-03 10:14:28 +1000249 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100250 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000251 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000252 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000253 AC_DEFINE(BROKEN_CMSG_TYPE)
254 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000255 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100256 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000257mips-sony-bsd|mips-sony-newsos4)
258 AC_DEFINE(HAVE_NEWS4)
259 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000260 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100261*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000262 check_for_libcrypt_before=1
Tim Rice88368a32003-12-08 12:35:59 -0800263 if test "x$withval" != "xno" ; then
264 need_dash_r=1
265 fi
Damien Milleree1c0b32000-01-21 00:18:15 +1100266 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100267*-*-freebsd*)
268 check_for_libcrypt_later=1
269 ;;
Darren Tuckered9eb022003-09-22 11:18:47 +1000270*-*-bsdi*)
271 AC_DEFINE(SETEUID_BREAKS_SETUID)
272 AC_DEFINE(BROKEN_SETREUID)
273 AC_DEFINE(BROKEN_SETREGID)
274 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000275*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000276 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100277 conf_utmp_location=/etc/utmp
278 conf_wtmp_location=/usr/adm/wtmp
279 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000280 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000281 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000282 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100283 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000284 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100285*-*-solaris*)
Tim Ricead4a1882004-02-29 15:53:37 -0800286 if test "x$withval" != "xno" ; then
287 need_dash_r=1
288 fi
Damien Miller82cf0ce2000-12-20 13:34:48 +1100289 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000290 AC_DEFINE(LOGIN_NEEDS_UTMPX)
291 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000292 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000293 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000294 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
295 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000296 external_path_file=/etc/default/login
andre2ff7b5d2000-06-03 14:57:40 +0000297 # hardwire lastlog location (can't detect it on some versions)
298 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000299 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
300 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
301 if test "$sol2ver" -ge 8; then
302 AC_MSG_RESULT(yes)
303 AC_DEFINE(DISABLE_UTMP)
304 AC_DEFINE(DISABLE_WTMP)
305 else
306 AC_MSG_RESULT(no)
307 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100308 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000309*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000310 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000311 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100312 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000313 conf_utmp_location=/etc/utmp
314 conf_wtmp_location=/var/adm/wtmp
315 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000316 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000317 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000318*-ncr-sysv*)
Tim Rice13aae5e2001-10-21 17:53:58 -0700319 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000320 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000321 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tucker00130112003-09-22 11:40:24 +1000322 AC_DEFINE(SETEUID_BREAKS_SETUID)
323 AC_DEFINE(BROKEN_SETREUID)
324 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000325 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000326*-sni-sysv*)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700327 # /usr/ucblib MUST NOT be searched on ReliantUNIX
Darren Tucker89df7a32003-10-07 20:35:57 +1000328 AC_CHECK_LIB(dl, dlsym, ,)
Damien Millerfd9885e2001-01-10 08:16:53 +1100329 IPADDR_IN_DISPLAY=yes
330 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000331 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker3b2a06c2003-10-07 18:37:11 +1000332 AC_DEFINE(SETEUID_BREAKS_SETUID)
333 AC_DEFINE(BROKEN_SETREUID)
334 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000335 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Darren Tuckere1a790d2003-09-16 11:52:19 +1000336 external_path_file=/etc/default/login
Tim Riceffdf4aa2001-10-27 10:45:36 -0700337 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
338 # Attention: always take care to bind libsocket and libnsl before libc,
339 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000340 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100341*-*-sysv4.2*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100342 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700343 AC_DEFINE(SETEUID_BREAKS_SETUID)
344 AC_DEFINE(BROKEN_SETREUID)
345 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100346 ;;
347*-*-sysv5*)
Damien Miller5dfe9762001-02-16 12:05:39 +1100348 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700349 AC_DEFINE(SETEUID_BREAKS_SETUID)
350 AC_DEFINE(BROKEN_SETREUID)
351 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100352 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100353*-*-sysv*)
Damien Miller75b1d102000-01-07 14:01:41 +1100354 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100355*-*-sco3.2v4*)
Tim Ricefcb62202004-01-23 18:35:16 -0800356 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
Tim Ricee8c898a2004-02-23 21:47:04 -0800357 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100358 RANLIB=true
359 no_dev_ptmx=1
360 AC_DEFINE(BROKEN_SYS_TERMIO_H)
361 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000362 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000363 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100364 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700365 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100366 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700367 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700368 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100369 ;;
370*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800371 if test -z "$GCC"; then
372 CFLAGS="$CFLAGS -belf"
373 fi
Damien Miller5dfe9762001-02-16 12:05:39 +1100374 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000375 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100376 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000377 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000378 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700379 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700380 AC_DEFINE(SETEUID_BREAKS_SETUID)
381 AC_DEFINE(BROKEN_SETREUID)
382 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700383 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100384 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700385 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000386 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000387*-*-unicosmk*)
Darren Tucker2df33432004-01-30 14:34:21 +1100388 AC_DEFINE(NO_SSH_LASTLOG)
389 AC_DEFINE(SETEUID_BREAKS_SETUID)
390 AC_DEFINE(BROKEN_SETREUID)
391 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000392 AC_DEFINE(USE_PIPES)
393 AC_DEFINE(DISABLE_FD_PASSING)
394 LDFLAGS="$LDFLAGS"
395 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
396 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000397 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000398*-*-unicosmp*)
Darren Tucker2df33432004-01-30 14:34:21 +1100399 AC_DEFINE(SETEUID_BREAKS_SETUID)
400 AC_DEFINE(BROKEN_SETREUID)
401 AC_DEFINE(BROKEN_SETREGID)
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000402 AC_DEFINE(WITH_ABBREV_NO_TTY)
403 AC_DEFINE(USE_PIPES)
404 AC_DEFINE(DISABLE_FD_PASSING)
405 LDFLAGS="$LDFLAGS"
Darren Tucker2df33432004-01-30 14:34:21 +1100406 LIBS="$LIBS -lgen -lacid -ldb"
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000407 MANTYPE=cat
408 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000409*-*-unicos*)
Darren Tucker2df33432004-01-30 14:34:21 +1100410 AC_DEFINE(SETEUID_BREAKS_SETUID)
411 AC_DEFINE(BROKEN_SETREUID)
412 AC_DEFINE(BROKEN_SETREGID)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000413 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700414 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700415 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000416 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
417 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
418 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700419 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000420*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000421 AC_MSG_CHECKING(for Digital Unix SIA)
422 no_osfsia=""
423 AC_ARG_WITH(osfsia,
424 [ --with-osfsia Enable Digital Unix SIA],
425 [
426 if test "x$withval" = "xno" ; then
427 AC_MSG_RESULT(disabled)
428 no_osfsia=1
429 fi
430 ],
431 )
432 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000433 if test -f /etc/sia/matrix.conf; then
434 AC_MSG_RESULT(yes)
435 AC_DEFINE(HAVE_OSF_SIA)
436 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000437 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000438 LIBS="$LIBS -lsecurity -ldb -lm -laud"
439 else
440 AC_MSG_RESULT(no)
Darren Tucker4e06a1d2003-11-22 14:25:15 +1100441 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000442 fi
443 fi
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000444 AC_DEFINE(BROKEN_GETADDRINFO)
Tim Rice7a74c6b2003-09-21 21:00:59 -0700445 AC_DEFINE(SETEUID_BREAKS_SETUID)
Darren Tuckered92b212003-09-22 11:26:16 +1000446 AC_DEFINE(BROKEN_SETREUID)
447 AC_DEFINE(BROKEN_SETREGID)
Damien Millerb8c656e2000-06-28 15:22:41 +1000448 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000449
450*-*-nto-qnx)
451 AC_DEFINE(USE_PIPES)
452 AC_DEFINE(NO_X11_UNIX_SOCKETS)
453 AC_DEFINE(MISSING_NFDBITS)
454 AC_DEFINE(MISSING_HOWMANY)
455 AC_DEFINE(MISSING_FD_MASK)
456 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100457esac
458
Damien Millere37bfc12000-06-05 09:37:43 +1000459# Allow user to specify flags
460AC_ARG_WITH(cflags,
461 [ --with-cflags Specify additional flags to pass to compiler],
462 [
463 if test "x$withval" != "xno" ; then
464 CFLAGS="$CFLAGS $withval"
465 fi
466 ]
467)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000468AC_ARG_WITH(cppflags,
469 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
470 [
471 if test "x$withval" != "xno"; then
472 CPPFLAGS="$CPPFLAGS $withval"
473 fi
474 ]
475)
Damien Millere37bfc12000-06-05 09:37:43 +1000476AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000477 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000478 [
479 if test "x$withval" != "xno" ; then
480 LDFLAGS="$LDFLAGS $withval"
481 fi
482 ]
483)
484AC_ARG_WITH(libs,
485 [ --with-libs Specify additional libraries to link with],
486 [
487 if test "x$withval" != "xno" ; then
488 LIBS="$LIBS $withval"
489 fi
490 ]
491)
492
Darren Tucker6eb93042003-06-29 21:30:41 +1000493AC_MSG_CHECKING(compiler and flags for sanity)
494AC_TRY_RUN([
495#include <stdio.h>
496int main(){exit(0);}
497 ],
498 [ AC_MSG_RESULT(yes) ],
499 [
500 AC_MSG_RESULT(no)
501 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
502 ]
503)
504
Tim Rice4cec93f2002-02-26 08:40:48 -0800505# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000506AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000507 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800508 login_cap.h maillock.h netdb.h netgroup.h \
Damien Miller0f47c532004-01-02 18:01:30 +1100509 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000510 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000511 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
Damien Miller6c4914a2004-03-03 11:08:59 +1100512 sys/cdefs.h sys/mman.h sys/prctl.h sys/pstat.h sys/ptms.h \
513 sys/select.h sys/stat.h sys/stream.h sys/stropts.h \
514 sys/sysmacros.h sys/time.h sys/timers.h sys/un.h time.h tmpdir.h \
515 ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
Tim Rice4cec93f2002-02-26 08:40:48 -0800516
Damien Millera22ba012000-03-02 23:09:20 +1100517# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700518AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
519AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000520
Damien Millerdf288022001-02-18 13:07:07 +1100521dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700522if test "x$with_tcp_wrappers" != "xno" ; then
523 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
524 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
525 fi
526fi
Damien Millerdf288022001-02-18 13:07:07 +1100527
Tim Rice1e1ef642003-09-11 22:19:31 -0700528dnl IRIX and Solaris 2.5.1 have dirname() in libgen
529AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
530 AC_CHECK_LIB(gen, dirname,[
531 AC_CACHE_CHECK([for broken dirname],
532 ac_cv_have_broken_dirname, [
533 save_LIBS="$LIBS"
534 LIBS="$LIBS -lgen"
535 AC_TRY_RUN(
536 [
537#include <libgen.h>
538#include <string.h>
539
540int main(int argc, char **argv) {
541 char *s, buf[32];
542
543 strncpy(buf,"/etc", 32);
544 s = dirname(buf);
545 if (!s || strncmp(s, "/", 32) != 0) {
546 exit(1);
547 } else {
548 exit(0);
549 }
550}
551 ],
552 [ ac_cv_have_broken_dirname="no" ],
553 [ ac_cv_have_broken_dirname="yes" ]
554 )
555 LIBS="$save_LIBS"
556 ])
557 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
558 LIBS="$LIBS -lgen"
559 AC_DEFINE(HAVE_DIRNAME)
560 AC_CHECK_HEADERS(libgen.h)
561 fi
562 ])
563])
564
565AC_CHECK_FUNC(getspnam, ,
566 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
567AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
568
Tim Rice13aae5e2001-10-21 17:53:58 -0700569dnl zlib is required
570AC_ARG_WITH(zlib,
571 [ --with-zlib=PATH Use zlib in PATH],
572 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000573 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100574 AC_MSG_ERROR([*** zlib is required ***])
575 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700576 if test -d "$withval/lib"; then
577 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700578 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700579 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700580 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700581 fi
582 else
583 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700584 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700585 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700586 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700587 fi
588 fi
589 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700590 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700591 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700592 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700593 fi
594 ]
595)
596
Tim Ricefcb62202004-01-23 18:35:16 -0800597AC_CHECK_LIB(z, deflate, ,
598 [
599 saved_CPPFLAGS="$CPPFLAGS"
600 saved_LDFLAGS="$LDFLAGS"
601 save_LIBS="$LIBS"
602 dnl Check default zlib install dir
603 if test -n "${need_dash_r}"; then
604 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
605 else
606 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
607 fi
608 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
609 LIBS="$LIBS -lz"
610 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
611 [
612 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
613 ]
614 )
615 ]
616)
Darren Tucker2dcd2392004-01-23 17:13:33 +1100617AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100618
619AC_ARG_WITH(zlib-version-check,
620 [ --without-zlib-version-check Disable zlib version check],
621 [ if test "x$withval" = "xno" ; then
622 zlib_check_nonfatal=1
623 fi
624 ]
625)
626
Darren Tucker2dcd2392004-01-23 17:13:33 +1100627AC_MSG_CHECKING(for zlib 1.1.4 or greater)
628AC_TRY_RUN([
629#include <zlib.h>
630int main()
631{
632 int a, b, c, v;
633 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
634 exit(1);
635 v = a*1000000 + b*1000 + c;
636 if (v >= 1001004)
637 exit(0);
638 exit(2);
639}
640 ],
641 AC_MSG_RESULT(yes),
642 [ AC_MSG_RESULT(no)
Darren Tuckerdcc736b2004-01-30 14:20:59 +1100643 if test -z "$zlib_check_nonfatal" ; then
644 AC_MSG_ERROR([*** zlib too old - check config.log ***
645Your reported zlib version has known security problems. It's possible your
646vendor has fixed these problems without changing the version number. If you
647are sure this is the case, you can disable the check by running
648"./configure --without-zlib-version-check".
649If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
650 else
651 AC_MSG_WARN([zlib version may have security problems])
652 fi
653 ]
Darren Tucker2dcd2392004-01-23 17:13:33 +1100654)
Damien Miller6f9c3372000-10-25 10:06:04 +1100655
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000656dnl UnixWare 2.x
Damien Millera8e06ce2003-11-21 23:48:55 +1100657AC_CHECK_FUNC(strcasecmp,
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000658 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
659)
Damien Millera8e06ce2003-11-21 23:48:55 +1100660AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700661 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
662 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000663)
Damien Millerab18c411999-11-11 10:40:23 +1100664
Tim Ricee589a292001-11-03 11:09:32 -0800665dnl Checks for libutil functions
666AC_CHECK_HEADERS(libutil.h)
667AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
668AC_CHECK_FUNCS(logout updwtmp logwtmp)
669
Ben Lindstrom8697e082001-02-24 21:41:10 +0000670AC_FUNC_STRFTIME
671
Damien Miller3c027682001-03-14 11:39:45 +1100672# Check for ALTDIRFUNC glob() extension
673AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
674AC_EGREP_CPP(FOUNDIT,
675 [
676 #include <glob.h>
677 #ifdef GLOB_ALTDIRFUNC
678 FOUNDIT
679 #endif
Damien Millera8e06ce2003-11-21 23:48:55 +1100680 ],
Damien Miller3c027682001-03-14 11:39:45 +1100681 [
682 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
683 AC_MSG_RESULT(yes)
684 ],
685 [
686 AC_MSG_RESULT(no)
687 ]
688)
Damien Millerab18c411999-11-11 10:40:23 +1100689
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000690# Check for g.gl_matchc glob() extension
691AC_MSG_CHECKING(for gl_matchc field in glob_t)
692AC_EGREP_CPP(FOUNDIT,
Damien Millera8e06ce2003-11-21 23:48:55 +1100693 [
694 #include <glob.h>
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000695 int main(void){glob_t g; g.gl_matchc = 1;}
Damien Millera8e06ce2003-11-21 23:48:55 +1100696 ],
697 [
698 AC_DEFINE(GLOB_HAS_GL_MATCHC)
699 AC_MSG_RESULT(yes)
700 ],
701 [
702 AC_MSG_RESULT(no)
703 ]
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000704)
705
Damien Miller18bb4732001-03-28 14:35:30 +1000706AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
707AC_TRY_RUN(
708 [
709#include <sys/types.h>
710#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700711int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000712 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100713 [AC_MSG_RESULT(yes)],
Damien Miller18bb4732001-03-28 14:35:30 +1000714 [
715 AC_MSG_RESULT(no)
716 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
717 ]
718)
719
Damien Millerc547bf12001-02-16 10:18:12 +1100720# Check whether user wants S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100721SKEY_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100722AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700723 [ --with-skey[[=PATH]] Enable S/Key support
Damien Millera8e06ce2003-11-21 23:48:55 +1100724 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100725 [
726 if test "x$withval" != "xno" ; then
727
728 if test "x$withval" != "xyes" ; then
729 CPPFLAGS="$CPPFLAGS -I${withval}/include"
730 LDFLAGS="$LDFLAGS -L${withval}/lib"
731 fi
732
733 AC_DEFINE(SKEY)
734 LIBS="-lskey $LIBS"
Damien Millera8e06ce2003-11-21 23:48:55 +1100735 SKEY_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100736
Tim Rice4cec93f2002-02-26 08:40:48 -0800737 AC_MSG_CHECKING([for s/key support])
738 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100739 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800740#include <stdio.h>
741#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700742int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800743 ],
744 [AC_MSG_RESULT(yes)],
745 [
746 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100747 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
748 ])
749 fi
750 ]
751)
752
753# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700754TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100755AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700756 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
Damien Millera8e06ce2003-11-21 23:48:55 +1100757 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100758 [
759 if test "x$withval" != "xno" ; then
760 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700761 saved_LDFLAGS="$LDFLAGS"
762 saved_CPPFLAGS="$CPPFLAGS"
763 if test -n "${withval}" -a "${withval}" != "yes"; then
764 if test -d "${withval}/lib"; then
765 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700766 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700767 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700768 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700769 fi
770 else
771 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700772 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700773 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700774 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700775 fi
776 fi
777 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700778 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700779 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700780 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700781 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700782 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800783 LIBWRAP="-lwrap"
784 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100785 AC_MSG_CHECKING(for libwrap)
786 AC_TRY_LINK(
787 [
788#include <tcpd.h>
789 int deny_severity = 0, allow_severity = 0;
790 ],
791 [hosts_access(0);],
792 [
793 AC_MSG_RESULT(yes)
794 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800795 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700796 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100797 ],
798 [
799 AC_MSG_ERROR([*** libwrap missing])
800 ]
801 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800802 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100803 fi
804 ]
805)
806
Damien Millerfe1f1432003-02-24 15:45:42 +1100807dnl Checks for library functions. Please keep in alphabetical order
808AC_CHECK_FUNCS(\
Damien Millerf09ad862003-09-19 16:41:01 +1000809 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
Damien Miller5fe46a42003-06-05 09:53:31 +1000810 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000811 getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000812 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100813 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000814 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
Damien Miller6c4914a2004-03-03 11:08:59 +1100815 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
Damien Miller1340ec22003-05-20 09:24:42 +1000816 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Darren Tucker2a6b0292003-12-31 14:59:17 +1100817 setproctitle setregid setreuid setrlimit \
Damien Miller5fe46a42003-06-05 09:53:31 +1000818 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tucker2e8c0cc2003-10-07 17:49:56 +1000819 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
Darren Tucker86c093d2004-03-08 22:59:03 +1100820 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100821)
Tim Rice13aae5e2001-10-21 17:53:58 -0700822
Darren Tuckerd5e082f2003-09-22 12:08:23 +1000823# IRIX has a const char return value for gai_strerror()
824AC_CHECK_FUNCS(gai_strerror,[
825 AC_DEFINE(HAVE_GAI_STRERROR)
826 AC_TRY_COMPILE([
827#include <sys/types.h>
828#include <sys/socket.h>
829#include <netdb.h>
830
831const char *gai_strerror(int);],[
832char *str;
833
834str = gai_strerror(0);],[
835 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
836 [Define if gai_strerror() returns const char *])])])
837
Damien Millercd6853c2003-01-28 11:33:42 +1100838AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
839
Darren Tuckerf1159b52003-07-07 19:44:01 +1000840dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000841AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000842AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000843
Darren Tuckerb2427c82003-09-10 15:22:44 +1000844dnl tcsendbreak might be a macro
845AC_CHECK_DECL(tcsendbreak,
846 [AC_DEFINE(HAVE_TCSENDBREAK)],
Damien Millera8e06ce2003-11-21 23:48:55 +1100847 [AC_CHECK_FUNCS(tcsendbreak)],
Darren Tuckerb2427c82003-09-10 15:22:44 +1000848 [#include <termios.h>]
849)
850
Darren Tucker2a6b0292003-12-31 14:59:17 +1100851AC_CHECK_FUNCS(setresuid, [
852 dnl Some platorms have setresuid that isn't implemented, test for this
853 AC_MSG_CHECKING(if setresuid seems to work)
854 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100855#include <stdlib.h>
856#include <errno.h>
857int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100858 ],
859 [AC_MSG_RESULT(yes)],
Darren Tuckerfd0894a2004-01-09 00:19:25 +1100860 [AC_DEFINE(BROKEN_SETRESUID)
Darren Tucker2a6b0292003-12-31 14:59:17 +1100861 AC_MSG_RESULT(not implemented)]
862 )
863])
Darren Tuckere937be32003-12-17 18:53:26 +1100864
Darren Tucker2a6b0292003-12-31 14:59:17 +1100865AC_CHECK_FUNCS(setresgid, [
866 dnl Some platorms have setresgid that isn't implemented, test for this
867 AC_MSG_CHECKING(if setresgid seems to work)
868 AC_TRY_RUN([
Darren Tuckere937be32003-12-17 18:53:26 +1100869#include <stdlib.h>
870#include <errno.h>
871int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
Darren Tucker2a6b0292003-12-31 14:59:17 +1100872 ],
873 [AC_MSG_RESULT(yes)],
874 [AC_DEFINE(BROKEN_SETRESGID)
875 AC_MSG_RESULT(not implemented)]
876 )
877])
Darren Tuckere937be32003-12-17 18:53:26 +1100878
Damien Millerad833b32000-08-23 10:46:23 +1000879dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000880AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000881dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000882AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000883AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000884dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000885AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000886AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100887
Damien Millera8e06ce2003-11-21 23:48:55 +1100888AC_CHECK_FUNC(daemon,
Damien Miller04f80141999-11-19 15:32:34 +1100889 [AC_DEFINE(HAVE_DAEMON)],
890 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
891)
892
Damien Millera8e06ce2003-11-21 23:48:55 +1100893AC_CHECK_FUNC(getpagesize,
Damien Miller9fb07e42000-03-05 16:22:59 +1100894 [AC_DEFINE(HAVE_GETPAGESIZE)],
895 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
896)
897
Damien Millercb170cb2000-07-01 16:52:55 +1000898# Check for broken snprintf
899if test "x$ac_cv_func_snprintf" = "xyes" ; then
900 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
901 AC_TRY_RUN(
902 [
903#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700904int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000905 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100906 [AC_MSG_RESULT(yes)],
Damien Millercb170cb2000-07-01 16:52:55 +1000907 [
908 AC_MSG_RESULT(no)
909 AC_DEFINE(BROKEN_SNPRINTF)
910 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
911 ]
912 )
913fi
914
Damien Millere8328192003-01-07 15:18:32 +1100915dnl see whether mkstemp() requires XXXXXX
916if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
917AC_MSG_CHECKING([for (overly) strict mkstemp])
918AC_TRY_RUN(
919 [
920#include <stdlib.h>
921main() { char template[]="conftest.mkstemp-test";
922if (mkstemp(template) == -1)
923 exit(1);
924unlink(template); exit(0);
925}
926 ],
927 [
928 AC_MSG_RESULT(no)
929 ],
Damien Millera8e06ce2003-11-21 23:48:55 +1100930 [
Damien Millere8328192003-01-07 15:18:32 +1100931 AC_MSG_RESULT(yes)
932 AC_DEFINE(HAVE_STRICT_MKSTEMP)
933 ],
934 [
935 AC_MSG_RESULT(yes)
936 AC_DEFINE(HAVE_STRICT_MKSTEMP)
Damien Millera8e06ce2003-11-21 23:48:55 +1100937 ]
Damien Millere8328192003-01-07 15:18:32 +1100938)
939fi
940
Darren Tucker70a3d552003-08-21 17:58:29 +1000941dnl make sure that openpty does not reacquire controlling terminal
942if test ! -z "$check_for_openpty_ctty_bug"; then
943 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
944 AC_TRY_RUN(
945 [
946#include <stdio.h>
947#include <sys/fcntl.h>
948#include <sys/types.h>
949#include <sys/wait.h>
950
951int
952main()
953{
954 pid_t pid;
955 int fd, ptyfd, ttyfd, status;
956
957 pid = fork();
958 if (pid < 0) { /* failed */
959 exit(1);
960 } else if (pid > 0) { /* parent */
961 waitpid(pid, &status, 0);
Damien Millera8e06ce2003-11-21 23:48:55 +1100962 if (WIFEXITED(status))
Darren Tucker70a3d552003-08-21 17:58:29 +1000963 exit(WEXITSTATUS(status));
964 else
965 exit(2);
966 } else { /* child */
967 close(0); close(1); close(2);
968 setsid();
969 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
970 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
971 if (fd >= 0)
972 exit(3); /* Acquired ctty: broken */
973 else
974 exit(0); /* Did not acquire ctty: OK */
975 }
976}
977 ],
978 [
979 AC_MSG_RESULT(yes)
980 ],
981 [
982 AC_MSG_RESULT(no)
983 AC_DEFINE(SSHD_ACQUIRES_CTTY)
984 ]
985 )
986fi
987
Damien Miller606f8802000-09-16 15:39:56 +1100988AC_FUNC_GETPGRP
989
Damien Millera64b57a2001-01-17 10:44:13 +1100990# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000991PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100992AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100993 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100994 [
Damien Millera64b57a2001-01-17 10:44:13 +1100995 if test "x$withval" != "xno" ; then
Damien Miller0f47c532004-01-02 18:01:30 +1100996 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
997 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Damien Millera64b57a2001-01-17 10:44:13 +1100998 AC_MSG_ERROR([PAM headers not found])
999 fi
1000
1001 AC_CHECK_LIB(dl, dlopen, , )
1002 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1003 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001004 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +11001005
Damien Millera64b57a2001-01-17 10:44:13 +11001006 PAM_MSG="yes"
1007
1008 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -08001009 if test $ac_cv_lib_dl_dlopen = yes; then
1010 LIBPAM="-lpam -ldl"
1011 else
1012 LIBPAM="-lpam"
1013 fi
1014 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +11001015 fi
1016 ]
1017)
Damien Millera22ba012000-03-02 23:09:20 +11001018
Damien Millera64b57a2001-01-17 10:44:13 +11001019# Check for older PAM
1020if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +11001021 # Check PAM strerror arguments (old PAM)
1022 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1023 AC_TRY_COMPILE(
1024 [
Damien Miller81171112000-04-23 11:14:01 +10001025#include <stdlib.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001026#if defined(HAVE_SECURITY_PAM_APPL_H)
Damien Miller81171112000-04-23 11:14:01 +10001027#include <security/pam_appl.h>
Damien Miller0f47c532004-01-02 18:01:30 +11001028#elif defined (HAVE_PAM_PAM_APPL_H)
1029#include <pam/pam_appl.h>
1030#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001031 ],
1032 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
Damien Millera22ba012000-03-02 23:09:20 +11001033 [AC_MSG_RESULT(no)],
1034 [
1035 AC_DEFINE(HAVE_OLD_PAM)
1036 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +10001037 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +11001038 ]
Damien Millera64b57a2001-01-17 10:44:13 +11001039 )
Damien Millera22ba012000-03-02 23:09:20 +11001040fi
1041
Tim Riceaef73712002-05-11 13:17:42 -07001042# Search for OpenSSL
1043saved_CPPFLAGS="$CPPFLAGS"
1044saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +11001045AC_ARG_WITH(ssl-dir,
1046 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1047 [
Ben Lindstrom23e13712000-10-29 22:49:19 +00001048 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -07001049 if test -d "$withval/lib"; then
1050 if test -n "${need_dash_r}"; then
1051 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1052 else
1053 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1054 fi
1055 else
1056 if test -n "${need_dash_r}"; then
1057 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1058 else
1059 LDFLAGS="-L${withval} ${LDFLAGS}"
1060 fi
1061 fi
1062 if test -d "$withval/include"; then
1063 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1064 else
1065 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1066 fi
Damien Millera22ba012000-03-02 23:09:20 +11001067 fi
1068 ]
1069)
Tim Rice3d5352e2004-02-12 09:27:21 -08001070LIBS="-lcrypto $LIBS"
Tim Riceaef73712002-05-11 13:17:42 -07001071AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +10001072 [
Tim Riceaef73712002-05-11 13:17:42 -07001073 dnl Check default openssl install dir
1074 if test -n "${need_dash_r}"; then
1075 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001076 else
Tim Riceaef73712002-05-11 13:17:42 -07001077 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +10001078 fi
Tim Riceaef73712002-05-11 13:17:42 -07001079 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1080 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1081 [
1082 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1083 ]
1084 )
1085 ]
1086)
1087
Tim Riced730b782002-08-13 18:52:10 -07001088# Determine OpenSSL header version
1089AC_MSG_CHECKING([OpenSSL header version])
1090AC_TRY_RUN(
1091 [
1092#include <stdio.h>
1093#include <string.h>
1094#include <openssl/opensslv.h>
1095#define DATA "conftest.sslincver"
1096int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001097 FILE *fd;
1098 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001099
Damien Millera8e06ce2003-11-21 23:48:55 +11001100 fd = fopen(DATA,"w");
1101 if(fd == NULL)
1102 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001103
1104 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1105 exit(1);
1106
1107 exit(0);
1108}
1109 ],
1110 [
1111 ssl_header_ver=`cat conftest.sslincver`
1112 AC_MSG_RESULT($ssl_header_ver)
1113 ],
1114 [
1115 AC_MSG_RESULT(not found)
1116 AC_MSG_ERROR(OpenSSL version header not found.)
1117 ]
1118)
1119
1120# Determine OpenSSL library version
1121AC_MSG_CHECKING([OpenSSL library version])
1122AC_TRY_RUN(
1123 [
1124#include <stdio.h>
1125#include <string.h>
1126#include <openssl/opensslv.h>
1127#include <openssl/crypto.h>
1128#define DATA "conftest.ssllibver"
1129int main(void) {
Damien Millera8e06ce2003-11-21 23:48:55 +11001130 FILE *fd;
1131 int rc;
Tim Riced730b782002-08-13 18:52:10 -07001132
Damien Millera8e06ce2003-11-21 23:48:55 +11001133 fd = fopen(DATA,"w");
1134 if(fd == NULL)
1135 exit(1);
Tim Riced730b782002-08-13 18:52:10 -07001136
1137 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1138 exit(1);
1139
1140 exit(0);
1141}
1142 ],
1143 [
1144 ssl_library_ver=`cat conftest.ssllibver`
1145 AC_MSG_RESULT($ssl_library_ver)
1146 ],
1147 [
1148 AC_MSG_RESULT(not found)
1149 AC_MSG_ERROR(OpenSSL library not found.)
1150 ]
1151)
Damien Millera22ba012000-03-02 23:09:20 +11001152
Damien Millerec932372002-01-22 22:16:03 +11001153# Sanity check OpenSSL headers
1154AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1155AC_TRY_RUN(
1156 [
1157#include <string.h>
1158#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001159int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001160 ],
1161 [
1162 AC_MSG_RESULT(yes)
1163 ],
1164 [
1165 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001166 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1167Check config.log for details.
1168Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001169 ]
1170)
1171
Tim Rice3d5352e2004-02-12 09:27:21 -08001172# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1173# because the system crypt() is more featureful.
1174if test "x$check_for_libcrypt_before" = "x1"; then
1175 AC_CHECK_LIB(crypt, crypt)
1176fi
1177
Damien Millera8e06ce2003-11-21 23:48:55 +11001178# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
Tim Rice43fa5572004-02-11 14:46:40 -08001179# version in OpenSSL.
Damien Miller4f9f42a2003-05-10 19:28:02 +10001180if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001181 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001182fi
1183
Damien Miller6c21c512002-01-22 21:57:53 +11001184
1185### Configure cryptographic random number support
1186
1187# Check wheter OpenSSL seeds itself
1188AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1189AC_TRY_RUN(
1190 [
1191#include <string.h>
1192#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001193int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001194 ],
1195 [
1196 OPENSSL_SEEDS_ITSELF=yes
1197 AC_MSG_RESULT(yes)
1198 ],
1199 [
1200 AC_MSG_RESULT(no)
1201 # Default to use of the rand helper if OpenSSL doesn't
1202 # seed itself
1203 USE_RAND_HELPER=yes
1204 ]
1205)
1206
1207
1208# Do we want to force the use of the rand helper?
1209AC_ARG_WITH(rand-helper,
1210 [ --with-rand-helper Use subprocess to gather strong randomness ],
1211 [
1212 if test "x$withval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11001213 # Force use of OpenSSL's internal RNG, even if
Damien Miller6c21c512002-01-22 21:57:53 +11001214 # the previous test showed it to be unseeded.
1215 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1216 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1217 OPENSSL_SEEDS_ITSELF=yes
1218 USE_RAND_HELPER=""
1219 fi
1220 else
1221 USE_RAND_HELPER=yes
1222 fi
1223 ],
1224)
1225
1226# Which randomness source do we use?
1227if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1228 # OpenSSL only
1229 AC_DEFINE(OPENSSL_PRNG_ONLY)
1230 RAND_MSG="OpenSSL internal ONLY"
1231 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001232elif test ! -z "$USE_RAND_HELPER" ; then
1233 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001234 RAND_MSG="ssh-rand-helper"
1235 INSTALL_SSH_RAND_HELPER="yes"
1236fi
1237AC_SUBST(INSTALL_SSH_RAND_HELPER)
1238
1239### Configuration of ssh-rand-helper
1240
1241# PRNGD TCP socket
1242AC_ARG_WITH(prngd-port,
1243 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1244 [
Damien Millere996d722002-01-23 11:20:59 +11001245 case "$withval" in
1246 no)
1247 withval=""
1248 ;;
1249 [[0-9]]*)
1250 ;;
1251 *)
1252 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1253 ;;
1254 esac
1255 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001256 PRNGD_PORT="$withval"
1257 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1258 fi
1259 ]
1260)
1261
1262# PRNGD Unix domain socket
1263AC_ARG_WITH(prngd-socket,
1264 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1265 [
Damien Millere996d722002-01-23 11:20:59 +11001266 case "$withval" in
1267 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001268 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001269 ;;
1270 no)
1271 withval=""
1272 ;;
1273 /*)
1274 ;;
1275 *)
1276 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1277 ;;
1278 esac
1279
1280 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001281 if test ! -z "$PRNGD_PORT" ; then
1282 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1283 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001284 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001285 AC_MSG_WARN(Entropy socket is not readable)
1286 fi
1287 PRNGD_SOCKET="$withval"
1288 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1289 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001290 ],
1291 [
1292 # Check for existing socket only if we don't have a random device already
1293 if test "$USE_RAND_HELPER" = yes ; then
1294 AC_MSG_CHECKING(for PRNGD/EGD socket)
1295 # Insert other locations here
1296 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1297 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1298 PRNGD_SOCKET="$sock"
1299 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1300 break;
1301 fi
1302 done
1303 if test ! -z "$PRNGD_SOCKET" ; then
1304 AC_MSG_RESULT($PRNGD_SOCKET)
1305 else
1306 AC_MSG_RESULT(not found)
1307 fi
1308 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001309 ]
1310)
1311
1312# Change default command timeout for hashing entropy source
1313entropy_timeout=200
1314AC_ARG_WITH(entropy-timeout,
1315 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1316 [
1317 if test "x$withval" != "xno" ; then
1318 entropy_timeout=$withval
1319 fi
1320 ]
1321)
Damien Miller6c21c512002-01-22 21:57:53 +11001322AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1323
Damien Millerd3f6ad22002-06-25 10:24:47 +10001324SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001325AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001326 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001327 [
1328 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001329 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001330 fi
1331 ]
1332)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001333AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1334AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001335
Tim Rice88f2ab52002-03-17 12:17:34 -08001336# We do this little dance with the search path to insure
1337# that programs that we select for use by installed programs
1338# (which may be run by the super-user) come from trusted
1339# locations before they come from the user's private area.
1340# This should help avoid accidentally configuring some
1341# random version of a program in someone's personal bin.
1342
1343OPATH=$PATH
1344PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001345test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001346test -d /sbin && PATH=$PATH:/sbin
1347test -d /usr/sbin && PATH=$PATH:/usr/sbin
1348PATH=$PATH:/etc:$OPATH
1349
Damien Millera8e06ce2003-11-21 23:48:55 +11001350# These programs are used by the command hashing source to gather entropy
Damien Miller6c21c512002-01-22 21:57:53 +11001351OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1352OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1353OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1354OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1355OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1356OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1357OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1358OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1359OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1360OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1361OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1362OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1363OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1364OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1365OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1366OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001367# restore PATH
1368PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001369
1370# Where does ssh-rand-helper get its randomness from?
1371INSTALL_SSH_PRNG_CMDS=""
1372if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1373 if test ! -z "$PRNGD_PORT" ; then
1374 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1375 elif test ! -z "$PRNGD_SOCKET" ; then
1376 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1377 else
1378 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1379 RAND_HELPER_CMDHASH=yes
1380 INSTALL_SSH_PRNG_CMDS="yes"
1381 fi
1382fi
1383AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1384
1385
Ben Lindstromb5628642000-10-18 00:02:25 +00001386# Cheap hack to ensure NEWS-OS libraries are arranged right.
1387if test ! -z "$SONY" ; then
1388 LIBS="$LIBS -liberty";
1389fi
1390
Damien Millera22ba012000-03-02 23:09:20 +11001391# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001392AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001393AC_CHECK_SIZEOF(short int, 2)
1394AC_CHECK_SIZEOF(int, 4)
1395AC_CHECK_SIZEOF(long int, 4)
1396AC_CHECK_SIZEOF(long long int, 8)
1397
Damien Millerfa2bb692002-04-23 23:22:25 +10001398# Sanity check long long for some platforms (AIX)
1399if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1400 ac_cv_sizeof_long_long_int=0
1401fi
1402
Damien Millera22ba012000-03-02 23:09:20 +11001403# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001404AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1405 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001406 [ #include <sys/types.h> ],
1407 [ u_int a; a = 1;],
Damien Millercaf6dd62000-08-29 11:33:50 +11001408 [ ac_cv_have_u_int="yes" ],
1409 [ ac_cv_have_u_int="no" ]
1410 )
1411])
1412if test "x$ac_cv_have_u_int" = "xyes" ; then
1413 AC_DEFINE(HAVE_U_INT)
1414 have_u_int=1
1415fi
1416
Damien Miller61e50f12000-05-08 20:49:37 +10001417AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1418 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001419 [ #include <sys/types.h> ],
1420 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001421 [ ac_cv_have_intxx_t="yes" ],
1422 [ ac_cv_have_intxx_t="no" ]
1423 )
1424])
1425if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1426 AC_DEFINE(HAVE_INTXX_T)
1427 have_intxx_t=1
1428fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001429
1430if (test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001431 test "x$ac_cv_header_stdint_h" = "xyes")
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001432then
1433 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1434 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001435 [ #include <stdint.h> ],
1436 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001437 [
1438 AC_DEFINE(HAVE_INTXX_T)
1439 AC_MSG_RESULT(yes)
1440 ],
1441 [ AC_MSG_RESULT(no) ]
1442 )
1443fi
1444
Damien Miller578783e2000-09-23 14:12:24 +11001445AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1446 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001447 [
1448#include <sys/types.h>
1449#ifdef HAVE_STDINT_H
1450# include <stdint.h>
1451#endif
1452#include <sys/socket.h>
1453#ifdef HAVE_SYS_BITYPES_H
1454# include <sys/bitypes.h>
1455#endif
Damien Millera8e06ce2003-11-21 23:48:55 +11001456 ],
1457 [ int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001458 [ ac_cv_have_int64_t="yes" ],
1459 [ ac_cv_have_int64_t="no" ]
1460 )
1461])
1462if test "x$ac_cv_have_int64_t" = "xyes" ; then
1463 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001464fi
1465
Damien Miller61e50f12000-05-08 20:49:37 +10001466AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1467 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001468 [ #include <sys/types.h> ],
1469 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Damien Miller61e50f12000-05-08 20:49:37 +10001470 [ ac_cv_have_u_intxx_t="yes" ],
1471 [ ac_cv_have_u_intxx_t="no" ]
1472 )
1473])
1474if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1475 AC_DEFINE(HAVE_U_INTXX_T)
1476 have_u_intxx_t=1
1477fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001478
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001479if test -z "$have_u_intxx_t" ; then
1480 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1481 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001482 [ #include <sys/socket.h> ],
1483 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001484 [
1485 AC_DEFINE(HAVE_U_INTXX_T)
1486 AC_MSG_RESULT(yes)
1487 ],
1488 [ AC_MSG_RESULT(no) ]
1489 )
1490fi
1491
Damien Miller578783e2000-09-23 14:12:24 +11001492AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1493 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001494 [ #include <sys/types.h> ],
1495 [ u_int64_t a; a = 1;],
Damien Miller578783e2000-09-23 14:12:24 +11001496 [ ac_cv_have_u_int64_t="yes" ],
1497 [ ac_cv_have_u_int64_t="no" ]
1498 )
1499])
1500if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1501 AC_DEFINE(HAVE_U_INT64_T)
1502 have_u_int64_t=1
1503fi
1504
Tim Rice4cec93f2002-02-26 08:40:48 -08001505if test -z "$have_u_int64_t" ; then
1506 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1507 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001508 [ #include <sys/bitypes.h> ],
Tim Rice4cec93f2002-02-26 08:40:48 -08001509 [ u_int64_t a; a = 1],
1510 [
1511 AC_DEFINE(HAVE_U_INT64_T)
1512 AC_MSG_RESULT(yes)
1513 ],
1514 [ AC_MSG_RESULT(no) ]
1515 )
1516fi
1517
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001518if test -z "$have_u_intxx_t" ; then
1519 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1520 AC_TRY_COMPILE(
1521 [
1522#include <sys/types.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001523 ],
1524 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001525 [ ac_cv_have_uintxx_t="yes" ],
1526 [ ac_cv_have_uintxx_t="no" ]
1527 )
1528 ])
1529 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1530 AC_DEFINE(HAVE_UINTXX_T)
1531 fi
1532fi
1533
1534if test -z "$have_uintxx_t" ; then
1535 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1536 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001537 [ #include <stdint.h> ],
1538 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001539 [
1540 AC_DEFINE(HAVE_UINTXX_T)
1541 AC_MSG_RESULT(yes)
1542 ],
1543 [ AC_MSG_RESULT(no) ]
1544 )
1545fi
1546
Damien Milleredb82922000-06-20 13:25:52 +10001547if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
Damien Millera8e06ce2003-11-21 23:48:55 +11001548 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001549then
1550 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1551 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001552 [
1553#include <sys/bitypes.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001554 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001555 [
Damien Miller70494d12000-04-03 15:57:06 +10001556 int8_t a; int16_t b; int32_t c;
1557 u_int8_t e; u_int16_t f; u_int32_t g;
1558 a = b = c = e = f = g = 1;
Damien Millera8e06ce2003-11-21 23:48:55 +11001559 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001560 [
1561 AC_DEFINE(HAVE_U_INTXX_T)
1562 AC_DEFINE(HAVE_INTXX_T)
1563 AC_MSG_RESULT(yes)
1564 ],
1565 [AC_MSG_RESULT(no)]
Damien Millera8e06ce2003-11-21 23:48:55 +11001566 )
Damien Millerb29ea912000-01-15 14:12:03 +11001567fi
1568
Damien Miller58be7382001-09-15 21:31:54 +10001569
1570AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1571 AC_TRY_COMPILE(
1572 [
1573#include <sys/types.h>
1574 ],
1575 [ u_char foo; foo = 125; ],
1576 [ ac_cv_have_u_char="yes" ],
1577 [ ac_cv_have_u_char="no" ]
1578 )
1579])
1580if test "x$ac_cv_have_u_char" = "xyes" ; then
1581 AC_DEFINE(HAVE_U_CHAR)
1582fi
1583
Tim Rice13aae5e2001-10-21 17:53:58 -07001584TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001585
Tim Rice200a5c02002-02-26 22:12:34 -08001586AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001587
Damien Miller61e50f12000-05-08 20:49:37 +10001588AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1589 AC_TRY_COMPILE(
1590 [
1591#include <sys/types.h>
1592 ],
1593 [ size_t foo; foo = 1235; ],
1594 [ ac_cv_have_size_t="yes" ],
1595 [ ac_cv_have_size_t="no" ]
1596 )
1597])
1598if test "x$ac_cv_have_size_t" = "xyes" ; then
1599 AC_DEFINE(HAVE_SIZE_T)
1600fi
Damien Miller95058511999-12-29 10:36:45 +11001601
Damien Miller615f9392000-05-17 22:53:33 +10001602AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1603 AC_TRY_COMPILE(
1604 [
1605#include <sys/types.h>
1606 ],
1607 [ ssize_t foo; foo = 1235; ],
1608 [ ac_cv_have_ssize_t="yes" ],
1609 [ ac_cv_have_ssize_t="no" ]
1610 )
1611])
1612if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1613 AC_DEFINE(HAVE_SSIZE_T)
1614fi
1615
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001616AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1617 AC_TRY_COMPILE(
1618 [
1619#include <time.h>
1620 ],
1621 [ clock_t foo; foo = 1235; ],
1622 [ ac_cv_have_clock_t="yes" ],
1623 [ ac_cv_have_clock_t="no" ]
1624 )
1625])
1626if test "x$ac_cv_have_clock_t" = "xyes" ; then
1627 AC_DEFINE(HAVE_CLOCK_T)
1628fi
1629
Damien Millerb54b40e2000-06-23 08:23:34 +10001630AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1631 AC_TRY_COMPILE(
1632 [
1633#include <sys/types.h>
1634#include <sys/socket.h>
1635 ],
1636 [ sa_family_t foo; foo = 1235; ],
1637 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001638 [ AC_TRY_COMPILE(
1639 [
1640#include <sys/types.h>
1641#include <sys/socket.h>
1642#include <netinet/in.h>
1643 ],
1644 [ sa_family_t foo; foo = 1235; ],
1645 [ ac_cv_have_sa_family_t="yes" ],
1646
Damien Millerb54b40e2000-06-23 08:23:34 +10001647 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001648 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001649 )
1650])
1651if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1652 AC_DEFINE(HAVE_SA_FAMILY_T)
1653fi
1654
Damien Miller0f91b4e2000-06-18 15:43:25 +10001655AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1656 AC_TRY_COMPILE(
1657 [
1658#include <sys/types.h>
1659 ],
1660 [ pid_t foo; foo = 1235; ],
1661 [ ac_cv_have_pid_t="yes" ],
1662 [ ac_cv_have_pid_t="no" ]
1663 )
1664])
1665if test "x$ac_cv_have_pid_t" = "xyes" ; then
1666 AC_DEFINE(HAVE_PID_T)
1667fi
1668
1669AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1670 AC_TRY_COMPILE(
1671 [
1672#include <sys/types.h>
1673 ],
1674 [ mode_t foo; foo = 1235; ],
1675 [ ac_cv_have_mode_t="yes" ],
1676 [ ac_cv_have_mode_t="no" ]
1677 )
1678])
1679if test "x$ac_cv_have_mode_t" = "xyes" ; then
1680 AC_DEFINE(HAVE_MODE_T)
1681fi
1682
Damien Miller61e50f12000-05-08 20:49:37 +10001683
1684AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1685 AC_TRY_COMPILE(
1686 [
Damien Miller81171112000-04-23 11:14:01 +10001687#include <sys/types.h>
1688#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001689 ],
1690 [ struct sockaddr_storage s; ],
1691 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1692 [ ac_cv_have_struct_sockaddr_storage="no" ]
1693 )
1694])
1695if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1696 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1697fi
Damien Miller34132e52000-01-14 15:45:46 +11001698
Damien Miller61e50f12000-05-08 20:49:37 +10001699AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1700 AC_TRY_COMPILE(
1701 [
Damien Miller7b22d652000-06-18 14:07:04 +10001702#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001703#include <netinet/in.h>
1704 ],
1705 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1706 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1707 [ ac_cv_have_struct_sockaddr_in6="no" ]
1708 )
1709])
1710if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1711 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1712fi
Damien Miller34132e52000-01-14 15:45:46 +11001713
Damien Miller61e50f12000-05-08 20:49:37 +10001714AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1715 AC_TRY_COMPILE(
1716 [
Damien Miller7b22d652000-06-18 14:07:04 +10001717#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001718#include <netinet/in.h>
1719 ],
1720 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1721 [ ac_cv_have_struct_in6_addr="yes" ],
1722 [ ac_cv_have_struct_in6_addr="no" ]
1723 )
1724])
1725if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1726 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1727fi
Damien Miller34132e52000-01-14 15:45:46 +11001728
Damien Miller61e50f12000-05-08 20:49:37 +10001729AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1730 AC_TRY_COMPILE(
1731 [
Damien Miller81171112000-04-23 11:14:01 +10001732#include <sys/types.h>
1733#include <sys/socket.h>
1734#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001735 ],
1736 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1737 [ ac_cv_have_struct_addrinfo="yes" ],
1738 [ ac_cv_have_struct_addrinfo="no" ]
1739 )
1740])
1741if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1742 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1743fi
1744
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001745AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1746 AC_TRY_COMPILE(
Damien Millera8e06ce2003-11-21 23:48:55 +11001747 [ #include <sys/time.h> ],
1748 [ struct timeval tv; tv.tv_sec = 1;],
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001749 [ ac_cv_have_struct_timeval="yes" ],
1750 [ ac_cv_have_struct_timeval="no" ]
1751 )
1752])
1753if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1754 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1755 have_struct_timeval=1
1756fi
1757
Tim Rice4e4dc562003-03-18 10:21:40 -08001758AC_CHECK_TYPES(struct timespec)
1759
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001760# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001761if test "x$ac_cv_have_int64_t" = "xno" -a \
1762 "x$ac_cv_sizeof_long_int" != "x8" -a \
1763 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001764 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1765 echo "an alternative compiler (I.E., GCC) before continuing."
1766 echo ""
1767 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001768else
1769dnl test snprintf (broken on SCO w/gcc)
1770 AC_TRY_RUN(
1771 [
1772#include <stdio.h>
1773#include <string.h>
1774#ifdef HAVE_SNPRINTF
1775main()
1776{
1777 char buf[50];
1778 char expected_out[50];
1779 int mazsize = 50 ;
1780#if (SIZEOF_LONG_INT == 8)
1781 long int num = 0x7fffffffffffffff;
1782#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001783 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001784#endif
1785 strcpy(expected_out, "9223372036854775807");
1786 snprintf(buf, mazsize, "%lld", num);
1787 if(strcmp(buf, expected_out) != 0)
Damien Millera8e06ce2003-11-21 23:48:55 +11001788 exit(1);
Tim Ricebee3f222001-03-11 17:32:12 -08001789 exit(0);
1790}
1791#else
1792main() { exit(0); }
1793#endif
1794 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1795 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001796fi
1797
Damien Miller78315eb2000-09-29 23:01:36 +11001798dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001799OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1800OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1801OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1802OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1803OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001804OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001805OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1806OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001807OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001808OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1809OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1810OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1811OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001812OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1813OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1814OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1815OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001816
1817AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001818
Damien Miller61e50f12000-05-08 20:49:37 +10001819AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1820 ac_cv_have_ss_family_in_struct_ss, [
1821 AC_TRY_COMPILE(
1822 [
Damien Miller81171112000-04-23 11:14:01 +10001823#include <sys/types.h>
1824#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001825 ],
1826 [ struct sockaddr_storage s; s.ss_family = 1; ],
1827 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1828 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1829 )
1830])
1831if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1832 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1833fi
1834
Damien Miller61e50f12000-05-08 20:49:37 +10001835AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1836 ac_cv_have___ss_family_in_struct_ss, [
1837 AC_TRY_COMPILE(
1838 [
Damien Miller81171112000-04-23 11:14:01 +10001839#include <sys/types.h>
1840#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001841 ],
1842 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1843 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1844 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1845 )
1846])
1847if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1848 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1849fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001850
Damien Millerad833b32000-08-23 10:46:23 +10001851AC_CACHE_CHECK([for pw_class field in struct passwd],
1852 ac_cv_have_pw_class_in_struct_passwd, [
1853 AC_TRY_COMPILE(
1854 [
Damien Millerad833b32000-08-23 10:46:23 +10001855#include <pwd.h>
1856 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001857 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001858 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1859 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1860 )
1861])
1862if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1863 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1864fi
1865
Kevin Steves82456952001-06-22 21:14:18 +00001866AC_CACHE_CHECK([for pw_expire field in struct passwd],
1867 ac_cv_have_pw_expire_in_struct_passwd, [
1868 AC_TRY_COMPILE(
1869 [
1870#include <pwd.h>
1871 ],
1872 [ struct passwd p; p.pw_expire = 0; ],
1873 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1874 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1875 )
1876])
1877if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1878 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1879fi
1880
1881AC_CACHE_CHECK([for pw_change field in struct passwd],
1882 ac_cv_have_pw_change_in_struct_passwd, [
1883 AC_TRY_COMPILE(
1884 [
1885#include <pwd.h>
1886 ],
1887 [ struct passwd p; p.pw_change = 0; ],
1888 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1889 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1890 )
1891])
1892if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1893 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1894fi
Damien Miller61e50f12000-05-08 20:49:37 +10001895
Tim Rice28bbb0c2002-05-27 17:37:32 -07001896dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001897AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1898 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001899 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001900 [
Tim Riceae49fe62002-04-12 10:26:21 -07001901#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001902#include <sys/socket.h>
1903#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001904int main() {
1905#ifdef msg_accrights
1906exit(1);
1907#endif
1908struct msghdr m;
1909m.msg_accrights = 0;
1910exit(0);
1911}
Kevin Steves939c9db2002-03-22 17:23:25 +00001912 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001913 [ ac_cv_have_accrights_in_msghdr="yes" ],
1914 [ ac_cv_have_accrights_in_msghdr="no" ]
1915 )
1916])
1917if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1918 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1919fi
1920
Kevin Stevesa44e0352002-04-07 16:18:03 +00001921AC_CACHE_CHECK([for msg_control field in struct msghdr],
1922 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001923 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001924 [
Tim Riceae49fe62002-04-12 10:26:21 -07001925#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001926#include <sys/socket.h>
1927#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001928int main() {
1929#ifdef msg_control
1930exit(1);
1931#endif
1932struct msghdr m;
1933m.msg_control = 0;
1934exit(0);
1935}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001936 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001937 [ ac_cv_have_control_in_msghdr="yes" ],
1938 [ ac_cv_have_control_in_msghdr="no" ]
1939 )
1940])
1941if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1942 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1943fi
1944
Damien Miller61e50f12000-05-08 20:49:37 +10001945AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001946 AC_TRY_LINK([],
1947 [ extern char *__progname; printf("%s", __progname); ],
Damien Miller61e50f12000-05-08 20:49:37 +10001948 [ ac_cv_libc_defines___progname="yes" ],
1949 [ ac_cv_libc_defines___progname="no" ]
1950 )
1951])
1952if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1953 AC_DEFINE(HAVE___PROGNAME)
1954fi
1955
Kevin Steves4846f4a2002-03-22 18:19:53 +00001956AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1957 AC_TRY_LINK([
1958#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001959],
1960 [ printf("%s", __FUNCTION__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001961 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1962 [ ac_cv_cc_implements___FUNCTION__="no" ]
1963 )
1964])
1965if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1966 AC_DEFINE(HAVE___FUNCTION__)
1967fi
1968
1969AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1970 AC_TRY_LINK([
1971#include <stdio.h>
Damien Millera8e06ce2003-11-21 23:48:55 +11001972],
1973 [ printf("%s", __func__); ],
Kevin Steves4846f4a2002-03-22 18:19:53 +00001974 [ ac_cv_cc_implements___func__="yes" ],
1975 [ ac_cv_cc_implements___func__="no" ]
1976 )
1977])
1978if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1979 AC_DEFINE(HAVE___func__)
1980fi
1981
Damien Miller4f8e6692001-07-14 13:22:53 +10001982AC_CACHE_CHECK([whether getopt has optreset support],
1983 ac_cv_have_getopt_optreset, [
1984 AC_TRY_LINK(
1985 [
1986#include <getopt.h>
1987 ],
1988 [ extern int optreset; optreset = 0; ],
1989 [ ac_cv_have_getopt_optreset="yes" ],
1990 [ ac_cv_have_getopt_optreset="no" ]
1991 )
1992])
1993if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1994 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1995fi
Damien Millera22ba012000-03-02 23:09:20 +11001996
Damien Millerecbb26d2000-07-15 14:59:14 +10001997AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
Damien Millera8e06ce2003-11-21 23:48:55 +11001998 AC_TRY_LINK([],
1999 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
Damien Millerecbb26d2000-07-15 14:59:14 +10002000 [ ac_cv_libc_defines_sys_errlist="yes" ],
2001 [ ac_cv_libc_defines_sys_errlist="no" ]
2002 )
2003])
2004if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2005 AC_DEFINE(HAVE_SYS_ERRLIST)
2006fi
2007
2008
Damien Miller11fa2cc2000-08-16 10:35:58 +10002009AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
Damien Millera8e06ce2003-11-21 23:48:55 +11002010 AC_TRY_LINK([],
2011 [ extern int sys_nerr; printf("%i", sys_nerr);],
Damien Miller11fa2cc2000-08-16 10:35:58 +10002012 [ ac_cv_libc_defines_sys_nerr="yes" ],
2013 [ ac_cv_libc_defines_sys_nerr="no" ]
2014 )
2015])
2016if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2017 AC_DEFINE(HAVE_SYS_NERR)
2018fi
2019
Damien Millera8e06ce2003-11-21 23:48:55 +11002020SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002021# Check whether user wants sectok support
2022AC_ARG_WITH(sectok,
2023 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10002024 [
2025 if test "x$withval" != "xno" ; then
2026 if test "x$withval" != "xyes" ; then
2027 CPPFLAGS="$CPPFLAGS -I${withval}"
2028 LDFLAGS="$LDFLAGS -L${withval}"
2029 if test ! -z "$need_dash_r" ; then
2030 LDFLAGS="$LDFLAGS -R${withval}"
2031 fi
2032 if test ! -z "$blibpath" ; then
2033 blibpath="$blibpath:${withval}"
2034 fi
2035 fi
2036 AC_CHECK_HEADERS(sectok.h)
2037 if test "$ac_cv_header_sectok_h" != yes; then
2038 AC_MSG_ERROR(Can't find sectok.h)
2039 fi
2040 AC_CHECK_LIB(sectok, sectok_open)
2041 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2042 AC_MSG_ERROR(Can't find libsectok)
2043 fi
2044 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00002045 AC_DEFINE(USE_SECTOK)
Damien Millera8e06ce2003-11-21 23:48:55 +11002046 SCARD_MSG="yes, using sectok"
Ben Lindstroma42694f2002-04-05 16:11:45 +00002047 fi
2048 ]
2049)
2050
2051# Check whether user wants OpenSC support
2052AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10002053 AC_HELP_STRING([--with-opensc=PFX],
2054 [Enable smartcard support using OpenSC]),
2055 opensc_config_prefix="$withval", opensc_config_prefix="")
2056if test x$opensc_config_prefix != x ; then
2057 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2058 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2059 if test "$OPENSC_CONFIG" != "no"; then
2060 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2061 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2062 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2063 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2064 AC_DEFINE(SMARTCARD)
2065 AC_DEFINE(USE_OPENSC)
Damien Millera8e06ce2003-11-21 23:48:55 +11002066 SCARD_MSG="yes, using OpenSC"
Damien Millerf6195f22002-04-23 22:48:46 +10002067 fi
2068fi
Damien Miller85de5802001-09-18 14:01:11 +10002069
Darren Tucker5f88d342003-10-15 16:57:57 +10002070# Check libraries needed by DNS fingerprint support
Damien Millera8e06ce2003-11-21 23:48:55 +11002071AC_SEARCH_LIBS(getrrsetbyname, resolv,
Darren Tucker5f88d342003-10-15 16:57:57 +10002072 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
Damien Miller7abe09b2003-05-15 10:53:49 +10002073 [
Darren Tucker5f88d342003-10-15 16:57:57 +10002074 # Needed by our getrrsetbyname()
2075 AC_SEARCH_LIBS(res_query, resolv)
2076 AC_SEARCH_LIBS(dn_expand, resolv)
2077 AC_CHECK_FUNCS(_getshort _getlong)
2078 AC_CHECK_MEMBER(HEADER.ad,
2079 [AC_DEFINE(HAVE_HEADER_AD)],,
2080 [#include <arpa/nameser.h>])
2081 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10002082
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002083# Check whether user wants Kerberos 5 support
Damien Millera8e06ce2003-11-21 23:48:55 +11002084KRB5_MSG="no"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002085AC_ARG_WITH(kerberos5,
Damien Millera8e06ce2003-11-21 23:48:55 +11002086 [ --with-kerberos5=PATH Enable Kerberos 5 support],
Darren Tucker1d3ca582004-01-22 12:05:34 +11002087 [ if test "x$withval" != "xno" ; then
2088 if test "x$withval" = "xyes" ; then
2089 KRB5ROOT="/usr/local"
2090 else
2091 KRB5ROOT=${withval}
2092 fi
2093
2094 AC_DEFINE(KRB5)
2095 KRB5_MSG="yes"
2096
2097 AC_MSG_CHECKING(for krb5-config)
2098 if test -x $KRB5ROOT/bin/krb5-config ; then
2099 KRB5CONF=$KRB5ROOT/bin/krb5-config
2100 AC_MSG_RESULT($KRB5CONF)
2101
2102 AC_MSG_CHECKING(for gssapi support)
2103 if $KRB5CONF | grep gssapi >/dev/null ; then
2104 AC_MSG_RESULT(yes)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002105 AC_DEFINE(GSSAPI)
2106 k5confopts=gssapi
Damien Millera8e06ce2003-11-21 23:48:55 +11002107 else
Darren Tucker1d3ca582004-01-22 12:05:34 +11002108 AC_MSG_RESULT(no)
Darren Tucker0d27ed12004-02-24 10:37:33 +11002109 k5confopts=""
Damien Millera8e06ce2003-11-21 23:48:55 +11002110 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002111 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2112 K5LIBS="`$KRB5CONF --libs $k5confopts`"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002113 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
Darren Tucker1d3ca582004-01-22 12:05:34 +11002114 AC_MSG_CHECKING(whether we are using Heimdal)
2115 AC_TRY_COMPILE([ #include <krb5.h> ],
2116 [ char *tmp = heimdal_version; ],
2117 [ AC_MSG_RESULT(yes)
2118 AC_DEFINE(HEIMDAL) ],
2119 AC_MSG_RESULT(no)
2120 )
2121 else
2122 AC_MSG_RESULT(no)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002123 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
Damien Millera8e06ce2003-11-21 23:48:55 +11002124 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
Damien Millera8e06ce2003-11-21 23:48:55 +11002125 AC_MSG_CHECKING(whether we are using Heimdal)
2126 AC_TRY_COMPILE([ #include <krb5.h> ],
2127 [ char *tmp = heimdal_version; ],
2128 [ AC_MSG_RESULT(yes)
2129 AC_DEFINE(HEIMDAL)
2130 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
2131 ],
2132 [ AC_MSG_RESULT(no)
2133 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2134 ]
2135 )
Damien Miller200d0a72003-06-30 19:21:36 +10002136 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002137
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002138 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2139 [ AC_DEFINE(GSSAPI)
2140 K5LIBS="-lgssapi $K5LIBS" ],
2141 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2142 [ AC_DEFINE(GSSAPI)
Damien Millera8e06ce2003-11-21 23:48:55 +11002143 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002144 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2145 $K5LIBS)
2146 ],
2147 $K5LIBS)
2148
2149 AC_CHECK_HEADER(gssapi.h, ,
2150 [ unset ac_cv_header_gssapi_h
Damien Millera8e06ce2003-11-21 23:48:55 +11002151 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002152 AC_CHECK_HEADERS(gssapi.h, ,
2153 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
Damien Millera8e06ce2003-11-21 23:48:55 +11002154 )
Darren Tucker49aaf4a2003-08-26 11:58:16 +10002155 ]
2156 )
2157
2158 oldCPP="$CPPFLAGS"
2159 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2160 AC_CHECK_HEADER(gssapi_krb5.h, ,
2161 [ CPPFLAGS="$oldCPP" ])
2162
Damien Millera8e06ce2003-11-21 23:48:55 +11002163 fi
Darren Tucker1d3ca582004-01-22 12:05:34 +11002164 if test ! -z "$need_dash_r" ; then
2165 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2166 fi
2167 if test ! -z "$blibpath" ; then
2168 blibpath="$blibpath:${KRB5ROOT}/lib"
2169 fi
Darren Tucker0d27ed12004-02-24 10:37:33 +11002170 fi
2171
2172 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2173 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2174 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2175
2176 LIBS="$LIBS $K5LIBS"
2177 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
2178 ]
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002179)
Damien Millerc79bc0d2001-03-28 13:03:42 +10002180
Damien Millera22ba012000-03-02 23:09:20 +11002181# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002182
Damien Millerf58c6722002-05-13 13:15:42 +10002183PRIVSEP_PATH=/var/empty
2184AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002185 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002186 [
2187 if test "x$withval" != "$no" ; then
2188 PRIVSEP_PATH=$withval
2189 fi
2190 ]
2191)
2192AC_SUBST(PRIVSEP_PATH)
2193
Damien Millera22ba012000-03-02 23:09:20 +11002194AC_ARG_WITH(xauth,
2195 [ --with-xauth=PATH Specify path to xauth program ],
2196 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002197 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002198 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002199 fi
2200 ],
2201 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002202 TestPath="$PATH"
2203 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2204 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2205 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2206 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2207 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002208 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002209 xauth_path="/usr/openwin/bin/xauth"
2210 fi
2211 ]
2212)
2213
Damien Miller7d901272003-01-13 16:55:22 +11002214STRIP_OPT=-s
2215AC_ARG_ENABLE(strip,
2216 [ --disable-strip Disable calling strip(1) on install],
2217 [
2218 if test "x$enableval" = "xno" ; then
2219 STRIP_OPT=
2220 fi
2221 ]
2222)
2223AC_SUBST(STRIP_OPT)
2224
Damien Millera19cf472000-11-29 13:28:50 +11002225if test -z "$xauth_path" ; then
2226 XAUTH_PATH="undefined"
2227 AC_SUBST(XAUTH_PATH)
2228else
Damien Millera22ba012000-03-02 23:09:20 +11002229 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002230 XAUTH_PATH=$xauth_path
2231 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002232fi
Damien Millera22ba012000-03-02 23:09:20 +11002233
2234# Check for mail directory (last resort if we cannot get it from headers)
2235if test ! -z "$MAIL" ; then
2236 maildir=`dirname $MAIL`
2237 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2238fi
2239
Damien Millera22ba012000-03-02 23:09:20 +11002240if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002241 if test "x$disable_ptmx_check" != "xyes" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002242 AC_CHECK_FILE("/dev/ptmx",
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002243 [
2244 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2245 have_dev_ptmx=1
2246 ]
2247 )
2248 fi
Damien Millera22ba012000-03-02 23:09:20 +11002249fi
Damien Millera8e06ce2003-11-21 23:48:55 +11002250AC_CHECK_FILE("/dev/ptc",
Damien Miller204ad072000-03-02 23:56:12 +11002251 [
2252 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2253 have_dev_ptc=1
2254 ]
2255)
2256
Damien Millera22ba012000-03-02 23:09:20 +11002257# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002258AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002259 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002260 [
Damien Miller897741e2001-04-16 10:41:46 +10002261 case "$withval" in
2262 man|cat|doc)
2263 MANTYPE=$withval
2264 ;;
2265 *)
2266 AC_MSG_ERROR(invalid man type: $withval)
2267 ;;
2268 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002269 ]
2270)
Ben Lindstrombc709922001-04-18 18:04:21 +00002271if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002272 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2273 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002274 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2275 MANTYPE=doc
2276 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2277 MANTYPE=man
2278 else
2279 MANTYPE=cat
2280 fi
2281fi
Damien Miller670a4b82000-01-22 13:53:11 +11002282AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002283if test "$MANTYPE" = "doc"; then
2284 mansubdir=man;
2285else
2286 mansubdir=$MANTYPE;
2287fi
2288AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002289
Damien Millera22ba012000-03-02 23:09:20 +11002290# Check whether to enable MD5 passwords
Damien Millera8e06ce2003-11-21 23:48:55 +11002291MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002292AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002293 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002294 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002295 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002296 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Millera8e06ce2003-11-21 23:48:55 +11002297 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002298 fi
2299 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002300)
2301
Damien Millera22ba012000-03-02 23:09:20 +11002302# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002303AC_ARG_WITH(shadow,
2304 [ --without-shadow Disable shadow password support],
2305 [
2306 if test "x$withval" = "xno" ; then
2307 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002308 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002309 fi
2310 ]
2311)
2312
Damien Miller1f335fb2000-06-26 11:31:33 +10002313if test -z "$disable_shadow" ; then
2314 AC_MSG_CHECKING([if the systems has expire shadow information])
2315 AC_TRY_COMPILE(
2316 [
2317#include <sys/types.h>
2318#include <shadow.h>
2319 struct spwd sp;
2320 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2321 [ sp_expire_available=yes ], []
2322 )
2323
2324 if test "x$sp_expire_available" = "xyes" ; then
2325 AC_MSG_RESULT(yes)
2326 AC_DEFINE(HAS_SHADOW_EXPIRE)
2327 else
2328 AC_MSG_RESULT(no)
2329 fi
2330fi
2331
Damien Millera22ba012000-03-02 23:09:20 +11002332# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002333if test ! -z "$IPADDR_IN_DISPLAY" ; then
2334 DISPLAY_HACK_MSG="yes"
2335 AC_DEFINE(IPADDR_IN_DISPLAY)
2336else
Damien Millera8e06ce2003-11-21 23:48:55 +11002337 DISPLAY_HACK_MSG="no"
Damien Miller9a947342000-08-30 10:03:33 +11002338 AC_ARG_WITH(ipaddr-display,
2339 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2340 [
2341 if test "x$withval" != "xno" ; then
2342 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millera8e06ce2003-11-21 23:48:55 +11002343 DISPLAY_HACK_MSG="yes"
Damien Miller9a947342000-08-30 10:03:33 +11002344 fi
2345 ]
2346 )
2347fi
Damien Miller76112de1999-12-21 11:18:08 +11002348
Darren Tuckere1a790d2003-09-16 11:52:19 +10002349# check for /etc/default/login and use it if present.
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002350AC_ARG_ENABLE(etc-default-login,
2351 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2352[
Darren Tuckere1a790d2003-09-16 11:52:19 +10002353AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2354
2355if test "x$external_path_file" = "x/etc/default/login"; then
2356 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2357fi
Tim Rice7ff4e6d2003-09-22 19:50:14 -07002358])
Darren Tuckere1a790d2003-09-16 11:52:19 +10002359
Tim Rice43a1c132002-04-17 21:19:14 -07002360dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2361if test $ac_cv_func_login_getcapbool = "yes" -a \
2362 $ac_cv_header_login_cap_h = "yes" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002363 external_path_file=/etc/login.conf
Tim Rice43a1c132002-04-17 21:19:14 -07002364fi
Darren Tuckere1a790d2003-09-16 11:52:19 +10002365
Damien Millera22ba012000-03-02 23:09:20 +11002366# Whether to mess with the default path
Damien Millera8e06ce2003-11-21 23:48:55 +11002367SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002368AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002369 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002370 [
Darren Tuckere1a790d2003-09-16 11:52:19 +10002371 if test "x$external_path_file" = "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002372 AC_MSG_WARN([
2373--with-default-path=PATH has no effect on this system.
2374Edit /etc/login.conf instead.])
2375 elif test "x$withval" != "xno" ; then
Tim Riceb925b4b2003-09-15 22:40:49 -07002376 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002377 AC_MSG_WARN([
2378--with-default-path=PATH will only be used if PATH is not defined in
2379$external_path_file .])
2380 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002381 user_path="$withval"
Damien Millera8e06ce2003-11-21 23:48:55 +11002382 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002383 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002384 ],
Darren Tuckere1a790d2003-09-16 11:52:19 +10002385 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2386 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
Tim Rice43a1c132002-04-17 21:19:14 -07002387 else
Tim Riceb925b4b2003-09-15 22:40:49 -07002388 if test ! -z "$external_path_file" ; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002389 AC_MSG_WARN([
2390If PATH is defined in $external_path_file, ensure the path to scp is included,
2391otherwise scp will not work.])
2392 fi
2393 AC_TRY_RUN(
2394 [
Tim Rice59ea0a02001-03-10 13:50:45 -08002395/* find out what STDPATH is */
2396#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002397#ifdef HAVE_PATHS_H
2398# include <paths.h>
2399#endif
2400#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002401# ifdef _PATH_USERPATH /* Irix */
2402# define _PATH_STDPATH _PATH_USERPATH
2403# else
2404# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2405# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002406#endif
2407#include <sys/types.h>
2408#include <sys/stat.h>
2409#include <fcntl.h>
2410#define DATA "conftest.stdpath"
2411
2412main()
2413{
2414 FILE *fd;
2415 int rc;
2416
2417 fd = fopen(DATA,"w");
2418 if(fd == NULL)
2419 exit(1);
2420
2421 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2422 exit(1);
2423
2424 exit(0);
2425}
2426 ], [ user_path=`cat conftest.stdpath` ],
2427 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2428 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2429 )
2430# make sure $bindir is in USER_PATH so scp will work
2431 t_bindir=`eval echo ${bindir}`
2432 case $t_bindir in
2433 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2434 esac
2435 case $t_bindir in
2436 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2437 esac
2438 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2439 if test $? -ne 0 ; then
2440 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2441 if test $? -ne 0 ; then
2442 user_path=$user_path:$t_bindir
2443 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2444 fi
2445 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002446 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002447)
Darren Tuckere1a790d2003-09-16 11:52:19 +10002448if test "x$external_path_file" != "x/etc/login.conf" ; then
Tim Rice43a1c132002-04-17 21:19:14 -07002449 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2450 AC_SUBST(user_path)
2451fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002452
Damien Millera18bbd32002-05-13 10:48:57 +10002453# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002454AC_ARG_WITH(superuser-path,
2455 [ --with-superuser-path= Specify different path for super-user],
2456 [
2457 if test "x$withval" != "xno" ; then
2458 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2459 superuser_path=$withval
2460 fi
2461 ]
2462)
2463
2464
Damien Miller61e50f12000-05-08 20:49:37 +10002465AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Millera8e06ce2003-11-21 23:48:55 +11002466IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002467AC_ARG_WITH(4in6,
2468 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2469 [
2470 if test "x$withval" != "xno" ; then
2471 AC_MSG_RESULT(yes)
2472 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002473 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002474 else
2475 AC_MSG_RESULT(no)
2476 fi
2477 ],[
2478 if test "x$inet6_default_4in6" = "xyes"; then
2479 AC_MSG_RESULT([yes (default)])
2480 AC_DEFINE(IPV4_IN_IPV6)
Damien Millera8e06ce2003-11-21 23:48:55 +11002481 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002482 else
2483 AC_MSG_RESULT([no (default)])
2484 fi
2485 ]
2486)
2487
Damien Miller60396b02001-02-18 17:01:00 +11002488# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002489BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002490AC_ARG_WITH(bsd-auth,
2491 [ --with-bsd-auth Enable BSD auth support],
2492 [
2493 if test "x$withval" != "xno" ; then
2494 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002495 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002496 fi
2497 ]
2498)
2499
Damien Millera22ba012000-03-02 23:09:20 +11002500# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002501piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002502# make sure the directory exists
2503if test ! -d $piddir ; then
2504 piddir=`eval echo ${sysconfdir}`
2505 case $piddir in
Damien Millera8e06ce2003-11-21 23:48:55 +11002506 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
Damien Miller78315eb2000-09-29 23:01:36 +11002507 esac
2508fi
2509
Tim Rice88f2ab52002-03-17 12:17:34 -08002510AC_ARG_WITH(pid-dir,
2511 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2512 [
2513 if test "x$withval" != "xno" ; then
2514 piddir=$withval
2515 if test ! -d $piddir ; then
2516 AC_MSG_WARN([** no $piddir directory on this system **])
2517 fi
2518 fi
2519 ]
2520)
2521
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002522AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002523AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002524
andre2ff7b5d2000-06-03 14:57:40 +00002525dnl allow user to disable some login recording features
2526AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002527 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002528 [
2529 if test "x$enableval" = "xno" ; then
2530 AC_DEFINE(DISABLE_LASTLOG)
2531 fi
2532 ]
andre2ff7b5d2000-06-03 14:57:40 +00002533)
2534AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002535 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002536 [
2537 if test "x$enableval" = "xno" ; then
2538 AC_DEFINE(DISABLE_UTMP)
2539 fi
2540 ]
andre2ff7b5d2000-06-03 14:57:40 +00002541)
2542AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002543 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002544 [
2545 if test "x$enableval" = "xno" ; then
2546 AC_DEFINE(DISABLE_UTMPX)
2547 fi
2548 ]
andre2ff7b5d2000-06-03 14:57:40 +00002549)
2550AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002551 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002552 [
2553 if test "x$enableval" = "xno" ; then
2554 AC_DEFINE(DISABLE_WTMP)
2555 fi
2556 ]
andre2ff7b5d2000-06-03 14:57:40 +00002557)
2558AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002559 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002560 [
2561 if test "x$enableval" = "xno" ; then
2562 AC_DEFINE(DISABLE_WTMPX)
2563 fi
2564 ]
andre2ff7b5d2000-06-03 14:57:40 +00002565)
2566AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002567 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002568 [
2569 if test "x$enableval" = "xno" ; then
2570 AC_DEFINE(DISABLE_LOGIN)
2571 fi
2572 ]
andre2ff7b5d2000-06-03 14:57:40 +00002573)
2574AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002575 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002576 [
2577 if test "x$enableval" = "xno" ; then
Damien Millera8e06ce2003-11-21 23:48:55 +11002578 AC_DEFINE(DISABLE_PUTUTLINE)
Darren Tuckera3020db2003-06-28 12:54:33 +10002579 fi
2580 ]
andre2ff7b5d2000-06-03 14:57:40 +00002581)
2582AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002583 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002584 [
2585 if test "x$enableval" = "xno" ; then
2586 AC_DEFINE(DISABLE_PUTUTXLINE)
2587 fi
2588 ]
andre2ff7b5d2000-06-03 14:57:40 +00002589)
2590AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002591 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002592 [
2593 if test "x$withval" = "xno" ; then
2594 AC_DEFINE(DISABLE_LASTLOG)
2595 else
2596 conf_lastlog_location=$withval
2597 fi
2598 ]
2599)
andre2ff7b5d2000-06-03 14:57:40 +00002600
2601dnl lastlog, [uw]tmpx? detection
2602dnl NOTE: set the paths in the platform section to avoid the
2603dnl need for command-line parameters
2604dnl lastlog and [uw]tmp are subject to a file search if all else fails
2605
2606dnl lastlog detection
2607dnl NOTE: the code itself will detect if lastlog is a directory
2608AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2609AC_TRY_COMPILE([
2610#include <sys/types.h>
2611#include <utmp.h>
2612#ifdef HAVE_LASTLOG_H
2613# include <lastlog.h>
2614#endif
Damien Miller2994e082000-06-04 15:51:47 +10002615#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002616# include <paths.h>
2617#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002618#ifdef HAVE_LOGIN_H
2619# include <login.h>
2620#endif
andre2ff7b5d2000-06-03 14:57:40 +00002621 ],
2622 [ char *lastlog = LASTLOG_FILE; ],
2623 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002624 [
2625 AC_MSG_RESULT(no)
2626 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2627 AC_TRY_COMPILE([
2628#include <sys/types.h>
2629#include <utmp.h>
2630#ifdef HAVE_LASTLOG_H
2631# include <lastlog.h>
2632#endif
2633#ifdef HAVE_PATHS_H
2634# include <paths.h>
2635#endif
2636 ],
2637 [ char *lastlog = _PATH_LASTLOG; ],
2638 [ AC_MSG_RESULT(yes) ],
2639 [
andree441aa32000-06-12 22:34:38 +00002640 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002641 system_lastlog_path=no
2642 ])
2643 ]
andre2ff7b5d2000-06-03 14:57:40 +00002644)
Damien Miller2994e082000-06-04 15:51:47 +10002645
andre2ff7b5d2000-06-03 14:57:40 +00002646if test -z "$conf_lastlog_location"; then
2647 if test x"$system_lastlog_path" = x"no" ; then
2648 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002649 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002650 conf_lastlog_location=$f
2651 fi
2652 done
2653 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002654 AC_MSG_WARN([** Cannot find lastlog **])
2655 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002656 fi
2657 fi
2658fi
2659
2660if test -n "$conf_lastlog_location"; then
2661 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2662fi
2663
2664dnl utmp detection
2665AC_MSG_CHECKING([if your system defines UTMP_FILE])
2666AC_TRY_COMPILE([
2667#include <sys/types.h>
2668#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002669#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002670# include <paths.h>
2671#endif
2672 ],
2673 [ char *utmp = UTMP_FILE; ],
2674 [ AC_MSG_RESULT(yes) ],
2675 [ AC_MSG_RESULT(no)
2676 system_utmp_path=no ]
2677)
2678if test -z "$conf_utmp_location"; then
2679 if test x"$system_utmp_path" = x"no" ; then
2680 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2681 if test -f $f ; then
2682 conf_utmp_location=$f
2683 fi
2684 done
2685 if test -z "$conf_utmp_location"; then
2686 AC_DEFINE(DISABLE_UTMP)
2687 fi
2688 fi
2689fi
2690if test -n "$conf_utmp_location"; then
2691 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2692fi
2693
2694dnl wtmp detection
2695AC_MSG_CHECKING([if your system defines WTMP_FILE])
2696AC_TRY_COMPILE([
2697#include <sys/types.h>
2698#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002699#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002700# include <paths.h>
2701#endif
2702 ],
2703 [ char *wtmp = WTMP_FILE; ],
2704 [ AC_MSG_RESULT(yes) ],
2705 [ AC_MSG_RESULT(no)
2706 system_wtmp_path=no ]
2707)
2708if test -z "$conf_wtmp_location"; then
2709 if test x"$system_wtmp_path" = x"no" ; then
2710 for f in /usr/adm/wtmp /var/log/wtmp; do
2711 if test -f $f ; then
2712 conf_wtmp_location=$f
2713 fi
2714 done
2715 if test -z "$conf_wtmp_location"; then
2716 AC_DEFINE(DISABLE_WTMP)
2717 fi
2718 fi
2719fi
2720if test -n "$conf_wtmp_location"; then
2721 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2722fi
2723
2724
2725dnl utmpx detection - I don't know any system so perverse as to require
2726dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2727dnl there, though.
2728AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2729AC_TRY_COMPILE([
2730#include <sys/types.h>
2731#include <utmp.h>
2732#ifdef HAVE_UTMPX_H
2733#include <utmpx.h>
2734#endif
Damien Miller2994e082000-06-04 15:51:47 +10002735#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002736# include <paths.h>
2737#endif
2738 ],
2739 [ char *utmpx = UTMPX_FILE; ],
2740 [ AC_MSG_RESULT(yes) ],
2741 [ AC_MSG_RESULT(no)
2742 system_utmpx_path=no ]
2743)
2744if test -z "$conf_utmpx_location"; then
2745 if test x"$system_utmpx_path" = x"no" ; then
2746 AC_DEFINE(DISABLE_UTMPX)
2747 fi
2748else
2749 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2750fi
2751
2752dnl wtmpx detection
2753AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2754AC_TRY_COMPILE([
2755#include <sys/types.h>
2756#include <utmp.h>
2757#ifdef HAVE_UTMPX_H
2758#include <utmpx.h>
2759#endif
Damien Miller2994e082000-06-04 15:51:47 +10002760#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002761# include <paths.h>
2762#endif
2763 ],
2764 [ char *wtmpx = WTMPX_FILE; ],
2765 [ AC_MSG_RESULT(yes) ],
2766 [ AC_MSG_RESULT(no)
2767 system_wtmpx_path=no ]
2768)
2769if test -z "$conf_wtmpx_location"; then
2770 if test x"$system_wtmpx_path" = x"no" ; then
2771 AC_DEFINE(DISABLE_WTMPX)
2772 fi
2773else
2774 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2775fi
2776
Damien Miller4018c192000-04-30 09:30:44 +10002777
Damien Miller29ea30d2000-03-17 10:54:15 +11002778if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002779 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2780 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002781fi
2782
Tim Rice4cec93f2002-02-26 08:40:48 -08002783dnl remove pam and dl because they are in $LIBPAM
2784if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002785 LIBS=`echo $LIBS | sed 's/-lpam //'`
2786fi
2787if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2788 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002789fi
2790
Damien Millerbac2d8a2000-09-05 16:13:06 +11002791AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002792AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2793AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002794
Damien Miller7b22d652000-06-18 14:07:04 +10002795# Print summary of options
2796
Damien Miller7b22d652000-06-18 14:07:04 +10002797# Someone please show me a better way :)
2798A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2799B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2800C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2801D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002802E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002803F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002804G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002805H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2806I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2807J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002808
2809echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002810echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002811echo " User binaries: $B"
2812echo " System binaries: $C"
2813echo " Configuration files: $D"
2814echo " Askpass program: $E"
2815echo " Manual pages: $F"
2816echo " PID file: $G"
2817echo " Privilege separation chroot path: $H"
Darren Tuckere1a790d2003-09-16 11:52:19 +10002818if test "x$external_path_file" = "x/etc/login.conf" ; then
2819echo " At runtime, sshd will use the path defined in $external_path_file"
2820echo " Make sure the path to scp is present, otherwise scp will not work"
Tim Rice43a1c132002-04-17 21:19:14 -07002821else
Damien Millerf58c6722002-05-13 13:15:42 +10002822echo " sshd default user PATH: $I"
Tim Riceb925b4b2003-09-15 22:40:49 -07002823 if test ! -z "$external_path_file"; then
Darren Tuckere1a790d2003-09-16 11:52:19 +10002824echo " (If PATH is set in $external_path_file it will be used instead. If"
2825echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2826 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002827fi
Damien Millera18bbd32002-05-13 10:48:57 +10002828if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002829echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002830fi
Damien Millerf58c6722002-05-13 13:15:42 +10002831echo " Manpage format: $MANTYPE"
Damien Miller7abe09b2003-05-15 10:53:49 +10002832echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002833echo " KerberosV support: $KRB5_MSG"
2834echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002835echo " S/KEY support: $SKEY_MSG"
2836echo " TCP Wrappers support: $TCPW_MSG"
2837echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002838echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002839echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2840echo " BSD Auth support: $BSD_AUTH_MSG"
2841echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002842if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002843echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002844fi
2845
Damien Miller7b22d652000-06-18 14:07:04 +10002846echo ""
2847
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002848echo " Host: ${host}"
2849echo " Compiler: ${CC}"
2850echo " Compiler flags: ${CFLAGS}"
2851echo "Preprocessor flags: ${CPPFLAGS}"
2852echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002853echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002854
2855echo ""
2856
Damien Miller82cf0ce2000-12-20 13:34:48 +11002857if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002858 echo "PAM is enabled. You may need to install a PAM control file "
2859 echo "for sshd, otherwise password authentication may fail. "
Damien Millera8e06ce2003-11-21 23:48:55 +11002860 echo "Example PAM control files can be found in the contrib/ "
Damien Miller6c21c512002-01-22 21:57:53 +11002861 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002862 echo ""
2863fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002864
Damien Miller6c21c512002-01-22 21:57:53 +11002865if test ! -z "$RAND_HELPER_CMDHASH" ; then
2866 echo "WARNING: you are using the builtin random number collection "
2867 echo "service. Please read WARNING.RNG and request that your OS "
2868 echo "vendor includes kernel-based random number collection in "
2869 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002870 echo ""
2871fi
Damien Miller60396b02001-02-18 17:01:00 +11002872